openapi: 3.0.0
security:
  - BearerAuth: []

components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

tags:
  - name: Profile
    description: API endpoints for managing profile

paths:

  /api/profile/me:
    get:
      summary: Get current user
      tags: [Profile]
      security:
        - BearerAuth: []
      responses:
        200:
          description: User logged in successfully  
        401:
          description: Unauthorized
        403:
          description: Forbidden
        500:
          description: Internal server error

  /api/profile/update-profile:
    put:
      summary: Update user profile
      tags: [Profile]
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
                - email
              properties:
                name:
                  type: string
                  example: Sadikxya
                gender:
                  type: string
                  example: male
                contact:
                  type: string
                  example: 9823540623
                deliveryAddresses:
                  type: string
                  example: 123 Main St, Anytown, USA
      responses:
        200:
          description: User profile updated successfully

  /api/profile/change-password:
    patch:  
      summary: Change password
      tags: [Profile]
      security:
        - BearerAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema: 
              type: object
              required:
                - currentPassword
                - newPassword
              properties:
                currentPassword:
                  type: string
                  format: password
                  example: Admin123!
                newPassword:
                  type: string
                  format: password
                  example: Admin123!
      responses:
        200:
          description: Password changed successfully
        401:
          description: Unauthorized
        403:
          description: Forbidden
        500:
          description: Internal server error

  /api/profile/add-favourite-dish/{dishId}:
    patch:
      summary: Add favourite dish
      tags: [Profile]
      security:
        - BearerAuth: []
      parameters:
        - name: dishId
          in: path
          required: true
          schema:
            type: string
      responses:
        200:
          description: Favourite dish added successfully
        401:
          description: Unauthorized
        403:
          description: Forbidden
        500:
          description: Internal server error

  /api/profile/remove-favourite-dish/{dishId}:
    patch:
      summary: Remove favourite dish
      tags: [Profile]
      security:
        - BearerAuth: []
      parameters:
        - name: dishId
          in: path
          required: true
          schema:
            type: string
      responses:
        200:
          description: Favourite dish removed successfully
        401:
          description: Unauthorized
        403:
          description: Forbidden
        500:
          description: Internal server error

  /api/profile/get-favourite-dishes:
    get:
      summary: Get favourite dishes
      tags: [Profile]
      security:
        - BearerAuth: []
      responses:
        200:
          description: Favourite dishes fetched successfully
        401:
          description: Unauthorized
        403:
          description: Forbidden
        500:
          description: Internal server error