Endpoints

POST /feedback/ratings
  Summary: Submit a post-game player rating
  Body: gameId, raterId, targetUserId, rating (1–5), optional comment
  Auth: Required

GET /feedback/ratings/{userId}
  Summary: Get average rating + recent feedback for a user
  Response: RatingSummary

POST /feedback/reports
  Summary: Report inappropriate behavior
  Body: gameId, reporterId, reportedUserId, reason (enum), optional message
  Auth: Required

GET /feedback/reports/modqueue
  Summary: Get open moderation queue (admin only)
  Auth: Admin-only

🧩 Data Model (MVP)

Rating {
  id: UUID,
  gameId: UUID,
  raterId: UUID,
  targetUserId: UUID,
  score: integer (1-5),
  comment: string,
  createdAt: datetime
}

Report {
  id: UUID,
  gameId: UUID,
  reporterId: UUID,
  reportedUserId: UUID,
  reason: enum("no_show", "abusive", "other"),
  message: string,
  status: enum("open", "reviewed", "resolved", "dismissed"),
  createdAt: datetime,
  reviewedBy: UUID (optional)
}

📤 Events Emitted


🛡️ Access Control

Role Permissions
Player Submit rating, file report
Admin/Mod Access mod queue, change report status
openapi: 3.0.0
info:
  title: Match Made Feedback API
  version: 1.0.0
paths:
  /feedback/ratings:
    post:
      summary: Submit a post-game rating
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Rating'
      responses:
        '200':
          description: Rating submitted

  /feedback/ratings/{userId}:
    get:
      summary: Get a user's rating summary
      parameters:
        - in: path
          name: userId
          required: true
          schema: { type: string }
      responses:
        '200':
          description: Rating summary
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RatingSummary'

  /feedback/reports:
    post:
      summary: File a report against a player
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Report'
      responses:
        '200':
          description: Report submitted

  /feedback/reports/modqueue:
    get:
      summary: View all open reports (admin only)
      responses:
        '200':
          description: List of reports
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Report'

components:
  schemas:
    Rating:
      type: object
      properties:
        gameId: { type: string }
        raterId: { type: string }
        targetUserId: { type: string }
        score: { type: integer, minimum: 1, maximum: 5 }
        comment: { type: string }

    RatingSummary:
      type: object
      properties:
        userId: { type: string }
        averageScore: { type: number }
        totalRatings: { type: integer }
        recentComments:
          type: array
          items:
            type: string

    Report:
      type: object
      properties:
        gameId: { type: string }
        reporterId: { type: string }
        reportedUserId: { type: string }
        reason:
          type: string
          enum: [no_show, abusive, other]
        message: { type: string }
        status:
          type: string
          enum: [open, reviewed, resolved, dismissed]
        reviewedBy: { type: string }