openapi: 3.0.1
info:
  title: MasFeasibility API
  description: I am <b><i>MasFeasibility API</i></b>. My intention is to provide a set of REST services to check sales viability.
  version: 1.0.0
servers:
  # Public Servers
  - url: https://feasibility.sta.masstack.com/v1
    description: STA
  - url: https://feasibility.masstack.com/v1
    description: PROD
tags:
  - name: Coverage
    description: This service allows to find an address and provices coverage info for a particular iam.
  - name: Coverage management
    description: API to manage coverage data.
  - name: Blacklist Contact Data
    description: This service checks if a phone, email or domain can be used as contact data.
  - name: Connection installation
    description: This service check if an installation has to be done by TELEFONICA.
  - name: Portability
    description: This services checks if a landline portability is allowed.
  - name: Device Finance Prebooking
    description: This services checks feasibility for devices finance
  - name: Subscription Limit
    description: This service provides subscriptions info of telco services
  - name: Sales Documents
    description: This service checks the current states of the provided orderIds
  - name: Pole Info
    description: This service provides info and management of pole ctos
  - name: Finance Renewal
    description: Finance Renewal takes customer and account information among other data and makes a request to the Risk API to evaluate the feasibility or not of selling or financing a new device while you have financing in progress
  - name: Insurance
    description: Insurance for validating whether selling device insurance for a given device is allowed.
  - name: Mobile Coverage
    description: This service checks 5G mobile coverage availability for a given address.
  - name: Mobile Portability
    description: This service will check if a number port is available by receiving an MSISDN

