Endpoints

yaml
CopyEdit
POST /notifications/send
  Summary: Send custom notification (used by internal services)
  Body:
    - userId(s), message, type, deliveryMethod
  Auth: Service-to-service only
  Response: 200 OK

GET /notifications/preferences
  Summary: Get user notification preferences
  Auth: Required
  Response: NotificationPreferences

PUT /notifications/preferences
  Summary: Update user notification preferences
  Body: NotificationPreferences
  Response: 200 OK


🧩 NotificationPreferences Schema (MVP)

NotificationPreferences {
  userId: UUID,
  pushEnabled: boolean,
  smsEnabled: boolean,
  emailEnabled: boolean,
  quietHours: { start: string, end: string },
  updatedAt: datetime
}

🔁 Consumes Events

Event Action
game.invite.sent Push invite to player
game.joined Notify organizer
game.cancelled Notify all participants
user.rated Push rating feedback
matchmaking.recommendation.generated (opt-in) Weekly digest

🛠 Implementation Notes

openapi: 3.0.0
info:
  title: Match Made Notification API
  version: 1.0.0
paths:
  /notifications/send:
    post:
      summary: Send a custom notification (internal use)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationRequest'
      responses:
        '200':
          description: Notification dispatched

  /notifications/preferences:
    get:
      summary: Get current user's notification preferences
      responses:
        '200':
          description: Preferences retrieved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotificationPreferences'
    put:
      summary: Update current user's notification preferences
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NotificationPreferences'
      responses:
        '200':
          description: Preferences updated

components:
  schemas:
    NotificationRequest:
      type: object
      properties:
        userIds:
          type: array
          items: { type: string }
        message:
          type: string
        type:
          type: string
          enum: [invite, reminder, alert, rating_request]
        deliveryMethod:
          type: string
          enum: [push, sms, email]

    NotificationPreferences:
      type: object
      properties:
        userId: { type: string }
        pushEnabled: { type: boolean }
        smsEnabled: { type: boolean }
        emailEnabled: { type: boolean }
        quietHours:
          type: object
          properties:
            start: { type: string }
            end: { type: string }
        updatedAt: { type: string, format: date-time }