openapi: 3.0.2
paths:

  /admin/disciplines:
    post:
      summary: Create a new discipline
      tags:
        - Discipline

      security:
        - bearerAuth: []

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

      responses:
        201:
          description: Discipline created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Discipline created successfully
                  discipline:
                    $ref: '#/components/schemas/DisciplineResponse'

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

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

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

    get:
      summary: Retrieve a list of all disciplines
      tags:
        - Discipline

      responses:
        200:
          description: A list of disciplines
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/DisciplineResponse'

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

  /admin/disciplines/{id}:
    get:
      summary: Retrieve a Discipline by ID
      tags:
        - Discipline

      parameters:
        - $ref: '#/components/parameters/IdParameter'

      responses:
        200:
          description: A single Discipline object
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DisciplineResponse'

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

        404:
          $ref: '#/components/responses/NotFoundError'

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

    put:
      summary: Update a Discipline's information by ID
      tags:
        - Discipline

      security:
        - bearerAuth: []

      parameters:
        - $ref: '#/components/parameters/IdParameter'

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

      responses:
        200:
          description: Discipline updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Discipline updated successfully
                  discipline:
                    $ref: '#/components/schemas/DisciplineResponse'

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

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

        404:
          $ref: '#/components/responses/NotFoundError'

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

    delete:
      summary: Delete a Discipline by ID
      tags:
        - Discipline

      security:
        - bearerAuth: []

      parameters:
        - $ref: '#/components/parameters/IdParameter'

      responses:
        200:
          description: Discipline deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Discipline deleted successfully
                  discipline:
                    $ref: '#/components/schemas/DisciplineResponse'

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

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

        404:
          $ref: '#/components/responses/NotFoundError'

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