openapi: 3.1.0

info:
  title: Job Posting API
  version: "1.0.0"
  description: |
    The Job Posting API allows Vagas for Business customers to post jobs via an HTTP call in JSON format.

    ## Authentication

    The authentication for using this API can be done in two ways:

    - Client Credencials
      - The job will be created with user identification of _admin_ as responsible
    - Autorization Code (3-legged)
      - The job will be created with the given user in the authorization steps as responsible

    ### Client Credencials

    This process consists of a direct POST call to the gateway indicating the credentials to obtain the access token.

    Considering that the credentials were created in the gateway, just make a call according to the example:

    ```
    curl -X POST -k -H 'Content-Type: application/x-www-form-urlencoded' -i 'https://apigateway.vagas.com.br/oauth/token' --data 'grant_type=client_credentials' -u 'client_id:client_secret'
    ```

    The return will be:

    ```json
    {
      "access_token": "asd23sde12e123sd",
      "expires_in": 2591999,
      "token_type": "Bearer"
    }
    ```

    For all other requests below, the __access\_token__ must be
    included in the request as a Authorization HEADER attribute in BEARER token format

    Remembering that __access\_token__ has a time limit for use, the information returned in the key
    __expires\_in__ indicates the number of seconds that the token will expire from its generation date.

    __Exemple request using the __access\_token__:__

    ```shell
    # Example token the must be added in the Authorization HEADER:
    # Authorization: Bearer asd23sde12e123sd
    CURL example:
    curl -XGET <URL TBD>
        --header “Authorization: Bearer asd23sde12e123sd”
    ```

    ### Autorization Code (3-legged)

    This process implements the OAuth 2.0 specification for authentication and authorization.

    This authentication follows the "three leg" approach:

    - The __remote service__ requests __user__ (Jobs For Business employee)
      to authenticate to a __VAGAS API__ server

    #### How to get the token

    The remote service starts the process by calling the PATH /oauth/authorize
    from the VAGAS API server, sending as parameters:

    - __client_id__: Application ID (Provided by VAGAS team)
    - __login_type__: Type of login ID (must send the value "empresa")
    - __response_type__: Type of response ID (must send "code")
    - __redirect_uri__: URI that will be redirected when login action succeeds or fails

    __Exemple:__
    ```
    https://apigateway.vagas.com.br/oauth/authorize?response_type=code&client_id=some_application_id&login_type=empresa&redirect_uri=http%3A%2F%2Flocalhost%2Foauth%2Fcode_callback
    ```

    The user will authenticate with their credentials and authorize the use of their information
    by the remote service.

    When the user accepts the authorization, the VAGAS API server will redirect back
    to the remote service using the address indicated by the redirect_uri parameter
    with an authorization code.

    __Exemple:__
    ```
    http://localhost/oauth/code_callback?code=AixUbVTop239876
    ```

    In case of unauthorized request, the call will be to the same URI
    informed in the redirect_uri parameter with the error parameter.

    __Exemple:__
    ```
    http://localhost/oauth/code_callback?error=unauthorized-request
    ```

    Using the code returned above, the remote service must request
    an access token that will be used for all other requests.

    Making a new request via an HTTP POST to the route
    /oauth/token using the "application/x-www-form-urlencoded" format with the following parameters:

    - __code__: The authorization code (received in the previous request)
    - __grant_type__: Should have the value: "authorization_code"

    It must also be included in the request HEADER an attribute with the client\_id and client\_secret information concatenated
    by a colon (:) and encoded in Base64

    __Example:__

    - Having the client\_id equal to __"example"__ and a client\_secret equal to __"emi40QrBjUiPaVC2eGK5"__
    - Must be concatenated: __example:emi40QrBjUiPaVC2eGK5__
    - Applied Base64 on above value: __ZXhhbXBsZTplbWk0MFFyQmpVaVBhVkMyZUdLNQ==__
    - Included in the HEADER of the request: __Authorization: Basic ZXhhbXBsZTplbWk0MFFyQmpVaVBhVkMyZUdLNQ==__

    __Exemple Curl:__

    ```shell
    curl -XPOST https://apigateway.vagas.com.br/oauth/token \
        --header “Authorization: Basic ZXhhbXBsZTplbWk0MFFyQmpVaVBhVkMyZUdLNQ==” \
        --data “code=AixUbVTop239876&grant_type=authorization_code”
    ```

    __The return of the request, if successful will be:__
    ```json
     {
       "access_token": "asd23sde12e123sd",
       "expired_in": 2591999
     }
    ```

    For all other requests below, the __access\_token__ must be
    included in the request as a HEADER attribute in BEARER format

    Remembering that __access\_token__ has a time limit for use, the information returned
    in the key __expires\_in__ indicates the number of seconds that the token will expire from its generation date.

    __Example call using __access\_token__:__

    ```shell
    # Example value that must be included in the request HEADER:
    # Authorization: Bearer asd23sde12e123sd
    CURL example:
    curl -XGET <URL TBD>
         --header “Authorization: Bearer asd23sde12e123sd”
    ```