paths:
  /orgs/{orgId}/insurance/check:
    post:
      tags:
        - Insurance
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/insurance_check_request'
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
            example: masmovil
      operationId: insuranceCheck
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/insurance_check_response"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unauthorized_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /orgs/{orgId}/finance/renewal:
    post:
      tags:
        - Finance Renewal
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/finance_renewal_request'
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
            example: masmovil
        - name: sf-client-ip
          in: header
          description: Client IP address
          required: false
          schema:
            type: string
            example: 192.168.1.1
      operationId: financeRenewal
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/finance_renewal_response"
              examples:
                example1:
                  value:
                    action: RENEWAL_WITH_TYPE1
                    available_credit_limit: 1200.0
                    financed_devices_available_limit: 3
                    prescoring_id_value: 173140355176787
                    renewal_denied_reason: NONE
                    renewal_allowed: true
                    score_value: APPROVED
                    prescoring_risk_profile: BAJO
                    single_upfront_devices_available_limit: 3
                    subscription:
                      subscription_id: 7890
                    total_limits:
                      credit_limit: 4000.0
                      financed_devices_limit: 2
                      single_upfront_devices_limit: 1
                    score_description: 'Client approved with low risk profile'
                example2:
                  value:
                    renewal_allowed: false
                    renewal_denied_reason: CONTRACTED_TERMINAL_IN_LOGISTIC_PROCESS_INVALID
                example3:
                  value:
                    renewal_allowed: false
                    renewal_denied_reason: CONTRACTED_TERMINAL_IN_PENALIZATION_PERIOD
                example4:
                  value:
                    renewal_allowed: false
                    renewal_denied_reason: CONTRACTED_TERMINAL_IN_PENDING_PAYMENT_REVIEW
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unauthorized_response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/not_found_response"
        "408":
          description: Time out Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/timeout_response"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
        "502":
          description: Bad Gateway error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_gateway_error_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /orgs/{orgId}/finance/credit_limit:
    post:
      tags:
        - Finance Renewal
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/finance_availability_credit_limit_request'
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
            example: masmovil
      operationId: credit-availability
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/finance_renewal_response"
              examples:
                example1:
                  value:
                    available_credit_limit: 1200.0
                    financed_devices_available_limit: 3
                    prescoring_id_value: 173140355176787
                    renewal_denied_reason: NONE
                    renewal_allowed: true
                    score_value: APPROVED
                    prescoring_risk_profile: BAJO
                    single_upfront_devices_available_limit: 3
                    payment_financial_entity:
                      - entity: BBVA
                        amount: 1500.0
                      - entity: CETELEM
                        amount: 50.0
                    total_limits:
                      credit_limit: 4000.0
                      financed_devices_limit: 2
                      single_upfront_devices_limit: 1
                    score_description: 'Client approved with low risk profile'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unauthorized_response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/not_found_response"
        "408":
          description: Time out Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/timeout_response"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
        "502":
          description: Bad Gateway error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_gateway_error_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /orgs/{orgId}/coverage/streets:
    get:
      tags:
        - Coverage
      parameters:
        - $ref: '#/components/parameters/sf-channel-header'
        - $ref: '#/components/parameters/sf-segment-header'
        - $ref: '#/components/parameters/sf-check-id-header'
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: search
          in: query
          required: true
          description: search parameter to match in the records (e.g. calle azalea, paseo del prado...)
          schema:
            type: string
            maxLength: 150
      description: Returns a list of street summary objects.
      operationId: getStreets
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/_street_summaries"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /orgs/{orgId}/coverage/buildings:
    get:
      tags:
        - Coverage
      parameters:
        - $ref: '#/components/parameters/sf-channel-header'
        - $ref: '#/components/parameters/sf-segment-header'
        - $ref: '#/components/parameters/sf-check-id-header'
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: search
          description: search parameter to match in the records (e.g. calle azalea, madrid, paseo...)
          in: query
          required: true
          schema:
            type: string
            maxLength: 150
      description: Returns a list of building summary objects.
      operationId: getBuildings
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/_building_summaries"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /orgs/{orgId}/coverage/buildings/search:
    post:
      tags:
        - Coverage
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/_search_params'
      parameters:
        - $ref: '#/components/parameters/sf-channel-header'
        - $ref: '#/components/parameters/sf-segment-header'
        - $ref: '#/components/parameters/sf-check-id-header'
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
      description: Returns a list of building summary objects.
      operationId: postBuildings
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/_building_summaries"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"

  /orgs/{orgId}/coverage/buildings/{technical_id}:
    get:
      tags:
        - Coverage
      parameters:
        - $ref: '#/components/parameters/sf-channel-header'
        - $ref: '#/components/parameters/sf-segment-header'
        - $ref: '#/components/parameters/sf-check-id-header'
        - name: orgId
          in: path
          description: Organization name as it is registered in masstack
          required: true
          schema:
            type: string
          example: masmovil
        - name: technical_id
          in: path
          required: true
          description: Building identifier (Gescal 17)
          schema:
            type: string
        - name: unit_to_data
          description: A boolean to indicate if territory_owner (TO) data is needed for each unit in the unit array response. If True, to arrays will be appended to each unit. A territory_owners array that shows the TOs with coverage in the unit. A blocked_territory_owners array that shows the blocked TOs (ALL if total block)
          in: query
          schema:
            type: boolean
          required: false
      description: Returns a single building object
      operationId: getBuildingById
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/_building"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/not_found_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /orgs/{orgId}/coverage/buildings/extra:
    get:
      tags:
        - Coverage
      parameters:

        - $ref: '#/components/parameters/sf-channel-header'
        - $ref: '#/components/parameters/sf-segment-header'
        - $ref: '#/components/parameters/sf-check-id-header'
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: id
          description: id parameter to match with a building 'technical_id' in ElasticSearch
          in: query
          schema:
            type: string
          required: true
        - name: territory_owner
          description: territory_owner parameter to match with a building 'territory_owner'
          in: query
          schema:
            type: string
          required: true
      description: Returns an extraData object for a building 'id' and 'territory_owner'.
      operationId: getBuildingExtraData
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/_building_extra_data"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/not_found_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /orgs/{orgId}/coverage/units/{id}:
    get:
      tags:
        - Coverage
      parameters:
        - $ref: '#/components/parameters/sf-channel-header'
        - $ref: '#/components/parameters/sf-segment-header'
        - $ref: '#/components/parameters/sf-check-id-header'
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: id
          in: path
          required: true
          description: Unit identifier (Gescal 37)
          schema:
            type: string
        - name: parent_coverage
          in: query
          description: Boolean to chose if return the parent coverage
          schema:
            type: boolean
      description: Returns a single building object
      operationId: getUnitById
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/_unit"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/not_found_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /orgs/{orgId}/coverage/units/extra:
    get:
      tags:
        - Coverage
      parameters:
        - $ref: '#/components/parameters/sf-channel-header'
        - $ref: '#/components/parameters/sf-segment-header'
        - $ref: '#/components/parameters/sf-check-id-header'
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: id
          description: id parameter to match with a unit 'id' in ElasticSearch
          in: query
          schema:
            type: string
          required: true
        - name: territory_owner
          description: territory_owner parameter to match with a unit 'territory_owner'
          in: query
          schema:
            type: string
          required: true
      description: Returns an extraData object for a unit 'id' and 'territory_owner'.
      operationId: getUnitExtraData
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/_unit_extra_data"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/not_found_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /orgs/{orgId}/coverage/address-codes/vendor:
    get:
      tags:
        - Coverage
      parameters:
        - $ref: '#/components/parameters/sf-channel-header'
        - $ref: '#/components/parameters/sf-segment-header'
        - $ref: '#/components/parameters/sf-check-id-header'
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: id
          description: id parameter to match with a street 'id' in ElasticSearch (gescal12 o gescal17)
          in: query
          schema:
            type: string
          required: true

        - name: vendor
          description: vendor parameter to match with a 'vendor'
          in: query
          example: experian
          schema:
            type: string
          required: true
      description: Returns an addressCode object for a building 'id' and 'vendor'.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/_address_code_data"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/not_found_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /orgs/{orgId}/coverage/streets/clarifiers/{gescal12}:
    get:
      tags:
        - Coverage
      parameters:
        - $ref: '#/components/parameters/sf-channel-header'
        - $ref: '#/components/parameters/sf-segment-header'
        - $ref: '#/components/parameters/sf-check-id-header'
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: gescal12
          description: g12
          in: path
          example: 123123123123
          schema:
            type: string
          required: true
      description: Provides information to identify a building from a street.
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/_clarifiers_response"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/not_found_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"

  /orgs/{orgId}/management/address/{address_id}/territory_owner:
    get:
      tags:
        - Coverage management
      description:
        Return territory_owners related to address_id. Could be more than one. Must select the territory with more priotity.
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: address_id
          in: path
          example: J0000000000000000000000000000003728533
          description: address_id with or without spaces
          required: true
          schema:
            type: string
        - name: business_rules
          in: query
          example: 'true'
          description: If true, iam business rules are applied to the response. Otherwise, the response includes all TOs found, if any.
          required: false
          schema:
            type: boolean
        - $ref: '#/components/parameters/sf-channel-header'
        - $ref: '#/components/parameters/sf-segment-header'
        - $ref: '#/components/parameters/sf-check-id-header'
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/address_id_response'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
        '404':
          description: bad input parameter

  /orgs/{orgId}/management/blacklist/reasons:
    get:
      tags:
        - Coverage management
      description:
        Returns a json array of blacklist reasons available for the given user role.
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
      responses:
        '200':
          description: A list of blacklist reasons for the user auth roles
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/blacklist_reason'

  /orgs/{orgId}/management/blacklist/blocks/{id}:
    get:
      tags:
        - Coverage management
      description:
        Returns a json array of of blocks for a given id
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: id
          in: path
          example: 08002231318100184
          description: gescal 7, gescal 17 o gescal 37
          required: true
          schema:
            type: string
      responses:
        '200':
          description: A list of blocks for the given id
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/blacklist_block'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
              examples:
                example_1:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'The field ''{fieldName}'' is required'
                example_2:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Invalid ''id'' length. Expected 7, 17 or 37 characters.'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/not_found_response'
  /orgs/{orgId}/management/blacklist/building:
    post:
      tags:
        - Coverage management
      description:
        Blocks the given id, territory owner and reason code.
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/blacklist_post_block"
        description: >-
          Block - The block we want to create:
            * id - The gescal 17 to block.
            * reason_code - The code for the reason we want to block the id.
            * territory_owner - The territory owner we want to block in that building. "ALL" to block all territory owners.
            * observation - An OPTIONAL 250 max character observation about the block that is being created.
      responses:
        '200':
          description: Returns a Json object that describes the newly created block.
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid_fields:
                    $ref: '#/components/schemas/blacklist_block_valid_fields'
                  g17_result:
                    type: array
                    items:
                      $ref: '#/components/schemas/blacklist_gescal_result'
                  g37_result:
                    type: array
                    items:
                      $ref: '#/components/schemas/blacklist_gescal_result'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
              examples:
                example_1:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'The field ''{fieldName}'' is required'
                example_2:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Invalid ''id'' length. Expected 17 characters.'
                example_3:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Territory owner does not exist'
                example_4:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Building Id does not exist'
                example_5:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Provided reason code is not valid'
                example_6:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: '''{territory_owner}'' has no coverage for id ''{id}'''
                example_7:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Block for building ''{id}'' and territory owner ''{territory_owner}'' already exists'

  /orgs/{orgId}/management/blacklist/unit:
    post:
      tags:
        - Coverage management
      description:
        Blocks the given id, territory owner and reason code.
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/blacklist_post_block"
            example:
              id: '08002231318100184         001        '
              reason_code: 'INF_5'
              territory_owner: 'ALL'
              observation: 'example observation'
        description: >-
          Block - The block we want to create:
            * id - The gescal 37 to block.
            * reason_code - The code for the reason we want to block the id.
            * territory_owner - The territory owner we want to block in that building. "ALL" to block all territory owners.
            * observation - An OPTIONAL 250 max character observation about the block that is being created.
      responses:
        '200':
          description: Returns a Json object that describes the newly created block.
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid_fields:
                    $ref: '#/components/schemas/blacklist_block_valid_fields'
                  g37_result:
                    type: array
                    items:
                      $ref: '#/components/schemas/blacklist_gescal_result'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
              examples:
                example_1:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'The field ''{fieldName}'' is required'
                example_2:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Invalid ''id'' length. Expected 37 characters.'
                example_3:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Territory owner does not exist'
                example_4:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Building Id does not exist'
                example_5:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Provided reason code is not valid'
                example_6:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: '''{territory_owner}'' has no coverage for id ''{id}'''
                example_7:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Block for unit ''{id}'' and territory owner ''{territory_owner}'' already exists'

  /orgs/{orgId}/management/blacklist/building/{id}:
    delete:
      tags:
        - Coverage management
      description:
        Blocks the given id, territory owner and reason code.
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: id
          in: path
          description: gescal 17 to unblock
          required: true
          schema:
            type: string
            maxLength: 17
        - name: territory_owner
          description: territory owner to unblock
          in: query
          required: true
          schema:
            type: string
        - name: reason_code
          description: reason code to unblock
          in: query
          required: true
          schema:
            type: string
        - name: observation
          description: An OPTIONAL observation about the unblock that is being done
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Returns a Json object that describes all the unblocked gescals
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid_fields:
                    $ref: '#/components/schemas/blacklist_unblock_valid_fields'
                  g17_result:
                    type: array
                    items:
                      $ref: '#/components/schemas/blacklist_gescal_result'
                  g37_result:
                    type: array
                    items:
                      $ref: '#/components/schemas/blacklist_gescal_result'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
              examples:
                example_1:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'The field ''{fieldName}'' is required'
                example_2:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Invalid ''id'' length. Expected 17 characters.'
                example_3:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Territory owner does not exist'
                example_4:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'No valid role provided'
                example_5:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Block for unit ''{id}'' and territory owner ''{territory_owner}'' does not exist'

  /orgs/{orgId}/management/blacklist/unit/{id}:
    delete:
      tags:
        - Coverage management
      description:
        Blocks the given id, territory owner and reason code.
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: id
          in: path
          description: gescal 37 to unblock
          required: true
          schema:
            type: string
            maxLength: 37
        - name: territory_owner
          description: territory owner to unblock
          in: query
          required: true
          schema:
            type: string
        - name: reason_code
          description: reason code to unblock
          in: query
          required: true
          schema:
            type: string
        - name: observation
          description: An OPTIONAL observation about the unblock that is being done
          in: query
          required: false
          schema:
            type: string
      responses:
        '200':
          description: Returns a Json object that describes all the unblocked gescals
          content:
            application/json:
              schema:
                type: object
                properties:
                  valid_fields:
                    $ref: '#/components/schemas/blacklist_unblock_valid_fields'
                  g37_result:
                    type: array
                    items:
                      $ref: '#/components/schemas/blacklist_gescal_result'

        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
              examples:
                example_1:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'The field ''{fieldName}'' is required'
                example_2:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Invalid ''id'' length. Expected 37 characters.'
                example_3:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Territory owner does not exist'
                example_4:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'No valid role provided'
                example_5:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'Block for unit ''{id}'' and territory owner ''{territory_owner}'' does not exist'

  /orgs/{orgId}/management/load/info/{id}:
    get:
      tags:
        - Coverage management
      description:
        Return load info for id
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: id
          in: path
          example: coverage-load-2023-10-30
          description: load id
          required: true
          schema:
            type: string
      responses:
        '200':
          description: search results matching criteria
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/load_info_response'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
              examples:
                example1:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'The field ''{fieldName}'' is required'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not_found_response'

  /orgs/{orgId}/management/load/history:
    get:
      tags:
        - Coverage management
      description:
        Return load summary data for loads that started on a date between start_date and end_date
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: start_date
          in: query
          example: "2023-10-01"
          description: date range start
          required: false
          schema:
            type: string
            format: date
        - name: end_date
          in: query
          example: "2023-10-30"
          description: date range end
          required: false
          schema:
            type: string
            format: date
        - name: user
          in: query
          example: "example@example.com"
          description: user that started the data load
          required: false
          schema:
            type: string
        - name: type
          in: query
          description: type of data load
          required: false
          schema:
            $ref: '#/components/schemas/load_type'
        - name: status
          in: query
          example: DONE
          description: array of status a load is in
          required: false
          schema:
            type: array
            items:
              type: string
              enum:
                - DONE
                - RUNNING
                - CANCELED
                - FAILED
                - PENDING
        - name: files
          in: query
          example: HFC
          description: a string to perform a partial search against files loaded. Similar to functions CONTAINS
          required: false
          schema:
            type: string
        - name: limit
          in: query
          example: 5
          description: max number of items in response
          required: true
          schema:
            type: integer
        - name: offset
          in: query
          example: 0
          description: firs n items to skip in response
          required: true
          schema:
            type: integer

      responses:
        '200':
          description: list of data loads matching search criteria
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/load_info_response'
                  limit:
                    type: integer
                    example: 5
                  offset:
                    type: integer
                    example: 0
                  total:
                    type: integer
                    example: 1
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"

  /orgs/{orgId}/management/load/availabilities:
    get:
      tags:
        - Coverage management
      description: Indicates if load service is available. The service may be processing another data load and thus, not available for a new load.
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: load_type
          in: query
          description: load type to check availability
          required: false
          schema:
            $ref: '#/components/schemas/load_type'
      responses:
        '200':
          description: indicates if system is available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/_availabilities_response'
              examples:
                example1:
                  value:
                    - loadType: FTTH_COVERAGE
                      availability: true
                    - loadType: BLACKLIST
                      availability: true
                    - loadType: FTTH_COVERAGE_DELTA
                      availability: true
                    - loadType: HISTORICAL_NAMES
                      availability: true
                    - loadType: MAP
                      availability: true
                example2:
                  value:
                    - availability: true
                example3:
                  value:
                    - loadType: FTTH_COVERAGE
                      availability: true
                    - loadType: BLACKLIST
                      availability: true
                    - loadType: FTTH_COVERAGE_DELTA
                      availability: true
                    - loadType: HISTORICAL_NAMES
                      availability: true
                    - loadType: MAP
                      availability: false
                      reason:
                        id: MAP_2024-10-16_8a2c6
                        user: airflow-mas-feasibility@mm-mas-feasibility-dev.iam.gserviceaccount.com
                        status: RUNNING
                        files:
                          - map_updates_20241016_01.csv
                          - map_updates_20241016_02.csv
                        stages:
                          - stage: PRELOAD
                            status: DONE
                            started_at: "2024-10-17T00:00:56"
                            ended_at: "2024-10-17T00:02:26"
                          - stage: AUDIT_CHECK
                            status: DONE
                            log: "airflow-mas-feasibility@mm-mas-feasibility-dev.iam.gserviceaccount.com"
                            started_at: "2024-10-17T00:02:26"
                            ended_at: "2024-10-17T00:06:38"
                          - stage: APPLYING
                            status: DONE
                            started_at: "2024-10-17T00:07:35"
                            ended_at: "2024-10-17T00:08:56"
                          - stage: DW_SYNC
                            status: DONE
                            started_at: "2024-10-17T00:09:06"
                            ended_at: "2024-10-17T00:13:23"
                        load_type: MAP
                        started_at: "2024-10-17T00:00:29"
                        ended_at: "2024-10-17T00:13:23"


  /orgs/{orgId}/management/load/availability:
    get:
      tags:
        - Coverage management
      description:
        Indicates if load service is available. The service amy be processing another data load and thus, not available for a new load.
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: load_type
          in: query
          description: load type to check availability
          required: true
          schema:
            $ref: '#/components/schemas/load_type'
      responses:
        '200':
          description: indicates if system is available
          content:
            application/json:
              schema:
                type: object
                properties:
                  availability:
                    type: boolean
                  reason:
                    requiered: false
                    $ref: '#/components/schemas/load_info_response'
              examples:
                example1:
                  value:
                    availability: false
                    reason:
                      id: coverage-load-2023-10-30
                      user: example@email.com
                      status: RUNNING
                      load_type: FTTH_COVERAGE
                      files:
                        - GIT_107_107_01_231031_01_00073616.csv
                      stages:
                        - stage: PRELOAD
                          status: RUNNING
                          log: string
                          started_at: '2023-10-30 17:15:56'

                example2:
                  value:
                    availability: true


        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"

  /orgs/{orgId}/management/load:
    post:
      tags:
        - Coverage management
      description:
        Creates a new load
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                load_type:
                  $ref: '#/components/schemas/load_type'

      responses:
        '200':
          description: indicates if system is available
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/load_summary'

        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
              examples:
                example1:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'The field ''{fieldName}'' is required'
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
              examples:
                example1:
                  value:
                    code: '0014'
                    status: CONFLICT
                    message: Conflict
                    detailMsg: "Load for id '{id}' already exists"
        "423":
          description: Resource Locked
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
              examples:
                example1:
                  value:
                    code: '0017'
                    status: RESOURCE_LOCKED
                    message: Resource Locked
                    detailMsg: "Service is processing another data load"

  /orgs/{orgId}/management/load/audit_check:
    post:
      tags:
        - Coverage management
      description:
        Update load audit check stage to DONE, if user wants load to continue or CANCELED if user wants to stop the data load.
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                id:
                  type: string
                status:
                  type: string
                  enum:
                    - DONE
                    - CANCELED
                night_load:
                  type: boolean
                  default: false
              required:
                - id
                - status

      responses:
        '200':
          description: Response without a content that indcates the operation was successful
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
              examples:
                example1:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'The field ''{fieldName}'' is required'
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
              examples:
                example1:
                  value:
                    code: '0014'
                    status: CONFLICT
                    message: Conflict
                    detailMsg: "Audit check already finished"
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not_found_response'

  /blacklist/contact/isBlocked:
    post:
      tags:
        - Blacklist Contact Data
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/isBlocked"
        description: >-
          contactType - The type of contact we want to check:
            * number -  Field of type phone that we have to check if it is blocked.
            * email - Field of type email that we have to check if it is blocked.
            * emailDomain - Field of type email domain that we have to check if it is blocked.
          value -  Contact info value.
      description: >-
        Returns true or false, depending on wheter field is locked or not.
      operationId: blacklistContactData
      responses:
        "200":
          description: Accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/accepted"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"


  /orgs/{orgId}/finance/devices/feasible:
    post:
      tags:
        - Device Finance Prebooking
      operationId: POST -orgs/_orgId/feasible
      description: |
        [DEPRECATED] By passing in the appropriate options, you can check if a finance is pre-accepted or rejected
      deprecated: true
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
          example: masmovil
        - name: entityBank
          in: query
          required: false
          description: Desired financial entity to be consulted (Currently only XCF is supported)
          schema:
            type: array
            items:
              type: string
            example: ["XCF"]
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/finance_required_info'
        required: true
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/finance_response'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_finance_response'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not_found_response'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'

  /orgs/{orgId}/subscriptions/limit/active:
    post:
      tags:
        - Subscription Limit
      description: Gives active subscriptions info and fraud limits of telco services for a client
      operationId: POST -orgs/_orgId/subscriptions/limit/active
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in mas-stack
          required: true
          schema:
            type: string
          example: masmovil
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/subscription_limit_active_request'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/subscription_limit_active_response'
  /orgs/{orgId}/mobile_coverage/5g/{technical_id}:
    get:
      tags:
        - Mobile Coverage
      summary: Check 5G mobile coverage availability
      description: Validates if 5G mobile coverage is available for a given address identified by technical_id (GESCAL code). The technical_id parameter should be URL-encoded when it contains spaces or special characters. Note that any other response different from a 200 are passed through from the upstream GIROS system and may have varying response formats.
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in Mas-Stack
          required: true
          schema:
            type: string
            example: masmovil
        - name: technical_id
          in: path
          description: GESCAL address identifier. Standardized Spanish address code used by telecommunications operators. Must be exactly 17 or 37 characters. URL-encode spaces and special characters (e.g., Ñ → %C3%91).
          required: true
          schema:
            type: string
            pattern: '^.{17}$|^.{37}$'
            example: "28000010878000052%20%20%20%20%20%20%20%20%20003%C3%91%20%20%20%20%20%20%20"
      operationId: mobileCoverageCheck5G
      responses:
        "200":
          description: Success - Returns 5G availability status
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/mobile_coverage_check_5g_response"
        "400":
          description: Bad request - Invalid technical_id format. The path parameter must be exactly 17 or 37 characters long.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "401":
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/unauthorized_response"
        "404":
          description: Address not found in GIROS system (pass-through response)
        "412":
          description: Precondition failed in GIROS system (pass-through response)
        "500":
          description: Internal server error from GIROS system (pass-through response)
        default:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /orgs/{orgId}/portability/portabilityCheck:
    post:
      tags:
        - Portability
      parameters:
        - name: orgId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/portedNumber'
      description: >-
        Returns whether the portability process can be carried out and whether
        it requires a new installation
      operationId: getPortability
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/_getPortabilityConditions'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/bad_request_response'
              examples:
                example1:
                  value:
                    code: '0015'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'The field ''{fieldName}'' is required'
                example2:
                  value:
                    code: '0018'
                    status: BAD_REQUEST
                    message: Bad Request
                    detailMsg: 'the origin brand and the destination brand are the same'

        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not_found_response'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
  /connection/addressConnection/{id}:
    get:
      tags:
        - Connection installation
      description: Retrieves an addressConnection
      operationId: GET /addressConnection/{id}
      parameters:
        - name: id
          in: path
          required: true
          description: addressConnection identifier (gescal17)
          schema:
            type: string
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/addressConnection"
        "404":
          description: addressConnection not found
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/errorResponse"
    put:
      tags:
        - Connection installation
      description: Inserts or updates an addressConnection
      operationId: PUT connection/addressConnection/{id}
      parameters:
        - name: id
          in: path
          required: true
          description: addressConnection identifier (gescal17)
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/addressConnection"
        description: New addressConnection data that to be inserted or updated.
        required: true
      responses:
        "204":
          description: No Content
        "400":
          description: Bad Request
        default:
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/errorResponse"
  /connection/connectionType:
    get:
      tags:
        - Connection installation
      description: Retrieves the avaible connectionType values
      operationId: GET /connectionType
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/connectionTypes"

  /orgs/{orgId}/sales/documents/document_status:
    post:
      tags:
        - Sales Documents
      description: Service that receives N orderId and returns another array of requests with their respective documents and validation status
      operationId: POST -orgs/_orgId/sales/documents/document_status
      parameters:
        - name: orgId
          in: path
          description: Organization name as it is registered in mas-stack
          required: true
          schema:
            type: string
          example: masmovil
      requestBody:
        description: A list of orderIds to be consulted
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/sales_documents_document_status_request'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/sales_documents_document_status_response'
              example:
                errorCode: 0
                data:
                  orders:
                    - orderId: "30453849"
                      orderErrorCode: 0
                      status: A
                      documents:
                        - documentID: "1"
                          documentErrorCode: "0"
                          documentName: "NIF Administrador"
                          documentStatus: "A"
                          documentMotive: "Documento solicitado pendiente de envío"
                          documentMaxSize: "1"
                        - documentID: "2"
                          documentErrorCode: "0"
                          documentName: "CIF Empresa"
                          documentStatus: "C"
                          documentMotive: "El documento que has facilitado no es el correcto"
                          documentMaxSize: "1"
                        - documentID: "3"
                          documentErrorCode: "0"
                          documentName: "Escrituras"
                          documentStatus: "C"
                          documentMotive: "El documento que has facilitado no es legible. Por favor, envía una copia más nítida."
                          documentMaxSize: "3"
                    - orderId: "30453850"
                      orderErrorCode: 106
                      orderErrorMessage: "Order information not found"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/unauthorized_response'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/not_found_response'
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"

  /poleinfo/location/{technicalId}/installations/volumes:
    get:
      deprecated: true
      tags:
        - Pole Info
      parameters:
        - name: technicalId
          in: path
          required: true
          schema:
            type: string
        - name: scope
          in: query
          required: true
          description: >-
            * building -  Locations (1) and operators in the building 
            
            * street - Locations  and operators in the street (S/N included)
            
            * street odd - Locations  and operators in the street, only odd numbers (S/N not included)
            
            * street even - Locations  and operators in the street, only even numbers (S/N not included)
            
            * town - Locations  and operators in the town
          schema:
            type: string
            enum:
              - building
              - street
              - street odd
              - street even
              - town
      description: Returns  volume of locations both total and grouped  by operator based
        on initial location and scope
      operationId: getVolumes
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/_getVolumes"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/not_found_response"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/conflict_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /poleinfo/location/{technicalId}/installations:
    post:
      deprecated: true
      tags:
        - Pole Info
      parameters:
        - name: technicalId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/_installationsUpdate"
        description: Scope, operator/s and installationType to be updated and source
          information
      description: Updates  installationType information associated to a technicalId and a
        operator and scope
      operationId: postUpdateBulk
      responses:
        "200":
          description: Accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/poleinfo_accepted"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /poleinfo/location/{technicalId}/installations/list:
    get:
      deprecated: true
      tags:
        - Pole Info
      parameters:
        - name: technicalId
          in: path
          required: true
          schema:
            type: string
        - name: operator
          description: operator of the requested installations (if empty all will be
            returned)
          in: query
          required: false
          schema:
            type: string
        - name: scope
          in: query
          required: true
          schema:
            type: string
            enum:
              - street
              - street odd
              - street even
      description: Returns locations contained in the scope associated to a technicalId
        and  operator/s
      operationId: getLocationList
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/_getInstallationList"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/not_found_response"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/conflict_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /poleinfo/installations/list:
    post:
      deprecated: true
      tags:
        - Pole Info
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/_listUpdate"
        description: List of installations to be updated
      description: Requests an update of a list of installations
      operationId: postInstallationsUpdateList
      responses:
        "200":
          description: Accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/poleinfo_accepted"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /poleinfo/location/{technicalId}/cto:
    post:
      tags:
        - Pole Info
      parameters:
        - name: technicalId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/_singleUpdate"
        description: CTO information to be updated
      description: Requests an update of a single CTO
      operationId: postCtosUpdate
      responses:
        "200":
          description: Accepted
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/poleinfo_accepted"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
        "409":
          description: Conflict
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/conflict_response"
  /poleinfo/location/{technicalId}/installationtype:
    get:
      tags:
        - Pole Info
      parameters:
        - name: technicalId
          description: gescal17 or gescal37. 17 o 37 caracteres
          in: path
          required: true
          schema:
            type: string
        - name: territoryOwner
          description: TO of the requested installations
          in: query
          required: true
          schema:
            type: string
      description: Returns the installation type associated to a technicalId and an TO
        (POSTE, POSTE H, NO POSTE)
      operationId: getInstallationType
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/_getInstallationType"
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/bad_request_response"
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/not_found_response"
        default:
          description: Error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/error_response"
  /orgs/{orgId}/mobile_portability/portability_check/{msisdn}:
    get:
      tags:
        - Mobile Portability
      description: Validates if a mobile number can be renewed for portability
      operationId: checkPortabilityRenewal
      parameters:
        - name: orgId
          in: path
          required: true
          style: simple
          explode: false
          schema:
            type: string
        - name: msisdn
          in: path
          required: true
          style: simple
          explode: false
          schema:
            type: string
          description: Mobile number to validate
          example: "600123456"
      responses:
        "200":
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/portability_renewal_response'
components:
  parameters:
    sf-channel-header:
      name: sf-channel
      in: header
      description: Must be provide by feasibility squad
      schema:
        type: string
      required: true
    sf-segment-header:
      name: sf-segment
      in: header
      schema:
        type: string
      description: Must be provide by feasibility squad
      required: true
    sf-check-id-header:
      name: sf-check-id
      in: header
      schema:
        type: string
        format: uuid
      description: "Must use a UUID format"
      required: true
  schemas:
    _search_params:
      type: object
      required:
        - way_name
        - number
      properties:
        way_name:
          type: string
          example: 'San Juan'
          description: Way name
        number:
          type: string
          example: '1'
          description: Number
        way_type:
          type: string
          example: 'Paseo'
          description: Way type
        town:
          type: string
          example: 'Pedro Andres'
          description: Town name
        postal_code:
          type: string
          minLength: 0
          maxLength: 5
          example: '02534'
          description: Postal Code
    _building:
      type: object
      properties:
        id:
          type: string
          example: "01000500474700067"
        technical_id:
          type: string
          example: "01000500474700067"
        address:
          type: object
          properties:
            summary:
              type: string
              example: "AVENIDA IRUÃ‘A-VELEIA, 67, 01015 VITORIA-GASTEIZ"
            description:
              type: string
              example: ""
            street_type:
              type: string
              example: "AVENIDA"
            street_name:
              type: string
              example: "IRUÃ‘A-VELEIA"
            number:
              type: string
              example: "67"
            town:
              type: string
              example: "VITORIA-GASTEIZ"
            postal_code:
              type: string
              minLength: 0
              maxLength: 5
              example: "01015"
            province:
              type: string
              example: "ALAVA"
            province_id:
              type: string
              example: "1"
        coverage:
          type: array
          items:
            $ref: '#/components/schemas/_coverage'
        geo_code:
          type: object
          properties: {}
        units:
          type: array
          items:
            $ref: '#/components/schemas/_unit_summary'
    _availabilities_response:
      type: array
      items:
        $ref: '#/components/schemas/_availability_response_entry'
    _availability_response_entry:
      type: object
      properties:
        availability:
          type: boolean
        reason:
          $ref: '#/components/schemas/load_info_response'
    _coverage:
      type: object
      properties:
        territory_owner:
          type: string
          example: "FIBNEB01"
        operator:
          type: string
          example: "TELEFONICA_NEBA"
        pai_local:
          type: string
          example: "0110096001"
        terminal_exchange:
          type: string
          example: "0110096"
        pai:
          type: string
          example: "1"
        territory_owner_type:
          $ref: '#/components/schemas/territory_owner_type'
        technology:
          type: string
          enum: [ADSL, FTTH, HFC]
          example: FTTH
        availability:
          type: boolean
          description: false indicates that the footprint is blocked
          example: false
        availability_info:
          type: object
          description: only shows when availability is false
          properties:
            reason:
              type: string
              example: razon
            completion_date:
              type: string
              example: "2025-01-01"
        priority:
          type: string
          example: "1"
          description: the lower the most priority
        speeds:
          type: object
          properties:
            estimated:
              type: string
              example: "100M_100M || 50M_50M"
            profile:
              type: string
              example: "100M_100M || 50M_50M"
    _unit_coverage:
      type: object
      properties:
        territory_owner:
          type: string
          example: "FIBMM01"
        operator:
          type: string
          example: "MASMOVIL"
        territory_owner_type:
          $ref: '#/components/schemas/territory_owner_type'
          example: "DIRECT_COVERAGE"
        availability_info:
          type: object
          description: only shows when availability is false
          properties:
            reason:
              type: string
              example: razon
            completion_date:
              type: string
              example: "2025-01-01"
        address_id:
          type: string
          example: "M0000000000000000000000000000005512611"
        pai_local:
          type: string
          example: "0110096001"
        terminal_exchange:
          type: string
          example: "0110096"
        pai:
          type: string
          example: "1"
        technology:
          type: string
          enum: [ADSL, FTTH, HFC]
          example: FTTH
        availability:
          type: boolean
          description: false indicates that the footprint is blocked
          example: false
        priority:
          type: string
          example: "1"
        speeds:
          type: object
          properties:
            estimated:
              type: string
              example: "100M_100M || 50M_50M"
            profile:
              type: string
              example: "100M_100M || 50M_50M"
    _unit:
      type: object
      properties:
        id:
          type: string
          example: "28000010130200007       W 001E       "
        technical_id:
          type: string
          example: "28000010130200007       W 001E       "
        address_description:
          type: object
          properties:
            bis_duplicate:
              description: dato de la finca
              type: string
              example: ""
            block:
              description: dato de la finca
              type: string
              example: ""
            door:
              description: dato de la finca
              type: string
              example: ""
            letter:
              description: dato de la finca
              type: string
              example: ""
            stair:
              description: dato de la escalera
              type: string
              example: "Derecha"
            floor:
              description: dato del domicilio
              type: string
              example: "001"
            hand1:
              description: dato del domicilio
              type: string
              example: "E"
            hand2:
              description: dato del domicilio
              type: string
              example: ""
            summary:
              type: string
              example: "DERECHA 001E"
        parent:
          type: object
          properties:
            id:
              type: string
              example: "28000010130200007"
            coverage:
              type: array
              items:
                $ref: '#/components/schemas/_coverage'
        coverage:
          type: array
          items:
            $ref: '#/components/schemas/_unit_coverage'
    _building_summaries:
      type: array
      items:
        $ref: '#/components/schemas/_building_summary'
    _building_summary:
      type: object
      properties:
        id:
          type: string
          description: Not gescal. If it ends by 'H' is an historical street
          example: "28000010130200007H1"
        technical_id:
          type: string
          description: gescal17
          example: "28000010130200007"
        score:
          type: string
          example: "847.3662"
        address:
          type: object
          properties:
            summary:
              type: string
              example: "AVENIDA IRUÑA VELEIA, S/N, 01015 VITORIA-GASTEIZ"
              description: street_type + street_name + number + postal_code + town + province
            description:
              type: string
              description: clarifier. It shows whern number is S/N
              example: "HOTEL"
            street_type:
              type: string
              example: "AVENIDA"
            street_name:
              type: string
              example: "IRUÑA-VELEIA"
            number:
              type: string
              example: "S/N"
            town:
              type: string
              example: "VITORIA-GASTEIZ"
            postal_code:
              type: string
              minLength: 0
              maxLength: 5
              example: "01015"
            province:
              type: string
              example: "ALAVA"
            province_id:
              type: string
              example: "1"
    _street_summaries:
      type: array
      items:
        $ref: '#/components/schemas/_street_summary'
    _street_summary:
      type: object
      properties:
        id:
          type: string
          description: gescal12
          example: "420003300195"
        technical_id:
          type: string
          description: gescal12
          example: "420003300195"
        score:
          type: string
          example: "353.05377"
        address:
          type: object
          properties:
            summary:
              type: string
              example: "Avenida IruÃ±a-Veleia Hiribidea, Vitoria-Gasteiz, ALAVA"
            street_type:
              type: string
              example: "AVENIDA"
            street_name:
              type: string
              example: "IRUÃ‘A-VELEIA"
            town:
              type: string
              example: "VITORIA-GASTEIZ"
            province:
              type: string
              example: "ALAVA"
            province_id:
              type: string
              example: "1"
            postal_code:
              type: array
              items:
                type: string
                minLength: 0
                maxLength: 5
              example: ["21877", "21888"]
    _unit_summary:
      type: object
      required: ["id", "technical_id", "address_description"]
      properties:
        id:
          type: string
          example: "01000500474700067         002C       "
        technical_id:
          type: string
          example: "01000500474700067         002C       "
        territory_owners:
          description: TOs for the unit
          type: array
          items:
            type: string
          example: ["FIBMM01"]
        territory_owner_type:
          $ref: '#/components/schemas/territory_owner_type'
        blocked_territory_owners:
          description: Blocked TOs for the unit
          type: array
          items:
            type: string
          example: ["FIBMM01"]
        address_description:
          type: object
          properties:
            bis_duplicate:
              description: dato de la finca
              type: string
              example: " "
            block:
              type: string
              example: "   "
            door:
              type: string
              example: "  "
            letter:
              type: string
              example: " "
            stair:
              type: string
              example: "  "
            floor:
              type: string
              example: "004"
            hand1:
              type: string
              example: "MOD "
            hand2:
              type: string
              example: "6   "
            summary:
              type: string
              example: " "
    _building_extra_data:
      type: object
      properties:
        id:
          type: string
          example: "01000500474700067"
        terminal_exchange:
          type: string
          example: "##########"
        territory_owner:
          type: string
          example: "BSTOR01"
        operator:
          type: string
          example: "ORANGE"
        pai:
          type: string
          example: "1"
        pai_local:
          type: string
          example: "O0110096"
        territory_owner_type:
          $ref: '#/components/schemas/territory_owner_type'
    _unit_extra_data:
      type: object
      properties:
        id:
          type: string
          example: "01000500474700067         003A       "
        address_id:
          type: string
          example: "OS000000000000000000000000000000407819"
        terminal_exchange:
          type: string
          example: "##########"
        territory_owner:
          type: string
          example: "BSTOR01"
        operator:
          type: string
          example: "ORANGE"
        pai:
          type: string
          example: "01"
        pai_local:
          type: string
          example: "O0110096"
        territory_owner_type:
          $ref: '#/components/schemas/territory_owner_type'
          example: "DIRECT_COVERAGE"
    _address_code_data:
      type: object
      properties:
        id:
          type: string
          example: "010000300045"
        province_code:
          type: string
          example: "01"
        street_code:
          type: string
          example: 1000088
        town_code:
          type: string
          example: "100025"
        vendor:
          type: string
          example: "EXPERIAN"
    not_found_response:
      properties:
        code:
          type: string
          example: "0001"
        status:
          type: string
          example: "NOT_FOUND"
        message:
          type: string
          example: "Resource Not Found"
        detailMsg:
          type: string
          example: "{Entity} not found for id: {id}"
    unauthorized_response:
      properties:
        code:
          type: string
          example: "0003"
        status:
          type: string
          example: "UNAUTHORIZED"
        message:
          type: string
          example: "Unauthorized"
        detailMsg:
          type: string
          example: "Unauthorized exception"
    bad_request_response:
      properties:
        code:
          type: string
          example: "0015"
        status:
          type: string
          example: "BAD_REQUEST"
        message:
          type: string
          example: "Bad Request"
        detailMsg:
          type: string
          example: "The field '{fieldName}' is required"

    _clarifiers_response:
      type: array
      items:
        $ref: '#/components/schemas/_clarifier'
    _clarifier:
      type: object
      properties:
        number:
          type: string
          readOnly: true
          example: 99532
        description:
          type: string
          readOnly: true
          example: BRAMMER IBERIA
        building_id:
          type: string
          example: 48005450369299532
        street_id:
          type: string
          example: 480054503692
    error_response:
      properties:
        code:
          type: string
          example: "0002"
        status:
          type: string
          example: "UNEXPECTED"
        message:
          type: string
          example: "Unexpected error"
        detailMsg:
          type: string
          example: "Unhandled exception"
    bad_gateway_error_response:
      properties:
        code:
          type: string
          example: "0016"
        status:
          type: string
          example: "BAD_GATEWAY"
        message:
          type: string
          example: "Bad gateway"
        detailMsg:
          type: string
          example: "Bad gateway"
    load_info_response:
      type: object
      properties:
        id:
          type: string
          example: "coverage-load-2023-10-30"
        user:
          type: string
          example: "example@email.com"
        status:
          type: string
          example: "DONE"
          enum:
            - RUNNING
            - CANCELED
            - FAILED
            - DONE
        load_type:
          $ref: '#/components/schemas/load_type'
        files:
          type: array
          items:
            type: string
          example: ["GIT_107_107_01_231031_01_00073616.csv"]
        stages:
          type: array
          items:
            $ref: '#/components/schemas/load_stage_info'

    load_summary:
      type: object
      properties:
        id:
          type: string
          example: "coverage-load-2023-10-30"
        user:
          type: string
          example: "example@email.com"
        type:
          $ref: '#/components/schemas/load_type'
        status:
          type: string
          example: "DONE"
          enum:
            - PENDING
            - RUNNING
            - DONE
            - CANCELED
            - FAILED
        started_at:
          type: string
          format: date
          pattern: /([0-9]{4})-(?:[0-9]{2})-([0-9]{2})/
          example: "2023-10-30"

    load_stage_info:
      type: object
      required:
        - status
        - started_at
        - ended_at
      properties:
        stage:
          type: string
          example: "PRELOAD"
          enum:
            - PRELOAD
            - AUDIT_CHECK
            - APPLYING
            - DW_SYNC
        status:
          type: string
          example: "DONE"
          enum:
            - PENDING
            - RUNNING
            - DONE
            - CANCELED
            - FAILED
        log:
          type: string
        started_at:
          type: string
          format: date-time
          pattern: /([0-9]{4})-(?:[0-9]{2})-([0-9]{2}) ([0-9]{2}):(?:[0-9]{2}):([0-9]{2})/
          example: "2023-10-30 17:15:56"
        ended_at:
          type: string
          format: date-time
          pattern: /([0-9]{4})-(?:[0-9]{2})-([0-9]{2}) ([0-9]{2}):(?:[0-9]{2}):([0-9]{2})/
          example: "2023-10-30 17:36:22"

    load_type:
      type: string
      example: FTTH_COVERAGE
      enum:
        - FTTH_COVERAGE
        - FTTH_COVERAGE_DELTA
        - BLACKLIST
        - MAP
        - HISTORICAL_NAMES
        -

    address_id_response:
      type: object
      properties:
        address_id:
          type: string
          example: "MKHFC000000000000000000000000000428057"
        territory_owners:
          type: array
          items:
            $ref: '#/components/schemas/territory_owners'
    blacklist_reason:
      type: object
      properties:
        reason:
          type: string
        reason_type:
          type: string
        reason_code:
          type: string
        duration_days:
          type: integer
          format: int32
    blacklist_block:
      type: object
      properties:
        id:
          type: string
          example: 08002231318100184
        territory_owners:
          type: array
          items:
            type: string
          example: [ALL, EKNBLC1, EKNEB01, FIBNBLC1, FIBNEB05, MASMOVIL]
        gescal_scope:
          type: string
          example: G17
        block_reason:
          type: string
          example: CANALIZADO EXTERIOR OBSTRUIDO
        block_reason_code:
          type: string
          example: INF_5
        block_until:
          type: string
          example: 2023-10-30
        block_user:
          type: string
          example: example@masmovil.com
        block_role:
          type: string
          example: feasibility-blacklist-admin
        block_date:
          type: string
          example: 2023-05-03
        block_observation:
          type: string
          example: example observation
    blacklist_post_block:
      type: object
      properties:
        id:
          type: string
          example: 08002231318100184
        reason_code:
          type: string
          example: INF_5
        territory_owner:
          type: string
          example: ALL
        observation:
          type: string
          example: example observation
    blacklist_gescal_result:
      type: object
      properties:
        id:
          type: string
          example: 08002231318100184
        territory_owner:
          type: string
          example: ALL
        gescal_scope:
          type: string
          example: G17
        block_until:
          type: string
          example: 2023-11-01T00:00
        creation_user:
          type: string
          example: example@masmovil.com
    blacklist_unblock_valid_fields:
      type: object
      properties:
        is_blocked:
          type: string
          example: MDgwMDIyMzEzMTgxMDAxODQgICAgICAgICBCQSAgICAgICAgIA==
        territory_owner:
          type: string
          example: ALL
        unblock_role:
          type: string
          example: example-example-example
    portability_renewal_response:
      required:
        - is_portable
      type: object
      properties:
        is_portable:
          type: boolean
          description: Indicates if the number is portable
          example: true
    blacklist_block_valid_fields:
      type: object
      properties:
        id:
          type: string
          example: "08002231318100184         BA         "
        territory_owner:
          type: string
          example: ALL
        block_until:
          type: string
          example: 2023-11-01
        reason:
          type: string
          example: "DISTANCIA EXCESIVA"
        block_user:
          type: string
          example: example@masmovil.com
        block_role:
          type: string
          example: example-example-example
        has_coverage:
          type: string
          example: EKNEB01
    territory_owners:
      type: object
      properties:
        territory_owner:
          type: string
          example: FIBOR01
        priority:
          type: string
          example:  3
    isBlocked:
      type: object
      required:
        - contactType
        - value
      properties:
        contactType:
          type: string
          example: number
          enum:
            - number
            - email
        value:
          type: string
          example: 696969696

    bad_request_finance_response:
      properties:
        code:
          type: string
          example: "0015"
        status:
          type: string
          example: BAD_REQUEST
        message:
          type: string
          example: Bad Request
        detailMsg:
          type: string
          example: 'detailMsg'
    accepted:
      properties:
        isBlocked:
          type: boolean
    #-- finance schemas---
    finance_required_info:
      properties:
        personal_details:
          $ref: '#/components/schemas/personal_details'
        order_details:
          $ref: '#/components/schemas/order_details'
        financial_details:
          $ref: '#/components/schemas/financial_details'
    personal_details:
      type: object
      properties:
        personal_data:
          $ref: '#/components/schemas/personal_data'
        contact_data:
          $ref: '#/components/schemas/contact_data'
        employment:
          $ref: '#/components/schemas/employment'
        segment:
          type: string
        address:
          $ref: '#/components/schemas/address'
    personal_data:
      type: object
      properties:
        document_id:
          $ref: '#/components/schemas/document_id'
        name:
          type: string
          example: "Lorenzo"
        surnames:
          type: array
          items:
            type: string
          example: ["Muñoz","Medina"]
        birthdate:
          type: string
          format: date
          example: "YYYY-MM-DD"
        gender:
          title: GenderEnum
          type: integer
          example: 1
          enum:
            - 0
            - 1
            - 2
            - 9
          description: |-
            Enum to define the human sexes is an international standard from ISO/IEC 5218
            https://en.wikipedia.org/wiki/ISO/IEC_5218
            * 0 - No definido
            * 1 - Hombre
            * 2 - Mujer
            * 9 - No aplica
        nationality:
          type: string
          example: "ES"
          title: Nationality
          enum:
            - AF
            - AL
            - DZ
            - AS
            - AD
            - AO
            - AI
            - AQ
            - AG
            - AR
            - AM
            - AW
            - AU
            - AT
            - AZ
            - BS
            - BH
            - BD
            - BB
            - BY
            - BE
            - BZ
            - BJ
            - BM
            - BT
            - BO
            - BQ
            - BA
            - BW
            - BV
            - BR
            - IO
            - BN
            - BG
            - BF
            - BI
            - KH
            - CM
            - CA
            - CV
            - KY
            - CF
            - TD
            - CL
            - CN
            - CX
            - CC
            - CO
            - KM
            - CG
            - CD
            - CK
            - CR
            - HR
            - CU
            - CW
            - CY
            - CZ
            - CI
            - DK
            - DJ
            - DM
            - DO
            - EC
            - EG
            - SV
            - GQ
            - ER
            - EE
            - SZ
            - ET
            - FK
            - FO
            - FJ
            - FI
            - FR
            - PF
            - TF
            - GA
            - GM
            - GE
            - DE
            - GH
            - GI
            - GR
            - GL
            - GD
            - GU
            - GT
            - GG
            - GN
            - GW
            - GY
            - HT
            - HM
            - VA
            - HN
            - HK
            - HU
            - IS
            - IN
            - ID
            - IR
            - IQ
            - IE
            - IM
            - IL
            - IT
            - JM
            - JP
            - JE
            - JO
            - KZ
            - KE
            - KI
            - KP
            - KR
            - KW
            - KG
            - LA
            - LV
            - LB
            - LS
            - LR
            - LY
            - LI
            - LT
            - LU
            - MO
            - MK
            - MG
            - MW
            - MY
            - MV
            - ML
            - MT
            - MH
            - MR
            - MU
            - YT
            - MX
            - FM
            - MD
            - MC
            - MN
            - ME
            - MS
            - MA
            - MZ
            - MM
            - NA
            - NR
            - NP
            - NL
            - NC
            - NZ
            - NI
            - NE
            - NG
            - NU
            - NF
            - MP
            - NO
            - OM
            - PK
            - PW
            - PS
            - PA
            - PG
            - PY
            - PE
            - PH
            - PN
            - PL
            - PT
            - PR
            - QA
            - RO
            - RU
            - RW
            - SH
            - KN
            - LC
            - PM
            - VC
            - WS
            - SM
            - ST
            - SA
            - SN
            - RS
            - SC
            - SL
            - SG
            - SX
            - SK
            - SI
            - SB
            - SO
            - ZA
            - GS
            - SS
            - ES
            - LK
            - SD
            - SR
            - SE
            - CH
            - SY
            - TW
            - TJ
            - TZ
            - TH
            - TL
            - TG
            - TK
            - TO
            - TT
            - TN
            - TR
            - TM
            - TC
            - TV
            - UG
            - UA
            - AE
            - GB
            - UM
            - US
            - UY
            - UZ
            - VU
            - VE
            - VN
            - VG
            - VI
            - WF
            - YE
            - ZM
            - ZW
          description: Use the ISO 3166-1 alfa-2 format
    document_id:
      type: object
      properties:
        type:
          type: string
          example: "NIF"
          enum:
            - "CIF"
            - "NIE"
            - "NIF"
            - "Passport"
        value:
          type: string
          example: "11111111A"
        expiration_date:
          type: string
          format: date
          example: "YYYY-MM-DD"
    address:
      type: object
      properties:
        street:
          type: string
          maxLength: 100
          example: "Ejemplo"
        street_type:
          type: string
          example: "Calle"
          title: Street Type
        number:
          type: string
          maxLength: 5
          example: "2"
        bis:
          type: string
        city:
          type: string
          example: "Madrid"
        gescal:
          type: string
          example: "28XXXXXXXXXXXXXXX"
        district:
          type: string
        block:
          type: string
        stair:
          type: string
        floor:
          type: string
        letter:
          type: string
        zip_code:
          type: string
          example: "28001"
        province:
          type: string
          example: "Madrid"
        state:
          type: string
        country:
          type: string
          example: "ES"
          title: CountryEnum
          enum:
            - AF
            - AL
            - DZ
            - AS
            - AD
            - AO
            - AI
            - AQ
            - AG
            - AR
            - AM
            - AW
            - AU
            - AT
            - AZ
            - BS
            - BH
            - BD
            - BB
            - BY
            - BE
            - BZ
            - BJ
            - BM
            - BT
            - BO
            - BQ
            - BA
            - BW
            - BV
            - BR
            - IO
            - BN
            - BG
            - BF
            - BI
            - KH
            - CM
            - CA
            - CV
            - KY
            - CF
            - TD
            - CL
            - CN
            - CX
            - CC
            - CO
            - KM
            - CG
            - CD
            - CK
            - CR
            - HR
            - CU
            - CW
            - CY
            - CZ
            - CI
            - DK
            - DJ
            - DM
            - DO
            - EC
            - EG
            - SV
            - GQ
            - ER
            - EE
            - SZ
            - ET
            - FK
            - FO
            - FJ
            - FI
            - FR
            - PF
            - TF
            - GA
            - GM
            - GE
            - DE
            - GH
            - GI
            - GR
            - GL
            - GD
            - GU
            - GT
            - GG
            - GN
            - GW
            - GY
            - HT
            - HM
            - VA
            - HN
            - HK
            - HU
            - IS
            - IN
            - ID
            - IR
            - IQ
            - IE
            - IM
            - IL
            - IT
            - JM
            - JP
            - JE
            - JO
            - KZ
            - KE
            - KI
            - KP
            - KR
            - KW
            - KG
            - LA
            - LV
            - LB
            - LS
            - LR
            - LY
            - LI
            - LT
            - LU
            - MO
            - MK
            - MG
            - MW
            - MY
            - MV
            - ML
            - MT
            - MH
            - MR
            - MU
            - YT
            - MX
            - FM
            - MD
            - MC
            - MN
            - ME
            - MS
            - MA
            - MZ
            - MM
            - NA
            - NR
            - NP
            - NL
            - NC
            - NZ
            - NI
            - NE
            - NG
            - NU
            - NF
            - MP
            - NO
            - OM
            - PK
            - PW
            - PS
            - PA
            - PG
            - PY
            - PE
            - PH
            - PN
            - PL
            - PT
            - PR
            - QA
            - RO
            - RU
            - RW
            - SH
            - KN
            - LC
            - PM
            - VC
            - WS
            - SM
            - ST
            - SA
            - SN
            - RS
            - SC
            - SL
            - SG
            - SX
            - SK
            - SI
            - SB
            - SO
            - ZA
            - GS
            - SS
            - ES
            - LK
            - SD
            - SR
            - SE
            - CH
            - SY
            - TW
            - TJ
            - TZ
            - TH
            - TL
            - TG
            - TK
            - TO
            - TT
            - TN
            - TR
            - TM
            - TC
            - TV
            - UG
            - UA
            - AE
            - GB
            - UM
            - US
            - UY
            - UZ
            - VU
            - VE
            - VN
            - VG
            - VI
            - WF
            - YE
            - ZM
            - ZW
        additional_details:
          type: string
    contact_data:
      type: object
      properties:
        email:
          type: string
          example: "example@example.com"
        phone_number:
          type: string
          description: mobile phone number
          example: "6XXXXXXXX"
        phone_number2:
          type: string
          example: "6XXXXXXXX"
    employment:
      type: object
      properties:
        profession:
          title: ProfessionEnum
          type: integer
          example: 8
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 8
            - 9
            - 10
            - 11
            - 12
            - 13
            - 14
            - 15
            - 16
          description: |-
            Profession enum.
            * 1 - Obrero - sector privado
            * 2 - Técnico, Administrativo - sector privado
            * 3 - Cargo intermedio - sector privado
            * 4 - Directivo - sector privado
            * 5 - Obrero, Técnico, Administrativo - sector público
            * 6 - Cargo intermedio, Directivo - sector público
            * 8 - Autónomo
            * 9 - Empresario
            * 10 - Rentista
            * 11 - Vigilante de seguridad
            * 12 - Camarero / Vendedor de la Once
            * 13 - Bombero, Militar, Policia, Guardia Civil
            * 14 - Estudiante, Universitario, Master y Doctorado
            * 15 - Jubilado, Pensionista
            * 16 - No trabaja
        company:
          type: string
          example: "Mycompany S.A."
        income:
          type: number
          description: Financing customer monthly income amount
          maximum: 99999
          example: 1900,00 / 1900.00
        income_source:
          title: Income Source
          type: integer
          example: 1
          enum:
            - 1
            - 2
            - 3
          description: |-
            Income Source enum.
            * 1 - Herencia o Donación
            * 2 - Rentas de propiedad inmobiliaria
            * 3 - Otros
        other_income_source:
          type: string
          example: "Otra fuente"
          description: |-
            Mandatory if income_source=3
        activity_country:
          type: string
          example: "ES"
          enum:
            - AF
            - AL
            - DZ
            - AS
            - AD
            - AO
            - AI
            - AQ
            - AG
            - AR
            - AM
            - AW
            - AU
            - AT
            - AZ
            - BS
            - BH
            - BD
            - BB
            - BY
            - BE
            - BZ
            - BJ
            - BM
            - BT
            - BO
            - BQ
            - BA
            - BW
            - BV
            - BR
            - IO
            - BN
            - BG
            - BF
            - BI
            - KH
            - CM
            - CA
            - CV
            - KY
            - CF
            - TD
            - CL
            - CN
            - CX
            - CC
            - CO
            - KM
            - CG
            - CD
            - CK
            - CR
            - HR
            - CU
            - CW
            - CY
            - CZ
            - CI
            - DK
            - DJ
            - DM
            - DO
            - EC
            - EG
            - SV
            - GQ
            - ER
            - EE
            - SZ
            - ET
            - FK
            - FO
            - FJ
            - FI
            - FR
            - PF
            - TF
            - GA
            - GM
            - GE
            - DE
            - GH
            - GI
            - GR
            - GL
            - GD
            - GU
            - GT
            - GG
            - GN
            - GW
            - GY
            - HT
            - HM
            - VA
            - HN
            - HK
            - HU
            - IS
            - IN
            - ID
            - IR
            - IQ
            - IE
            - IM
            - IL
            - IT
            - JM
            - JP
            - JE
            - JO
            - KZ
            - KE
            - KI
            - KP
            - KR
            - KW
            - KG
            - LA
            - LV
            - LB
            - LS
            - LR
            - LY
            - LI
            - LT
            - LU
            - MO
            - MK
            - MG
            - MW
            - MY
            - MV
            - ML
            - MT
            - MH
            - MR
            - MU
            - YT
            - MX
            - FM
            - MD
            - MC
            - MN
            - ME
            - MS
            - MA
            - MZ
            - MM
            - NA
            - NR
            - NP
            - NL
            - NC
            - NZ
            - NI
            - NE
            - NG
            - NU
            - NF
            - MP
            - NO
            - OM
            - PK
            - PW
            - PS
            - PA
            - PG
            - PY
            - PE
            - PH
            - PN
            - PL
            - PT
            - PR
            - QA
            - RO
            - RU
            - RW
            - SH
            - KN
            - LC
            - PM
            - VC
            - WS
            - SM
            - ST
            - SA
            - SN
            - RS
            - SC
            - SL
            - SG
            - SX
            - SK
            - SI
            - SB
            - SO
            - ZA
            - GS
            - SS
            - ES
            - LK
            - SD
            - SR
            - SE
            - CH
            - SY
            - TW
            - TJ
            - TZ
            - TH
            - TL
            - TG
            - TK
            - TO
            - TT
            - TN
            - TR
            - TM
            - TC
            - TV
            - UG
            - UA
            - AE
            - GB
            - UM
            - US
            - UY
            - UZ
            - VU
            - VE
            - VN
            - VG
            - VI
            - WF
            - YE
            - ZM
            - ZW
        professional_area:
          title: ProfessionalBranchEnum
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 7
            - 8
            - 9
            - 10
            - 11
            - 12
            - 13
            - 14
            - 15
            - 16
            - 17
            - 18
            - 19
            - 20
            - 21
            - 22
            - 23
            - 24
            - 25
            - 26
            - 27
            - 28
            - 29
            - 30
            - 31
            - 32
            - 33
            - 34
            - 35

          description: |-
            Professional branch enum.
            * 1 - Banca, Seguros, Financieras
            * 2 - Sanidad y Farmacia
            * 3 - Enseñanza, Formación
            * 4 - Construcción oficios y Otros
            * 5 - Hostelería, Restauración
            * 6 - Transporte de personas y Otros
            * 7 - Comercio on line y segunda mano, Importación y Exportación Petróleo y Materias primas
            * 8 - Agricultura (otros), Ganadería, Pesca
            * 9 - Agencias y Agentes inmobiliarios
            * 10 - Arte, Piedras y Metales preciosos, Juegos de azar
            * 11 - Comercio ambulante
            * 12 - Armas y energía nuclear
            * 13 - Manufactura del metal, Químicos y farmacéuticos, Refinería petróleo y gas
            * 14 - Asesoría fiscal y Abogados
            * 15 - Club deportivos profesionales, sus agentes e intermediarios
            * 16 - Minería y extracción recursos naturales (otros)
            * 17 - Alcohol y Tabaco (fabricación, distribución)
            * 18 - Casas de cambio, Emisores medios pago virtual y prepago, Micro créditos
            * 19 - Comercio minorista y Mayorista (otros)
            * 20 - Servicios otros
            * 21 - Manufactura y Fabricación (otros)
            * 22 - Transporte de dinero, Combustibles y Mercancías
            * 23 - Organizaciones políticas
            * 24 - Talleres de coches, motos y otros automóviles
            * 25 - Agencias viajes, Agentes de aduanas
            * 26 - Agricultura intensiva en mano de obra (viñedo, aceituna, fresa, caña de azúcar,...)
            * 27 - Casas de subasta-empeño, Organizaciones religiosas, ONGs
            * 28 - Comercio: Alcohol, Tabaco, Teléfonos móviles, Equipos informáticos, Joyas y Gasolineras
            * 29 - Construcción, Inmobiliaria, Contratistas
            * 30 - Discotecas, Salas de baile, Night clubs
            * 31 - Empresas fiduciarias, Offshore
            * 32 - Fabricación barcos, aviones y otros vehículos
            * 33 - Minería y extracción gas y petróleo, producción y distribución energía renovable
            * 34 - Minería y extracción uranio, metales y piedras preciosas
            * 35 - Servicios de lavandería, Manejo de desechos, Limpieza ambiental
        professional_use:
          title: Professional Use
          type: boolean
          example: false
    order_details:
      type: object
      properties:
        sfid:
          type: string
        fuc_code:
          type: number
          enum:
            - 323841452
            - 332577543
            - 332577626
          description: Unique identifier of the sales channel |-
            Fuc code enum.
            * 323841452 - TIENDAS
            * 332577543 - WEB
            * 332577626 - TELESALES
        telco_society:
          title: TelcoSocietyEnum
          type: integer
          example: 1
          enum:
            - 1
            - 2
          description: |-
            Telco society enum.
            * 1 - Xfera moviles SAU
            * 2 - Eukastel
        order_type:
          title: OrderTypeEnum
          type: integer
          example: 0
          enum:
            - 0
            - 1
            - 2
            - 4
          description: |-
            Order type enum.
            * 0 - Alta nueva
            * 1 - Portabilidad
            * 2 - Renovación
            * 4 - Fusión STC
        device:
          $ref: '#/components/schemas/device'
    device:
      type: object
      properties:
        id:
          type: string
        brand:
          type: string
          example: "Apple"
        model:
          type: string
          example: "Iphone 13 256 Gb"
        name:
          type: string
          example: "Apple Iphone 13 256 Gb"
        description:
          type: string
        category:
          type: number
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
            - 7
            - 8

          description: |-
            Category enum.
            * 1 - Tablet
            * 2 - Smartwatch
            * 3 - Smartphone
            * 4 - STB
            * 5 - PBX
            * 6 - Wifiextender
            * 7 - Router
            * 8 - Otros
        colour:
          type: string
          example: "black"
        value:
          type: number
          example: 1199,00 / 1199.00
    financial_details:
      type: object
      properties:
        financial_brand:
          title: FinancialBrandEnum
          type: integer
          example: 1
          enum:
            - 1
            - 2
          description: Telecommunications brand used by any of the companies in Masmovil holding:|-
            Finance brand enum.
            * 1 - MoneyGO
            * 2 - XferaCF
        financial_product:
          title: FinancialProductEnum
          type: integer
          example: 1
          enum:
            - 1
            - 2
            - 3
          description: Financial product commercialized by any of the companies in Masmovil holding |-
            Product type enum.
            * 1 - Préstamo personal
            * 2 - Tarjeta de crédito
            * 3 - Linea de crédito (sin tarjeta)
        final_payment:
          type: number
          description: 100,00 / 100.00
          example: 100,00 / 100.00
        loan:
          $ref: '#/components/schemas/loan'
    loan:
      type: object
      properties:
        value:
          type: number
          description: c
          example: 119.00
        commision:
          type: number
          description: Fee to be charged for the financing operation.
        tae:
          type: number
          description: Interest rate of the financing operation, including fees and other costs.
        tin:
          type: number
          description: Interest rate of the financing operation.
        duration:
          type: integer
          description: Duration of financing operation in months
        monthly_fee:
          type: number
          description: Monthly amount of the financing operation to be paid by the financing customer.
        bank_account:
          $ref: '#/components/schemas/bank_account'
    bank_account:
      type: object
      required:
        - name
        - surnames
        - iban
      properties:
        name:
          type: string
          example: "Lorenzo"
        surnames:
          type: array
          items:
            type: string
          example: ["Muñoz","Medina"]
        iban:
          type: string
    finance_response:
      type: object
      properties:
        feasibility_id:
          description: feasibility order id
          example: ffa10f3b-8351-4665-b50b-096b7d266cab
          type: string
        order_id:
          type: string
          example: ffa10f3b8351
          description: bank order id
        authorization_id:
          type: string
          example: 3025045868
          description: bank authorization id
        financial_entity:
          type: string
          description: entity that provides the financing
          example: "XCF"
          enum:
            - XCF
        status:
          type: string
          description: status of the financing
          example: "Accepted"
          enum:
            - "Accepted"
            - "Rejected"
        granted_amount:
          type: string
          description:  900,00 /  900.00
          example: "900.00"
        credit_line_amount:
          type: number
          example: 0.0
        financial_product:
          type: integer
          example: 1
          enum:
            - 1
            - 2
            - 3
          description: final product offered by the bank
            * 1 - Préstamo personal
            * 2 - Tarjeta de crédito
            * 3 - Linea de crédito (sin tarjeta)

    sales_documents_document_status_request:
      type: object
      properties:
        orders:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 11
            example: 30453849
    sales_documents_document_status_response:
      type: object
      properties:
        errorCode:
          type: number
          example: 0
          minLength: 1
          maxLength: 1
        data:
          $ref: '#/components/schemas/_sales_documents_orders_data'
    _sales_documents_orders_data:
      type: array
      items:
        $ref: '#/components/schemas/_sales_documents_orders_order'
    _sales_documents_orders_order:
      type: object
      properties:
        orderId:
          type: number
          minLength: 1
          maxLength: 11
        orderErrorCode:
          type: number
          minLength: 1
          maxLength: 1
        orderErrorMessage:
          type: string
        status:
          type: string
          enum:
            - A
            - B
            - C
        documents:
          type: array
          items:
            $ref: '#/components/schemas/_sales_documents_order_document'
    _sales_documents_order_document:
      type: object
      properties:
        documentID:
          type: string
        documentName:
          type: string
        documentStatus:
          type: string
          enum:
            - A
            - B
            - C
            - D
        documentMotive:
          type: string
        documentMaxSize:
          type: string
          minLength: 1
          maxLength: 11
    subscription_limit_active_request:
      type: object
      properties:
        document_type:
          type: string
          example: NIF
          enum:
            - NIF
            - CIF
            - NIE
            - PASSPORT
            - TR
          description: client document type.
        document_id:
          example: 88662844Y
          type: string
          description: client document number.
        subscription_type:
          type: string
          example: mobile
          enum:
            - Broadband
            - Landline
            - Mobile
        segment:
          type: string
          example: Consumer
          enum:
            - Consumer
            - SelfEmployee
            - SME
            - B2B
    subscription_limit_active_response:
      type: object
      properties:
        type:
          type: string
          description: request subscription type
          example: mobile
        limit:
          type: integer
          description: fraud limit
          example: 10
        active_subscriptions:
          type: integer
          description: active subscription for request type and client
          example: 8
        subscriptions_allowed:
          type: integer
          description: subscriptions allowed for request type and client
          example: 2
    portedNumber:
      type: object
      required:
        - number
        - territoryOwner
        - technicalId
        - technology
        - sfid
      properties:
        number:
          type: string
          example: '911234567'
          description: Fixed number to be ported
        territoryOwner:
          type: string
          example: FIBNEB01
          description: Territory owner. Not mandatory if technology is MIFIJO
        technicalId:
          type: string
          example: '12345678901234567'
          description: TechnicalId (corresponding with "GESCAL" ). Not mandatory if technology is MIFIJO
        technology:
          type: string
          enum: [FTTH,ADSL,MIFIJO]
          example: FTTH
          description: Technology to be provided
        sfid:
          type: string
          example: AW001200
          description: Seller SFID
    _getPortabilityConditions:
      type: object
      properties:
        internalPortability:
          type: boolean
          example: 'false'
          description: Determines whether the process is an internal portability or not
        isPortable:
          type: boolean
          example: 'true'
          description: Determines whether the number is portable
        installationRequired:
          type: boolean
          example: 'true'
          description: Determines whether a new installation is required
        operator:
          $ref: '#/components/schemas/operator'
    operator:
      type: object
      properties:
        code:
          type: string
          example: '00031'
          description: Operator code
        name:
          type: string
          example: XTRA
          description: Operator name

    _map_building_summaries:
      type: array
      items:
        $ref: '#/components/schemas/_map_building_summary'
    _map_building_summary:
      type: object
      properties:
        id:
          type: string
          example: "01000500474700067"
        technical_id:
          type: string
          example: "01000500474700067"
        parent_id:
          type: string
          example: "010005004747"
        score:
          type: string
          example: "847.3662"
        address:
          type: object
          properties:
            summary:
              type: string
              example: "AVENIDA IRUÑA-VELEIA, 67, 01015 VITORIA-GASTEIZ"
            description:
              type: string
              example: ""
            street_type:
              type: string
              example: "AVENIDA"
            street_name:
              type: string
              example: "IRUÑA-VELEIA"
            number:
              type: string
              example: "67"
            town:
              type: string
              example: "VITORIA-GASTEIZ"
            postal_code:
              type: string
              minLength: 0
              maxLength: 5
              example: "01015"
            province:
              type: string
              example: "ALAVA"
            province_id:
              type: integer
              example: 1
            geo_location:
              type: object
              properties:
                latitude:
                  type: string
                  example: "42.847452"
                longitude:
                  type: string
                  example: "-2.7096233"
            INE_code:
              type: string
              example: "1"
    _map_street_summaries:
      type: array
      items:
        $ref: '#/components/schemas/_map_street_summary'
    _map_street_summary:
      type: object
      properties:
        id:
          type: string
          example: "420003300195"
        technical_id:
          type: string
          example: "420003300195"
        score:
          type: string
          example: "353.05377"
        address:
          type: object
          properties:
            sumary:
              type: string
              example: "Avenida Iruña-Veleia Hiribidea, Vitoria-Gasteiz, ALAVA"
            street_type:
              type: string
              example: "AVENIDA"
            street_name:
              type: string
              example: "IRUÑA-VELEIA"
            town:
              type: string
              example: "VITORIA-GASTEIZ"
            province:
              type: string
              example: "ALAVA"
            province_id:
              type: string
              example: "1"
            postal_code:
              type: array
              items:
                type: string
                minLength: 0
                maxLength: 5
              example: ["21877", "21888"]
            INE_code:
              type: string
              example: "1"
    addressConnection:
      type: object
      properties:
        id:
          type: string
          example: "22000030036000016"
        installer:
          type: string
          enum:
            - '"TESA"'
            - '"MM"'
          example: TESA
        connectionType:
          type: string
          enum:
            - '"P"'
            - '"N"'
            - '"NV"'
            - '"S"'
            - '"O"'
            - "null"
          description: |-
            * P - CTO on post
            * N - CTO not pre-connectorized
            * NV - CTO Not pre-connectorized with structured vertical
            * S - Special
            * O - Other            
            * null - not defined
          example: P
        portIn:
          type: boolean
          description: True if the installer changes from MM to TESA due to Inspector
            intervention
          example: false
        user:
          type: string
          description: Last user to create/modify the address connection status
          example: theAcomitator
        creationDate:
          type: string
          example: 2019-07-11T10:0:00+0000
        updateDate:
          type: string
          example: 2019-07-11T10:0:00+0000
        releaseReason:
          type: string
          enum:
            - '"A"'
            - '"I"'
            - '"O"'
            - "null"
          description: |-
            * A - Automatic release based on date
            * I - Field Inspector
            * O - Other
            * null - Not released (Installer = TESA)
          example: null
        comment:
          type: string
          example: it was a sunny day...
        estimatedReleaseDate:
          type: string
          description: Estimated release date based on type of connection and area
          example: null
    errorResponse:
      properties:
        code:
          type: string
          example: "0002"
        status:
          type: string
          example: UNEXPECTED
        message:
          type: string
          example: Unexpected error
        detailMsg:
          type: string
          example: Unexpected error
    timeout_response:
      properties:
        code:
          type: string
          example: "0007"
        status:
          type: string
          example: REQUEST_TIMEOUT
        message:
          type: string
          example: Request Timeout
        detailMsg:
          type: string
          example: Name Api
    connectionTypes:
      type: array
      items:
        $ref: '#/components/schemas/connectionType'
    connectionType:
      properties:
        key:
          type: string
        value:
          type: string
    _getVolumes:
      type: object
      properties:
        technicalId:
          type: string
          example: "01000500474700067"
        scope:
          type: string
          example: street
          enum:
            - building
            - street
            - street odd
            - street even
            - town
        totalVolume:
          type: integer
          example: 50
        operators:
          $ref: "#/components/schemas/_tos"
    _tos:
      type: array
      items:
        type: object
        properties:
          operator:
            type: string
            example: MasMovil
          volume:
            type: integer
            example: 20
    _installationsUpdate:
      type: object
      required:
        - scope
        - operators
        - installationType
        - source
      properties:
        operators:
          items:
            type: string
            example: MasMovil
        installationType:
          type: string
          example: POSTE
          enum:
            - POSTE
            - POSTE H
            - NO POSTE
        scope:
          type: string
          example: street
          enum:
            - building
            - street
            - street odd
            - street even
        source:
          $ref: "#/components/schemas/_source"
    _source:
      type: object
      required:
        - user
        - type
      properties:
        user:
          type: string
          example: 1231FSM
        type:
          type: string
          example: INSPECTOR
          enum:
            - INSPECTOR
            - CONTRATA
            - CIERRE
            - MENSAJERIA
    _getInstallationList:
      type: object
      properties:
        total:
          type: integer
          example: 50
        installations:
          type: array
          items:
            type: object
            properties:
              operators:
                type: array
                items:
                  type: string
                  example: Grupo MasMovil
              technicalId:
                type: string
                example: "01000500474700067"
              streetNum:
                type: integer
                example: "67"
    _getInstallationType:
      type: object
      properties:
        installationType:
          type: array
          items:
            type: string
            example: POSTE
    _listUpdate:
      type: object
      properties:
        installationType:
          type: string
          example: POSTE, NO POSTE, POSTE H
        operators:
          type: array
          items:
            type: string
            example: MasMovil
        technicalIds:
          type: array
          items:
            type: string
            example: "01000500474700067"
        source:
          $ref: "#/components/schemas/_source"
    _singleUpdate:
      type: object
      properties:
        cto:
          $ref: "#/components/schemas/_ctoSingleUpdate"
        source:
          $ref: "#/components/schemas/_source"
    _ctoSingleUpdate:
      type: object
      required:
        - ctoCode
        - operator
        - installationType
        - territoryOwner
      properties:
        ctoCode:
          type: string
          example: 08346863x4433xe
        territoryOwner:
          type: string
          example: ADAMO01
        installationType:
          type: string
          example: FACHADA
    conflict_response:
      properties:
        code:
          type: string
          example: "0014"
        status:
          type: string
          example: CONFLICT
        message:
          type: string
          example: Conflict
        detailMsg:
          type: string
          example: "You cannot modify the record with that type of user"
    poleinfo_accepted:
      type: string
      example: {}
    finance_availability_credit_limit_request:
      type: object
      properties:
        customer_id:
          type: string
          example: 963085b0-f526-4a53-88bc-4d14d8311eaa
          description: new uuid format used by MasCustomers
        account_id:
          type: string
          example: 963085b0-f526-4a53-88bc-4d14d8311eaa
          description: new uuid format used by MasCustomers
        operation:
          type: string
          enum:
            - CONVERGENT
            - MOBILE_ONLY
            - MIGRATION
            - ADDLINE
          x-enum-varnames:
            - CONVERGENT
            - MOBILE_ONLY
            - MIGRATION
            - ADDLINE
          example: CONVERGENT
        sales_app:
          type: integer
          example: 4
          description: sales application
        dealer_id:
          type: string
          example: "54321"
          description: dealer id
        customer_info:
          type: object
          $ref: '#/components/schemas/customer_info'
    insurance_check_request:
      type: object
      properties:
        insurance_type:
          type: string
          example: GLOBAL
          enum:
            - GLOBAL
            - MULTIMEDIA
          description: type of insurance to check
        delivery_date:
          type: string
          format: date
          example: "1990-05-23"
      required:
        - insurance_type
    insurance_check_response:
      type: object
      properties:
        allowed:
          type: boolean
          example: true
    mobile_coverage_check_5g_response:
      type: object
      description: Response indicating 5G coverage availability
      properties:
        5g:
          type: boolean
          description: |
            Indicates if 5G mobile coverage is available at the address.
          example: true
      required:
        - 5g
    finance_renewal_request:
      type: object
      properties:
        customer_id:
          type: string
          example: 963085b0-f526-4a53-88bc-4d14d8311eaa
          description: new uuid format used by MasCustomers
        account_id:
          type: string
          example: 963085b0-f526-4a53-88bc-4d14d8311eaa
          description: new uuid format used by MasCustomers
        subscription_id:
          type: string
          format: int64
          example: 125474c9-b563-487d-abe1-37106da7d4f6
          description: uuid legacy id
          nullable: false
        app_id:
          type: integer
          example: 4
          description: sales application
        dealer_id:
          type: string
          example: "54321"
          description: dealer id
      required:
        - customer_id
        - account_id
        - subscription_id
        - app_id
        - dealer_id
    finance_renewal_response:
      type: object
      properties:
        subscription:
          $ref: "#/components/schemas/subscription"
        total_limits:
          $ref: "#/components/schemas/total_limits"
        payment_financial_entity:
          type: array
          items:
            $ref: "#/components/schemas/payment_financial_entity_response"
        renewal_allowed:
          type: boolean
          example: true
        financed_devices_available_limit:
          type: integer
        available_credit_limit:
          type: number
          format: double
          example: 50.50
        single_upfront_devices_available_limit:
          type: integer
        prescoring_id_value:
          type: integer
          format: int64
          example: 445322123
        prescoring_risk_profile:
          type: string
          enum:
            - ALTO
            - BAJO
            - MEDIO
            - UNKNOWN
          x-enum-varnames:
            - ALTO
            - MEDIO
            - BAJO
            - UNKNOWN
          example: ALTO
        score_value:
          type: string
          description: "Enum representing score values for different states."
          enum:
            - REJECTED
            - UNFRONT_REQUIRED
            - APPROVED
            - SPECIAL_APPROVED
          x-enum-varnames:
            - REJECTED
            - UNFRONT_REQUIRED
            - APPROVED
            - SPECIAL_APPROVED
          x-enum-descriptions:
            - "REJECTED score value is-100 and also -90"
            - "UNFRONT_REQUIRED score value is 20"
            - "APPROVED score value is 71"
            - "SPECIAL_APPROVED score value is 100"
        renewal_denied_reason:
          type: string
          example: NONE
          enum:
            - NONE
            - CONTRACTED_TERMINAL_IN_LOGISTIC_PROCESS_INVALID
            - CONTRACTED_TERMINAL_IN_PENALIZATION_PERIOD
            - CONTRACTED_TERMINAL_IN_PENDING_PAYMENT_REVIEW
        action:
          type: string
          example: RENEWAL_WITH_TYPE1_AND_CANCEL_PERMANENCY
          enum:
            - RENEWAL_WITH_TYPE1_AND_CANCEL_PERMANENCY
            - RENEWAL_WITH_TYPE1
            - RENEWAL_WITH_TYPE2
          x-enum-varnames:
            - RENEWAL_WITH_TYPE1_AND_CANCEL_PERMANENCY
            - RENEWAL_WITH_TYPE1
            - RENEWAL_WITH_TYPE2
        score_description:
          type: string
          example: "Score approved"
        segmentation_code:
          type: string
          example: 1
    payment_financial_entity_response:
      type: object
      properties:
        entity:
          type: string
          example: BBVA
        amount:
          type: number
          format: double
          example: 100.0
    total_limits:
      type: object
      properties:
        credit_limit:
          type: number
          format: double
          example: 50.50
        single_upfront_devices_limit:
          type: integer
        financed_devices_limit:
          type: integer
    customer_info:
      type: object
      properties:
        first_name:
          type: string
          example: "Lorenzo"
        last_name:
          type: string
          example: Lopez Lopez
        middle_name:
          type: string
          example: "Medina"
        birth_date:
          type: string
          format: date
          example: "1990-05-23"
        contact_data:
          $ref: '#/components/schemas/contact_data'
        address_info:
          $ref: '#/components/schemas/address_info'
        associated_user:
          $ref: '#/components/schemas/associated_user'
    address_info:
      type: object
      properties:
        address:
          type: string
          example: CALLE DE FRANCISCO GINER
          description: Street from address
        postal_code:
          type: string
          example: 28830
          description: Postal code
        locality:
          type: string
          example: San Fernando de Henares
          description: Locality from address
        region_code:
          type: string
          example: MA
        administrative_area:
          type: string
          example: Madrid
        country_id:
          type: string
          example: ES
    associated_user:
      type: object
      properties:
        first_name:
          type: string
          example: "Lorenzo"
        middle_name:
          type: string
          example: "Lopez"
        second_name:
          type: string
          example: "Medina"
        document_type:
          type: string
          example: NIF
          enum:
            - NIF
            - CIF
            - NIE
            - PASSPORT
            - TR
          description: client document type.
        document_id:
          type: string
          example: 88662844Y
          description: client document number.
        nationality:
          type: string
          example: ES
    subscription:
      type: object
      properties:
        subscription_id:
          type: string
        subscription_devices:
          type: array
          items:
            $ref: '#/components/schemas/subscription_device'
    subscription_device:
      type: object
      properties:
        id:
          type: string
        installment_plan_end_date:
          type: string
    territory_owner_type:
      type: string
      description: "Enum representing both type TO"
      enum:
        - DIRECT_COVERAGE
        - INDIRECT_COVERAGE
        - ADSL
      x-enum-varnames:
        - DIRECT_COVERAGE
        - INDIRECT_COVERAGE
        - ADSL
  securitySchemes:
    AuthnToken:
      type: http
      scheme: bearer
      bearerFormat: JWT