openapi: 3.0.2
paths:

  /app/students/auth/register:
    post:
      summary: Register a new Student
      tags:
        - Auth
        - Students

      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RegisterStudent'

      responses:
        201:
          description: Student registered successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Registered successfully
                  data:
                    $ref: '#/components/schemas/StudentResponse'

        400:
          $ref: '#/components/responses/BadRequest'

        500:
          $ref: '#/components/responses/InternalServerError'

  /app/students/auth/login:
    post:
      summary: Login and get token
      tags:
        - Auth
        - Students

      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - password
              properties:
                email:
                  type: string
                  format: email
                  description: User's email
                  example: user.email@example.com
                password:
                  type: string
                  format: password
                  description: User's password
                  example: '@Password123!'

      responses:
        200:
          description: Login successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Login successfully
                  token:
                    type: string
                    example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...

        400:
          $ref: '#/components/responses/BadRequest'

        401:
          $ref: '#/components/responses/Unauthorized'

        500:
          $ref: '#/components/responses/InternalServerError'

  /app/students/auth/forgot-password:
    post:
      summary: Request password reset
      tags:
        - Auth
        - Students

      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
              properties:
                email:
                  type: string
                  format: email
                  description: User's registered email
                  example: john.doe@example.com

      responses:
        200:
          description: Password reset code sent
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Password reset code sent to email

        400:
          $ref: '#/components/responses/BadRequest'

        500:
          $ref: '#/components/responses/InternalServerError'

  /app/students/auth/reset-password:
    post:
      summary: Reset password using code
      tags:
        - Auth
        - Students

      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - code
                - newPassword
              properties:
                email:
                  type: string
                  format: email
                  description: User's registered email
                  example: john.doe@example.com
                code:
                  type: string
                  description: Reset code received via email
                  example: 123456
                newPassword:
                  type: string
                  description: New password
                  example: N3wP@ssw0rd!

      responses:
        200:
          description: Password reset successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Password reset successfully
                  data:
                    $ref: '#/components/schemas/StudentResponse'

        400:
          $ref: '#/components/responses/BadRequest'

        500:
          $ref: '#/components/responses/InternalServerError'