servers:
  - url: https://apigateway.vagas.com.br/v1

security:
  - OAuth2: []

tags:
  - name: Lists
    description: Endpoints for returning information necessary for job creation.
  - name: Jobs

paths:
  /job-posting/benefits:
    get:
      tags: [Lists]
      summary: List Benefits
      operationId: listBenefits
      description: List of benefits the company offers
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/Benefit' }

  /dominios/paises/{pais_id}/estados/{estado_id}/cidades:
    get:
      tags: [Lists]
      summary: List Cities
      operationId: listCities
      description: List all cities of a state or province
      parameters:
        - name: pais_id
          in: path
          required: true
          description: Country ID
          schema: { type: integer }
          example: 999
        - name: estado_id
          in: path
          required: true
          description: State ID
          schema: { type: integer }
          example: 999
        - name: nome
          in: query
          required: false
          description: Search by the name of the city
          schema: { type: string }
          example: Sao Paulo
        - name: nome_exato
          in: query
          required: false
          description: Search by the exact name of the city
          schema: { type: boolean }
          example: true
        - name: descricao
          in: query
          required: false
          description: Search by the city's description
          schema: { type: string }
          example: Sao Paulo/SP/BR
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/City' }

  /job-posting/divisions:
    get:
      tags: [Lists]
      summary: List Company Divisions
      operationId: listCompanyDivisions
      description: List divisions of the company
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/Divisions' }

  /dominios/modelos-contratuais:
    get:
      tags: [Lists]
      summary: List Contract Type
      operationId: listContractType
      description: List contract types
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/ContractModel' }

  /dominios/paises:
    get:
      tags: [Lists]
      summary: List Countries
      operationId: listCountries
      description: List of countries
      parameters:
        - name: associacoes
          in: query
          required: false
          description: |
            Extends possible country associations: document types and states.
            For example, if you want to get the documents associated with a country, the parameter associacoes[]=tipos_de_documento must be informed
          schema:
            type: array
            items: { type: string }
          example: ["tipos_de_documento", "estado"]
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/Country' }

  /dominios/niveis_de_escolaridade:
    get:
      tags: [Lists]
      summary: List Education Levels
      operationId: listEducationLevels
      description: List education levels
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/LevelOfSchooling' }

  /dominios/setores:
    get:
      tags: [Lists]
      summary: List Fields of Activity
      operationId: listFieldsOfActivity
      description: |
        List of all registered fields of activity of a company
        Some examples of fields of expertise are: customer service, purchasing, etc...
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/Area' }

  /job-posting/forms:
    get:
      tags: [Lists]
      summary: List Forms
      operationId: listForms
      description: List forms available to add in a job
      parameters:
        - name: pagina
          in: query
          required: false
          description: Page to request
          schema: { type: integer, default: 1 }
          example: 1
        - name: tamanho_pagina
          in: query
          required: false
          description: Records per page
          schema: { type: integer, default: 10 }
          example: 10
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema: { $ref: '#/components/schemas/FormsResponse' }

  /dominios/niveis_hierarquicos:
    get:
      tags: [Lists]
      summary: List Hierarchical Levels
      operationId: listHierarchicalLevels
      description: List hierarchical levels
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/HierarchicalLevels' }

  /v1/job-posting/job_models:
    get:
      tags: [Lists]
      summary: List Job Models
      operationId: listJobModels
      description: List jobs that can be used as template in the job creation
      parameters:
        - name: pagina
          in: query
          required: false
          description: Page to request
          schema: { type: integer, default: 1 }
          example: 2
        - name: tamanho_pagina
          in: query
          required: false
          description: Records per page
          schema: { type: integer, default: 10 }
          example: 15
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/JobModelResponse' }

  /dominios/idiomas:
    get:
      tags: [Lists]
      summary: List Languages
      operationId: listLanguages
      description: List languages available to be added in the job requirements
      parameters:
        - name: nome
          in: query
          required: false
          description: Name of the language or just the begining
          schema: { type: string }
          example: Espanhol
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/Language' }

  /job-posting/partner_channels:
    get:
      tags: [Lists]
      summary: List Partner channels
      operationId: listPartnerChannels
      description: List of available partner channels
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/PartnerChannels' }

  /job-posting/phases:
    get:
      tags: [Lists]
      summary: List Phases
      operationId: listPhases
      description: List hiring process phases
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/Phases' }

  /job-posting/presentations:
    get:
      tags: [Lists]
      summary: List Presentations
      operationId: listPresentations
      description: Presentations of the company of the authenticated user
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/Presentations' }

  /dominios/paises/{pais_id}/estados:
    get:
      tags: [Lists]
      summary: List States
      operationId: listStates
      description: List the states of given country
      parameters:
        - name: pais_id
          in: path
          required: true
          description: Country id
          schema: { type: integer }
          example: 999
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/StateResponse' }

  /dominios/modelos-locais-trabalho:
    get:
      tags: [Lists]
      summary: List Work model
      operationId: listWorkModel
      description: List of work models
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/WorkLocation' }

  /job-posting/jobs:
    post:
      tags: [Jobs]
      summary: Post Job
      operationId: postJob
      description: |
        Endpoint to publish job in the Vagas for Business system

        The attributes *cargo*, *descrição do anuncio* and *outros requisitos do anúncio* accept some HTML tags, allowed options are listed below.

        *Allowed HTML tags*:

        - span
        - br
        - p
        - ul
        - ol
        - li
        - b
        - i
        - u
        - strong
        - em
        - div
        - h1
        - h2
        - h3
        - h4
        - h5
        - h6
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/JobCreateParams' }
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema: { $ref: '#/components/schemas/Job' }

  /job-posting/jobs/{id}:
    patch:
      tags: [Jobs]
      summary: Edit Job
      operationId: editJob
      description: |
        Endpoint to edit job in the Vagas for Business system

        The attributes *cargo*, *descrição do anuncio* and *outros requisitos do anúncio* accept some HTML tags, allowed options are listed below.

        *Allowed HTML tags*:

        - span
        - br
        - p
        - ul
        - ol
        - li
        - b
        - i
        - u
        - strong
        - em
        - div
        - h1
        - h2
        - h3
        - h4
        - h5
        - h6
      parameters:
        - name: id
          in: path
          required: true
          description: Job ID
          schema: { type: string }
          example: "23423"
      requestBody:
        required: true
        content:
          application/json:
            schema: { $ref: '#/components/schemas/JobUpdateParams' }
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema: { $ref: '#/components/schemas/Job' }

