openapi: 3.0.0
servers:
  - description: SwaggerHub server provided by  Swagger
    url: https://virtserver.swaggerhub.com/Macagua/SimpleBackOffice/1.0.0
info:
  description: This is an api for Operation CPG project.
  version: 0.1.0
  title: Operation CPG API
  license:
    name: Apache 2.0
    url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
  contact:
    name: Yenier Jimenez <yjmorales86@gmail.com>


#************************************
#******** Paths *********************
#************************************
paths:
  /admin/security/user/{id}/remove:
    post:
      x-symfony-controller: App\Api\Security\User\Controller\UserApiController::remove
      tags:
        - User
      summary: Removes the user represented by `id`.
      operationId: removeUserById
      description: Removes the user represented by `id`.
      responses:
        '200':
          description: Removes the user represented by `id` and returns its data.
          content:
            application/json:
              schema:
                type: object
                properties:
                  user:
                    $ref: '#/components/schemas/User'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
        '500':
          $ref: '#/components/responses/ServerErrorResponse'

  /admin/team-member/{id}/remove:
      post:
        x-symfony-controller: App\Api\TeamMember\Controller\TeamMemberApiController::remove
        tags:
          - User
        summary: Removes the team member represented by `id`.
        operationId: removeTeamMemberById
        description: Removes the team member represented by `id`.
        responses:
          '200':
            description: Removes the team member represented by `id`.
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    user:
                      $ref: '#/components/schemas/TeamMember'
          '400':
            $ref: '#/components/responses/BadRequestResponse'
          '500':
            $ref: '#/components/responses/ServerErrorResponse'

  /about:
      get:
        x-symfony-controller: App\Api\About\Controller\AboutApiController::content
        tags:
          - About
        summary: Get the About page content
        operationId: getAboutPageContent
        description: Get the About page content
        responses:
          '200':
            description: Get the About page content
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    data:
                      $ref: '#/components/schemas/TeamMember'
          '400':
            $ref: '#/components/responses/BadRequestResponse'
          '500':
            $ref: '#/components/responses/ServerErrorResponse'

#************************************
#************************************
#******** Components ****************
#************************************
components:
  #************************************
  #...Schemas
  schemas:
    User:
      type: object
      description: The present object represents a user entity.
      properties:
        id:
          description: An unique identifier associated with the user.
          type: integer
          example: 1
        email:
          type: string
          description: Holds the official user email acting as username.
          maxLength: 255
          nullable: false
          example: 'john@gmail.com'
        active:
          type: boolean
          description: Holds a boolean indicator of whether the user is active or not.
          example: true
        roles:
          type: array
          description: Holds the list of roles a user held.
          example: ['ROLE_ADMIN']

    About:
      type: object
      description: The present object represents the About page content.
      properties:
        text:
          type: string
          description: Holds the About page content.
          nullable: true
          example: 'Content'

    #....Errors
    BaseError:
      description: The base error object parent to all documented errors.
      type: object
      properties:
        type:
          description: >-
            The specific error type. The client *SHOULD* use this value to
            determine which type of error is provided.
          type: string
          example: PayloadValidationError
          enum:
            - UnexpectedFailure
            - PayloadValidationError

    EntityNotFoundError:
      allOf:
        - $ref: '#/components/schemas/BaseError'
      type: object

    UnexpectedFailure:
      allOf:
        - $ref: '#/components/schemas/BaseError'
      type: object
      properties:
        type:
          description: >-
            This error covers any other type of failure regarding the internal logic.
          example: UnexpectedFailure
          type: string
          enum:
            - UnexpectedFailure
        message:
          type: string
          example: An unexpected error has occurred.

  #************************************

  #...Parameters
  parameters:
    identifierParameter:
      in: path
      name: id
      description: An identifier value.
      required: true
      schema:
        type: integer
        format: int32
        minimum: 1
      example: 1
    limitQueryParameter:
      in: query
      name: limit
      description: A value to limit the count of values to return
      required: false
      schema:
        type: integer
        format: int32
        minimum: 1
        nullable: true
      example: 25
    pageQueryParameter:
      in: query
      name: page
      description: The number of the page.
      required: false
      schema:
        type: integer
        format: int32
        minimum: 1
        default: 1
        nullable: true
      example: 1

  #************************************
  #...Responses
  responses:
    EmptySuccessResponse:
      description: A successful response that does not contain a body.
      content:
        application/json:
          schema:
            type: object

    EntityNotFoundResponse:
      description: The requested entity was not found.
      content:
        application/json:
          schema:
            type: object
            oneOf:
              - $ref: '#/components/schemas/EntityNotFoundError'

    BadRequestResponse:
      description: >-
        The server cannot or will not process the request due to an apparent client error
      content:
        application/json:
          schema:
            type: object
            oneOf:
              - $ref: '#/components/schemas/UnexpectedFailure'

    ServerErrorResponse:
      description: The server or the application returned an unexpected error.
      content:
        application/json:
          schema:
            type: object
            oneOf:
              - $ref: '#/components/schemas/UnexpectedFailure'