components:
  securitySchemes:
    OAuth2:
      type: oauth2
      description: |
        See **Authentication** above. The __access\_token__ must be included in the request
        as a Authorization HEADER attribute in BEARER token format.
      flows:
        clientCredentials:
          tokenUrl: https://apigateway.vagas.com.br/oauth/token
          scopes: {}
        authorizationCode:
          authorizationUrl: https://apigateway.vagas.com.br/oauth/authorize
          tokenUrl: https://apigateway.vagas.com.br/oauth/token
          scopes: {}

  schemas:
    IdAndDescription:
      type: object
      properties:
        id: { type: integer, example: 999 }
        descricao: { type: string, example: Uma descrição, description: Description }

    Area:
      $ref: '#/components/schemas/IdAndDescription'

    ContractModel:
      $ref: '#/components/schemas/IdAndDescription'

    HierarchicalLevels:
      $ref: '#/components/schemas/IdAndDescription'

    Benefit:
      type: object
      properties:
        id: { type: integer, example: 34 }
        descricao:
          type: string
          example: Horário flexível
          description: Benefit description (name)
        permite_valor: { type: boolean, example: false, description: Allow value }

    BenefitParams:
      type: object
      required: [id]
      properties:
        id: { type: integer, example: 2 }
        valor: { type: number, example: 80, description: Value }

    City:
      type: object
      properties:
        id: { type: integer, example: 1 }
        nome: { type: string, example: Sao Paulo, description: Name }
        descricao: { type: string, example: Sao Paulo/SP/BR, description: Description }
        latitude: { type: number, example: 1.5 }
        longitude: { type: number, example: 1.8 }
        lat: { type: number, example: 23.5475 }
        lng: { type: number, example: 46.63611111111111 }
        capital:
          type: boolean
          example: true
          description: If  the city is state capital
        estado_id: { type: integer, example: 128, description: State ID }
        pais_id: { type: integer, example: 128, description: Country ID }

    Country:
      type: object
      properties:
        id: { type: integer, example: 31 }
        sigla: { type: string, example: BR, description: State acronym }
        nome: { type: string, example: Brazil, description: Name }
        codigo_telefonico:
          type: string
          example: "55"
          description: Country phone code
        estados:
          type: array
          items: { $ref: '#/components/schemas/State' }
          description: List of country states
        tipos_de_documento:
          type: array
          items: { $ref: '#/components/schemas/DocumentType' }
          description: Type of documents

    Divisions:
      type: object
      properties:
        id: { type: integer, example: 72590 }
        nome: { type: string, example: Recrutamento Interno, description: Name }

    DocumentType:
      type: object
      properties:
        id: { type: integer, example: 38 }
        pais_id: { type: integer, example: 3, description: Country ID }
        nome: { type: string, example: Passport (AFG), description: Name }

    Form:
      type: object
      properties:
        id: { type: integer, example: 312065 }
        identificacao:
          type: string
          example: Teste de língua portuguesa - VAGAS - Resultado
          description: Identification (Name) of the form

    FormsResponse:
      type: object
      properties:
        total: { type: integer, example: 173 }
        total_paginas: { type: integer, example: 18, description: Total Pages }
        pagina_atual: { type: integer, example: 5, description: Current page }
        tamanho_pagina: { type: integer, example: 10, description: Page size }
        fichas:
          type: array
          items: { $ref: '#/components/schemas/Form' }
          description: Forms

    JobModel:
      allOf:
        - $ref: '#/components/schemas/IdAndDescription'
        - type: object
          properties:
            data_criacao:
              type: string
              example: "2021-09-03T16:58:48-03:00"
              description: Created at
            titulo:
              type: string
              example: Analista Suporte Teste Aline
              description: Title

    JobModelResponse:
      type: object
      properties:
        total: { type: integer, example: 173, description: Total }
        total_paginas: { type: integer, example: 18, description: Total pages }
        pagina_atual: { type: integer, example: 5, description: Current page }
        anuncios:
          type: array
          items: { $ref: '#/components/schemas/JobModel' }
          description: Job models

    Language:
      type: object
      properties:
        id: { type: integer, example: 999 }
        nome: { type: string, example: nome de identificação, description: Name }

    LanguageParams:
      type: object
      required: [id, nivel_id]
      properties:
        id: { type: integer, example: 534 }
        nivel_id:
          type: integer
          enum: [1, 2, 3, 4, 5]
          example: 5
          description: |
            Level ID

            - 1 - None
            - 2 - Basic
            - 3 - Intermediate
            - 4 - Advanced
            - 5 - Fluent

    LevelOfSchooling:
      type: object
      properties:
        id: { type: integer, example: 999 }
        descricao: { type: string, example: Uma descrição, description: Description }
        ordenacao: { type: integer, example: 25, description: Order }
        tipo: { type: string, example: High School, description: type }

    PartnerChannels:
      type: object
      properties:
        id: { type: integer, example: 1 }
        nome: { type: string, example: Linkedin, description: Name }
        texto:
          type: string
          example: Fundado em 2003, o LinkedIn conecta os profissionais do mundo ...
          description: Description text

    Phases:
      type: object
      properties:
        id: { type: integer, example: 1 }
        nome: { type: string, example: vaga teste, description: Name }
        sigla: { type: string, example: VAGTEST, description: Phase Acronym }
        ordem: { type: integer, example: 2, description: Order }

    Presentations:
      type: object
      properties:
        id: { type: integer, example: 1 }
        nome_template:
          type: string
          example: Programa de Trainee
          description: Presentation name
        descricao: { type: string, example: Descrição da empresa, description: Description }
        nome_empresa: { type: string, example: Empresa XPTO, description: Company name }
        confidencial: { type: boolean, example: false, description: Confidential }

    State:
      type: object
      properties:
        id: { type: integer, example: 1 }
        nome: { type: string, example: Acre, description: Name }
        pais_id: { type: integer, example: 31, description: Country ID }
        sigla_pais: { type: string, example: BR, description: County acronym }

    StateResponse:
      type: object
      properties:
        id: { type: integer, example: 999 }
        nome: { type: string, example: nome de identificação, description: Name }
        descricao: { type: string, example: Uma descrição, description: Description }
        sigla: { type: string, example: SP, description: State acronym }

    WorkLocation:
      type: object
      properties:
        id: { type: integer, example: 1 }
        tipo: { type: string, example: home_office, description: Type }
        nome: { type: string, example: 100% Home Office, description: Name }

    Anuncio:
      type: object
      required: [descricao, outros_requisitos]
      properties:
        descricao:
          type: string
          example: Job description
          description: Description of the job
        outros_requisitos:
          type: string
          example: English certificate
          description: Field to add other requirements for the job

    Salario:
      type: object
      description: Salary fields
      required: [exibir_salario_no_anuncio]
      properties:
        tipo_moeda:
          type: string
          enum: [BRL, USD]
          example: BRL
          description: Currency of the salary, if `exibir_salario_no_anuncio` is true, this field is required
        faixa_salario_min:
          type: number
          example: 999
          description: Minimum value of the salary range, if `exibir_salario_no_anuncio` is true, this field is required
        faixa_salario_max:
          type: number
          example: 999
          description: Maximum vlaue of the salary range, if `exibir_salario_no_anuncio` is true, this field is required
        exibir_salario_no_anuncio:
          type: boolean
          example: true
          description: If false, the salary will be in agreement

    LocalDeTrabalhoParams:
      type: object
      properties:
        pais_id:
          type: integer
          example: 999
          description: |
            Country ID
            The ID can be obtained in the endpoint `/v1/dominios/paises/`.
        estado_id:
          type: integer
          example: 999
          description: |
            State ID
            The ID can be obtained in the endpoint `/v1/dominios/paises/:pais_id/estados`.
        cidade_id:
          type: integer
          example: 999
          description: |
            City ID
            The ID can be obtained in the endpoint `/v1/dominios/paises/:pais_id/estados/:estado_id/cidades`.

    LocalAceitaCandidaturas:
      type: string
      enum: [somente_cidade, cidades_proximas, qualquer_cidade]
      example: cidades_proximas
      description: |
        Enum with the location which the application is accepted, apenas da cidade, cidades próximas or
        qualquer cidade. If the value is `somente_cidade`, accepts applicants who have registered the
        city of the job in the region of interest with the "Use my address" option turned on. If the value is
        `cidades_proximas`, accepts applicants who have registered the city of the job in the region of interest
        with the "Use my address" option turned on that are close to the city of the job (distance of up to 50 km).
        If the value is `qualquer_cidade`, accepts applicants who have registered the city of the job in the
        region of interest.

        - `somente_cidade` - City only
        - `cidades_proximas` - Nearby cities
        - `qualquer_cidade` - Any city

    AcessoRestrito:
      type: object
      description: Fields mark the access to the job restricted.
      required: [vaga_restrita]
      properties:
        vaga_restrita:
          type: boolean
          example: false
          description: If true only people with the job url will be able to access it.
        senha:
          type: string
          example: S3nh@
          description: |
            If the value of "vaga_restrita" is true, you can define a password,
            only who has the url and the password will be able to access it.

    PeriodoDeInscricao:
      type: object
      description: The period that the job will accept applications
      required: [data_inicio, data_fim]
      properties:
        data_inicio: { type: string, example: "2024/01/01", description: Start date }
        data_fim: { type: string, example: "2024/01/01", description: End date }
        veiculacao_suspensa:
          type: boolean
          example: false
          description: |
            Flag to suspend/pause the job offer.
            If true will not be listed in the Vagas for Business system

    SobreAEmpresa:
      type: object
      required: [anuncio_confidencial]
      properties:
        anuncio_confidencial:
          type: boolean
          example: false
          description: |
            Confidential job
            If true, the company's name will not be displayed in the job description.
        apresentacao_da_empresa:
          type: integer
          example: 999
          description: Company presentation. The ID can be obtained in the endpoint `/v1/job-posting/presentations`.

    CanaisDeDivulgacao:
      type: object
      required: [divisao_id, parceiros_ids]
      properties:
        divisao_id:
          type: integer
          example: 999
          description: Job division. The ID can be obtained in the endpoint `/v1/job-posting/divisions`
        parceiros_ids:
          type: array
          items: { type: integer }
          example: [999]
          description: Partner channels. The ID(s) can be obtained in the endpoint `/v1/job-posting/divisions`

    Atuacao:
      type: object
      required: [modelo_de_trabalho, local_de_trabalho]
      properties:
        modelo_de_trabalho:
          type: integer
          example: 4
          description: |
            Work model. The ID can be obtained in the endpoint
            `/v1/dominios/modelos-locais-trabalho`
        aceitar_candidaturas:
          deprecated: true
          description: DEPRECATED
        local_aceita_candidaturas: { $ref: '#/components/schemas/LocalAceitaCandidaturas' }
        local_de_trabalho: { $ref: '#/components/schemas/LocalDeTrabalhoParams' }

    JobCreateParams:
      type: object
      required: [fases_ids, periodo_de_inscricao]
      properties:
        fases_ids:
          type: array
          items: { type: integer }
          example: [999, 999]
          description: Phases IDs the job will have, the ids can be obtained in the endpoint `/v1/job-posting/phases`
        vaga_modelo_id:
          type: integer
          example: 999
          description: |
            Job Model ID, can be used as a basis for creating the job,
            if the job model has some attribute that was also passed when creating the job,
            the job model attribute will be ignored and the attribute passed in the request will be used.
            the id can be obtained from endpoint `/v1/job-posting/job_models`
        notificar:
          type: array
          items: { type: string }
          example: ["contact@company.com", "hr@email.com"]
          description: List of emails to send notification when the job is published
        cargo: { type: string, example: engineer, description: Job title }
        cargo_exclusivo_pcd:
          type: boolean
          example: false
          description: Flag to mark if the job is for people with a disability only
        tipo_de_contratacao_id:
          type: integer
          example: 999
          description: Contract type ID. can be obtained in the endpoint `/v1/dominios/modelos-contratuais`
        numero_de_posicoes:
          type: integer
          example: 1
          description: Open positions of the job
        idiomas:
          type: array
          items: { $ref: '#/components/schemas/LanguageParams' }
          description: |
            Required Languages for the job, they can be obtained in the endpoint
            `/v1/dominios/idiomas`
        beneficios:
          type: array
          items: { $ref: '#/components/schemas/BenefitParams' }
          description: |
            Benefits offered. Os ids podem ser obtidos no endpoint `v1/job-posting/benefits`.
            the beneft can not be added twice in the same job
        anuncio: { $ref: '#/components/schemas/Anuncio' }
        salario: { $ref: '#/components/schemas/Salario' }
        pre_requisitos:
          type: object
          required: [escolaridade_minima_id, nivel_hierarquico_id, areas_de_atuacao_ids]
          properties:
            escolaridade_minima_id:
              type: integer
              example: 1
              description: |
                Minimum education level, the ID can be obtained in the endpoint
                `v1/dominios/niveis_de_escolaridade`
                If education is indifferent to the job, pass the value "-1"
            nivel_hierarquico_id:
              type: integer
              example: 3
              description: |
                hierarchical level. The ID can be obtained in the endpoint
                `/v1/dominios/niveis_hierarquicos`
            aceitar_candidaturas_outras_areas:
              type: boolean
              example: true
              description: If true, the job will accept applications from other areas
            areas_de_atuacao_ids:
              type: array
              items: { type: integer }
              example: [4, 6, 10]
              description: |
                Fields of activity of the job. The IDs can be obtained in the endpoint
                `/v1/dominios/setores`
        atuacao: { $ref: '#/components/schemas/Atuacao' }
        sobre_a_empresa: { $ref: '#/components/schemas/SobreAEmpresa' }
        periodo_de_inscricao: { $ref: '#/components/schemas/PeriodoDeInscricao' }
        acesso_restrito: { $ref: '#/components/schemas/AcessoRestrito' }
        canais_de_divulgacao: { $ref: '#/components/schemas/CanaisDeDivulgacao' }
        vaga_inteligente:
          type: boolean
          example: false
          description: If the value is true, the job will be published as a smart job

    JobUpdateParams:
      type: object
      required: [periodo_de_inscricao]
      properties:
        notificar:
          type: array
          items: { type: string }
          example: ["contact@company.com", "hr@email.com"]
          description: List of emails to send notification when the job is published
        cargo: { type: string, example: engineer, description: Job title }
        cargo_exclusivo_pcd:
          type: boolean
          example: false
          description: Flag to mark if the job is for people with a disability only
        tipo_de_contratacao_id:
          type: integer
          example: 999
          description: Contract type ID. can be obtained in the endpoint `/v1/dominios/modelos-contratuais`
        numero_de_posicoes:
          type: integer
          example: 999
          description: Open positions of the job
        idiomas:
          type: array
          items: { $ref: '#/components/schemas/LanguageParams' }
          description: |
            Required Languages for the job, they can be obtained in the endpoint
            `/v1/dominios/idiomas`
        beneficios:
          type: array
          items: { $ref: '#/components/schemas/BenefitParams' }
          description: |
            Benefits offered. Os ids podem ser obtidos no endpoint `v1/job-posting/benefits`.
            the beneft can not be added twice in the same job
        anuncio: { $ref: '#/components/schemas/Anuncio' }
        salario: { $ref: '#/components/schemas/Salario' }
        pre_requisitos:
          type: object
          required: [escolaridade_minima_id, nivel_hierarquico_id, areas_de_atuacao_ids]
          properties:
            escolaridade_minima_id:
              type: integer
              example: 1
              description: |
                Minimum education level, the ID can be obtained in the endpoint
                `v1/dominios/niveis_de_escolaridade`
                If education is indifferent to the job, pass the value "-1"
            nivel_hierarquico_id:
              type: integer
              example: 3
              description: |
                hierarchical level. The ID can be obtained in the endpoint
                `/v1/dominios/niveis_hierarquicos`
            areas_de_atuacao_ids:
              type: array
              items: { type: integer }
              example: [4, 6, 10]
              description: |
                Fields of activity of the job. The IDs can be obtained in the endpoint
                `/v1/dominios/setores`
        atuacao: { $ref: '#/components/schemas/Atuacao' }
        sobre_a_empresa: { $ref: '#/components/schemas/SobreAEmpresa' }
        periodo_de_inscricao: { $ref: '#/components/schemas/PeriodoDeInscricao' }
        acesso_restrito: { $ref: '#/components/schemas/AcessoRestrito' }
        canais_de_divulgacao: { $ref: '#/components/schemas/CanaisDeDivulgacao' }
        vaga_inteligente:
          type: boolean
          example: false
          description: If the value is true, the job will be published as a smart job

    Job:
      type: object
      properties:
        id: { type: integer, example: 2505124 }
        cargo_exclusivo_pcd:
          type: boolean
          example: false
          description: Flag to show if the job is for people with a disability only
        cargo: { type: string, example: Analista de crédito, description: Job title }
        numero_de_posicoes:
          type: integer
          example: 2
          description: Number of positions offered
        tipo_de_contratacao_id: { type: integer, example: 4, description: Contract type id }
        funcionario_id: { type: integer, example: 17742, description: Employee ID }
        empresa_id: { type: integer, example: 12702, description: Company ID }
        data_criacao: { type: string, example: "2023-05-03T11:13:34-03:00" }
        fases_ids:
          type: array
          items: { type: integer }
          example: [469731, 649710, 641396]
          description: Phases IDs
        canais_de_divulgacao:
          type: object
          properties:
            divisao_id: { type: integer, example: 67518, description: Division ID }
            parceiros_ids:
              type: array
              items: { type: integer }
              example: [11, 10]
              description: Partner channels IDs
        acesso_restrito:
          type: object
          properties:
            vaga_restrita:
              type: boolean
              example: true
              description: Job with restrict access
        sobre_a_empresa:
          type: object
          description: About the company
          properties:
            anuncio_confidencial: { type: boolean, example: false }
            apresentacao_da_empresa: { type: integer, example: 139 }
        anuncio:
          type: object
          properties:
            descricao: { type: string, example: Descrição da Vaga, description: Job description }
            outros_requisitos:
              type: string
              example: sem comentários
              description: Other job requirements
        periodo_de_inscricao:
          type: object
          description: Application period
          properties:
            data_inicio: { type: string, example: "2023-05-03", description: Start date }
            data_fim:
              type: string
              example: "2023-05-03T21:00:00-03:00"
              description: End date
            veiculacao_suspensa:
              type: boolean
              example: false
              description: application paused
        salario:
          type: object
          description: Salary fields
          properties:
            tipo_moeda:
              type: string
              enum: [BRL, USD]
              example: BRL
              description: Type of currency
            faixa_salario_min:
              type: number
              example: 1500
              description: Salary range minimum
            faixa_salario_max:
              type: number
              example: 2000
              description: Salary range Maximum
            exibir_salario_no_anuncio:
              type: boolean
              example: true
              description: Show salary in the job announcement
        idiomas:
          type: array
          description: Languages
          items:
            type: object
            properties:
              id: { type: integer, example: 20 }
              nivel_id: { type: integer, example: 2, description: Level id }
        pre_requisitos:
          type: object
          properties:
            escolaridade_minima_id:
              type: integer
              example: 60
              description: Minimum education level
            nivel_hierarquico_id:
              type: integer
              example: 40
              description: Hierarchical level ID
            areas_de_atuacao_ids:
              type: array
              items: { type: integer }
              example: [70, 1, 124]
              description: Fields of Activity IDs
        atuacao:
          type: object
          properties:
            modelo_de_trabalho: { type: integer, example: 2, description: Work model ID }
            local_aceita_candidaturas:
              type: string
              enum: [somente_cidade, cidades_proximas, qualquer_cidade]
              example: somente_cidade
              description: |
                Accept application region

                - `somente_cidade` - City only
                - `cidades_proximas` - Nearby cities
                - `qualquer_cidade` - Any city
            local_de_trabalho:
              type: object
              description: Work local
              properties:
                localizacao_completa:
                  type: string
                  example: "Angra dos Reis, RJ, Brasil"
                  description: Full location
                pais: { type: string, example: Brasil, description: Country }
                estado: { type: string, example: RJ, description: State }
                cidade: { type: string, example: Angra dos Reis, description: City }
                cidade_id: { type: integer, example: 60968, description: City ID }
        fichas_gerenciais:
          type: array
          description: Management forms
          items:
            type: object
            properties:
              id: { type: integer, example: 23 }
        beneficios:
          type: array
          description: Benefits
          items:
            type: object
            properties:
              id: { type: integer, example: 2 }
              valor: { type: number, example: 34.5, description: Value }
        fichas:
          type: array
          description: Forms
          items:
            type: object
            properties:
              id: { type: integer, example: 147637 }
              obrigratoria: { type: boolean, example: true, description: Required }
        vaga_inteligente: { type: boolean, example: false }
