openapi: 3.0.1
info:
  title: MasAppointments API
  description: The Appointment API is one of Pre-Ordering Management API Family. An
    Appointment is an arrangement to do something or meet someone at a particular
    time and place. It is previously made during an interaction or may be necessary
    to solve a customer problem or to deliver a product order item. The appointment
    API goal is to manage an appointment with all the necessary characteristics. First,
    the API consists in searching free time slots based on given parameters. Then,
    the appointment is created. The appointment has characteristics such as nature
    of appointment, place of appointment etc.
  version: 0.1.57
servers:
- url: https://appointments.sta.masstack.com/v1
  description: Staging server
- url: https://appointments.masstack.com/v1
  description: Production server
security:
- Bearer: []
tags:
- name: Appointments
  description: Appointment management API to be able to carry out the installation of resources to the client
- name: Appointments Extension
  description: It's an API extension to facilitate the creation of appointments
paths:
  /orgs/{org}/appointments:
    post:
      tags:
      - Appointments
      summary: Create Appointment in FSM
      description: Request to create appointment in FSM
      operationId: createAppointment
      parameters:
        - $ref: "#/components/parameters/orgParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Appointment'
        required: true
      responses:
        '201':
          description: Appointment response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentResponse'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
  /orgs/{org}/appointments/searchTimeSlot:
    post:
      tags:
      - Appointments
      summary: Search Slots in FSM
      description: Request with information of period of installation
      operationId: searchTimeSlot
      parameters:
        - $ref: "#/components/parameters/orgParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchsTimeSlots'
        required: true
      responses:
        '200':
          description: SearchsTimeSlots response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchsTimeSlotsResponse'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
  /orgs/{org}/appointments/{id}:
    get:
      tags:
      - Appointments
      summary: Get Appointment in FSM by externalId, taskId or appointmentId
      description: Request to get appointment in FSM
      operationId: getAppointment
      parameters:
        - $ref: "#/components/parameters/orgParam"
        - $ref: "#/components/parameters/idParam"
      responses:
        '200':
          description: Appointment response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentResponse'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
    patch:
      tags:
      - Appointments
      summary: Update Appointment in FSM
      description: Request to update appointment in FSM
      operationId: updateAppointment
      parameters:
        - $ref: "#/components/parameters/orgParam"
        - $ref: "#/components/parameters/idParam"
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Appointment'
        required: true
      responses:
        '200':
          description: Appointment response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentResponse'
        default:
          description: Error response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
  /orgs/{org}/ext/appointments:
    post:
      tags:
        - Appointments Extension
      operationId: createAppointmentExt
      parameters:
        - $ref: "#/components/parameters/orgParam"
      requestBody:
        description: create appointment request.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateAppointment'
        required: true
      responses:
        '201':
          description: appointment created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentResponse'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackendException'
        '409':
          description: conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackendException'
    put:
      tags:
        - Appointments Extension
      operationId: updateAppointmentExt
      parameters:
        - $ref: "#/components/parameters/orgParam"
      requestBody:
        description: update appointment request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateAppointment'
        required: true
      responses:
        '200':
          description: appointment updated successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentResponse'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackendException'
        '404':
          description: Not found.
  /orgs/{org}/ext/searchTimeSlots:
    post:
      tags:
        - Appointments Extension
      operationId: searchTimeSlots
      parameters:
        - $ref: "#/components/parameters/orgParam"
      requestBody:
        description: send to search time slots request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchTimeSlots'
        required: true
      responses:
        '200':
          description: search time slots response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SearchsTimeSlotsResponse'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackendException'
  /orgs/{org}/ext/task:
    post:
      tags:
        - Appointments Extension
      operationId: createTaskAppointmentExt
      parameters:
        - $ref: "#/components/parameters/orgParam"
      requestBody:
        description: create task appointment request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTaskAppointment'
        required: true
      responses:
        '200':
          description: Deployment province response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AppointmentResponse'
        '400':
          description: bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BackendException'
components:
  parameters:
    orgParam:
      name: org
      in: path
      description: tenant name
      required: true
      schema:
        type: string
      example: masmovil
    idParam:
      name: id
      in: path
      description: a id of Appointment
      required: true
      schema:
        type: string
      example: MYSIM_XXXX
  schemas:
    Appointment:
      type: object
      properties:
        category:
          type: string
          description: Used to categorize the order from a business perspective that
            can be useful for the OM system
          example: installation
        contactMedium:
          type: array
          description: contactMedium
          example:
          - characteristic:
              key: mobile
              value: +33650981065
            mediumType: phoneNumber
            preferred: true
          - characteristic:
              key: mobile
              value: +33650232065
            mediumType: phoneNumber
          items:
            $ref: '#/components/schemas/ContactMedium'
        description:
          type: string
          description: free-text description firestorehe Appointment
          example: Tarea para conseguir una cita
        externalId:
          type: string
          description: ID given by the consumer (to facilitate searches afterwards)
          example: MYSIM_391588
        id:
          type: string
          description: Identifier of an instance of the Appointment. Required to be
            unique within the resource type.  Used in URIs as the identifier for specific
            instances of a type
          example: MYSIM_391588
        note:
          type: array
          description: note
          example:
          - author: Ludovic Robert
            date: 2020-08-12T11:00:18.071Z
            text: Problem explained to the back-office
          items:
            $ref: '#/components/schemas/Note'
        relatedEntity:
          type: array
          description: related entity
          example:
          - href: https://mysim/MYSIM_12411
            id: MYSIM_12411
            name: ID of OT
            role: workorder
          items:
            $ref: '#/components/schemas/RelatedEntity'
        relatedParty:
          type: array
          description: related party
          example:
          - id: RISK
            role: scoring_result
          - id: "1"
            role: scoring_level
          - id: Raúl
            role: firstName
          - id: Garcia Garcia
            role: middleName
          - id: 12345678T
            role: documentNumber
          - id: test@pe.es
            role: email
          - id: "686201221"
            role: phoneNumber
          - id: "28036"
            role: zipcode
          - id: mysim
            role: sellchannel
          - id: "10"
            role: user_role
          - id: Residencial
            role: segment
          - id: eu_ES
            role: language
          - id: "80"
            role: duration
          items:
            $ref: '#/components/schemas/RelatedParty'
        relatedPlace:
          $ref: '#/components/schemas/RelatedPlace'
        resourceOrderItem:
          type: array
          description: resourceOrderItem
          example:
          - id: "6545"
            resource:
              resourceCharacteristic:
              - name: type
                value: FTTH
              - name: territoryOwner
                value: NEBA
          - id: "6546"
            resource:
              resourceCharacteristic:
              - name: type
                value: MOBILE_LINE
              - name: msisdn
                value: "666777888"
              - name: tariff
                value: 3GB Ilimitada
          items:
            $ref: '#/components/schemas/ResourceOrderItem'
        status:
          type: string
          description: The life cycle state of the resource
          example: accepted
        validFor:
          $ref: '#/components/schemas/RangePeriod'
      description: Appointment A Appointment is a request to book an appointment in
        FSM
    AppointmentResponse:
      type: object
      properties:
        category:
          type: string
          description: Used to categorize the order from a business perspective that
            can be useful for the OM system
          example: installation
        contactMedium:
          type: array
          description: contactMedium
          example:
          - characteristic:
              key: mobile
              value: +33650981065
            mediumType: phoneNumber
            preferred: true
          - characteristic:
              key: mobile
              value: +33650232065
            mediumType: phoneNumber
          items:
            $ref: '#/components/schemas/ContactMedium'
        creationDate:
          type: string
          description: |-
            Date when the appointment was created
            Format: time
          format: date-time
        description:
          type: string
          description: free-text description firestorehe Appointment
          example: Tarea para conseguir una cita
        externalId:
          type: string
          description: ID given by the consumer (to facilitate searches afterwards)
          example: MYSIM_391588
        id:
          type: string
          description: Identifier of an instance of the Appointment. Required to be
            unique within the resource type.  Used in URIs as the identifier for specific
            instances of a type
          example: MYSIM_391588
        lastUpdate:
          type: string
          description: |-
            Date when the appointment was created
            Format: time
          format: date-time
        note:
          type: array
          description: note
          example:
          - author: Ludovic Robert
            date: 2020-08-12T11:00:18.071Z
            text: Problem explained to the back-office
          items:
            $ref: '#/components/schemas/Note'
        relatedEntity:
          type: array
          description: related entity
          example:
          - href: https://mysim/MYSIM_12411
            id: MYSIM_12411
            name: ID of OT
            role: workorder
          items:
            $ref: '#/components/schemas/RelatedEntity'
        relatedParty:
          type: array
          description: related party
          example:
          - id: RISK
            role: scoring_result
          - id: "1"
            role: scoring_level
          - id: Raúl
            role: firstName
          - id: Garcia Garcia
            role: middleName
          - id: 12345678T
            role: documentNumber
          - id: test@pe.es
            role: email
          - id: "686201221"
            role: phoneNumber
          - id: "28036"
            role: zipcode
          - id: mysim
            role: sellchannel
          - id: "10"
            role: user_role
          - id: Residencial
            role: segment
          - id: eu_ES
            role: language
          - id: "16"
            role: tenant
          - id: "80"
            role: duration
          items:
            $ref: '#/components/schemas/RelatedParty'
        relatedPlace:
          $ref: '#/components/schemas/RelatedPlace'
        resourceOrderItem:
          type: array
          description: resourceOrderItem
          example:
          - id: "6545"
            resource:
              resourceCharacteristic:
              - name: type
                value: FTTH
              - name: territoryOwner
                value: NEBA
          - id: "6546"
            resource:
              resourceCharacteristic:
              - name: type
                value: MOBILE_LINE
              - name: msisdn
                value: "666777888"
              - name: tariff
                value: 3GB Ilimitada
          items:
            $ref: '#/components/schemas/ResourceOrderItem'
        status:
          type: string
          description: The life cycle state of the resource
          example: accepted
        validFor:
          $ref: '#/components/schemas/RangePeriod'
      description: AppointmentResponse response of Appointment
    AvailableTimeSlot:
      title: AvailableTimeSlot reference.
      type: object
      properties:
        relatedParty:
          type: array
          description: related party
          items:
            $ref: '#/components/schemas/RelatedParty'
        validFor:
          $ref: '#/components/schemas/RangePeriod'
    Characteristic:
      title: Characteristic Describes a given characteristic of an object or entity
        through a name/value pair.
      required:
      - name
      - value
      type: object
      properties:
        name:
          type: string
          description: Name of the characteristic
        value:
          type: string
          description: The value of the characteristic
    ContactMedium:
      required:
      - characteristic
      - mediumType
      type: object
      properties:
        characteristic:
          $ref: '#/components/schemas/Characteristic'
        mediumType:
          type: string
          description: MediumType of contact
        preferred:
          type: boolean
          description: Check if this medium is preferred
      description: ContactMedium Describes customer's contact medium
    ErrorDto:
      type: object
      properties:
        componentMsg:
          type: string
          description: Detailed error message
          example: ID MYSIM_6922893 not exists
        id:
          type: string
          description: Error identifier
          example: MM0000002
        msg:
          type: string
          description: Generic error message
          example: Resource not found
        status:
          type: integer
          format: int64
          description: HTTP error code
          example: 404
      description: ErrorDto defines an extended error
    Note:
      type: object
      properties:
        author:
          type: string
          description: Author of the note
        date:
          type: string
          description: |-
            Date of the note
            Format: time
          format: date-time
        id:
          type: string
          description: Identifier of the note within its containing entity (may or
            may not be globally unique, depending on provider implementation)
        text:
          type: string
          description: Text of the note
      description: Note Extra information about a given entity
    RangePeriod:
      type: object
      properties:
        endDateTime:
          type: string
          description: EndDateTime of the period
          format: date-time
          example: 2020-08-18T15:00:00Z
        startDateTime:
          type: string
          description: StartDateTime of the period
          format: date-time
          example: 2020-08-18T13:00:00Z
      description: RangePeriod reference
    RelatedEntity:
      title: RelatedEntity reference.
      required:
      - id
      type: object
      properties:
        href:
          type: string
          description: Name of the related entity.
        id:
          type: string
          description: Unique identifier of a related entity.
        name:
          type: string
          description: Name of the related entity.
        role:
          type: string
          description: Role played by the related party
    RelatedParty:
      title: RelatedParty Related Entity reference. A related party defines party
        or party role linked to a specific entity.
      required:
      - id
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of a related entity.
        name:
          type: string
          description: Name of the related entity.
        role:
          type: string
          description: Role played by the related party
    RelatedPlace:
      title: RelatedPlace reference.
      required:
      - id
      type: object
      properties:
        href:
          type: string
          description: Name of the related entity.
          example: https://gescal37/geographicAddress/01000500059400011
        id:
          type: string
          description: Unique identifier of a related entity.
          example: 01000500059400011 001B
        name:
          type: string
          description: Name of the related entity.
          example: Reyes de Navarra 11, 1B, Vitoria, Alava
        role:
          type: string
          description: Role played by the related party
          example: interventionAddress
    Resource:
      type: object
      properties:
        resourceCharacteristic:
          type: array
          description: resource characteristic
          items:
            $ref: '#/components/schemas/Characteristic'
      description: Resource Resource is an abstract entity that describes the common
        set of attributes shared by all concrete resources. The polymorphic attributes
        @type, @schemaLocation & @referredType are related to the Resource entity
        and not the related ResourceRefOrValue class itself
    ResourceOrderItem:
      title: ResourceOrderItem An identified part of the order. A resource order is
        decomposed into one or more order items.
      type: object
      properties:
        id:
          type: string
          description: Identifier of the line item (generally it is a sequence number
            01, 02, 03, ...)
        resource:
          $ref: '#/components/schemas/Resource'
    SearchsTimeSlots:
      type: object
      properties:
        id:
          type: string
          description: Identifier of an instance of the Appointment. Required to be
            unique within the resource type.  Used in URIs as the identifier for specific
            instances of a type
          example: MYSIM_391588
        relatedEntity:
          type: array
          description: related entity
          example:
          - href: https://mysim/MYSIM_12411
            id: MYSIM_12411
            name: ID of OT
            role: workorder
          items:
            $ref: '#/components/schemas/RelatedEntity'
        relatedParty:
          type: array
          description: related party
          example:
          - id: RISK
            role: scoring_result
          - id: "1"
            role: scoring_level
          - id: Raúl
            role: firstName
          - id: Garcia Garcia
            role: middleName
          - id: 12345678T
            role: documentNumber
          - id: test@pe.es
            role: email
          - id: "686201221"
            role: phoneNumber
          - id: "28036"
            role: zipcode
          - id: mysim
            role: sellchannel
          - id: "10"
            role: user_role
          - id: Residencial
            role: segment
          - id: eu_ES
            role: language
          - id: "80"
            role: duration
          items:
            $ref: '#/components/schemas/RelatedParty'
        relatedPlace:
          $ref: '#/components/schemas/RelatedPlace'
        requestedTimeSlot:
          type: array
          description: requestedTimeSlot
          items:
            $ref: '#/components/schemas/ValidFor'
        resourceOrderItem:
          type: array
          description: resourceOrderItem
          example:
          - id: "6545"
            resource:
              resourceCharacteristic:
              - name: type
                value: FTTH
              - name: territoryOwner
                value: NEBA
          - id: "6546"
            resource:
              resourceCharacteristic:
              - name: type
                value: MOBILE_LINE
              - name: msisdn
                value: "666777888"
              - name: tariff
                value: 3GB Ilimitada
          items:
            $ref: '#/components/schemas/ResourceOrderItem'
      description: SearchsTimeSlots A SearchsTimeSlots is a request to provision a
        slot to FSM
    SearchsTimeSlotsResponse:
      type: object
      properties:
        availableTimeSlot:
          type: array
          description: availableTimeSlot
          example:
          - relatedParty:
            - id: "11"
              role: freeSlots
            - id: "0"
              role: ocuppiedSlots
            validFor:
              endDateTime: 2020-08-15T09:00:00.000Z
              startDateTime: 2020-08-15T07:00:00.000Z
          - relatedParty:
            - id: "11"
              role: freeSlots
            - id: "0"
              role: ocuppiedSlots
            validFor:
              endDateTime: 2020-08-15T11:00:00.000Z
              startDateTime: 2020-08-15T09:00:00.000Z
          - relatedParty:
            - id: "11"
              role: freeSlots
            - id: "0"
              role: ocuppiedSlots
            validFor:
              endDateTime: 2020-08-16T09:00:00.000Z
              startDateTime: 2020-08-16T07:00:00.000Z
          - relatedParty:
            - id: "11"
              role: freeSlots
            - id: "0"
              role: ocuppiedSlots
            validFor:
              endDateTime: 2020-08-16T11:00:00.000Z
              startDateTime: 2020-08-16T09:00:00.000Z
          - relatedParty:
            - id: "11"
              role: freeSlots
            - id: "0"
              role: ocuppiedSlots
            validFor:
              endDateTime: 2020-08-17T09:00:00.000Z
              startDateTime: 2020-08-17T07:00:00.000Z
          - relatedParty:
            - id: "7"
              role: freeSlots
            - id: "4"
              role: ocuppiedSlots
            validFor:
              endDateTime: 2020-08-18T15:00:00.000Z
              startDateTime: 2020-08-18T13:00:00.000Z
          items:
            $ref: '#/components/schemas/AvailableTimeSlot'
        id:
          type: string
          description: Identifier of an instance of the Appointment. Required to be
            unique within the resource type.  Used in URIs as the identifier for specific
            instances of a type
          example: MYSIM_391588
        relatedEntity:
          type: array
          description: related entity.
          example:
            - id: MYSIM_391588
              role: workorder
            - id: Alta FTTH + VOIP
              role: orderType
            - id: INSTALA MM
              role: connectionInstallationFlow
            - id: "00833"
              role: donorOperator
            - id: V
              role: linkState
            - id: NO POSTE
              role: ctoPoleDB
          items:
            $ref: '#/components/schemas/RelatedEntity'
        relatedParty:
          type: array
          description: related party
          example:
          - id: mysim
            role: sellchannel
          - id: '14'
            role: user_role
          - id: 'C002'
            role: user_code
          - id: RESIDENCIAL
            role: segment
          - id: '12'
            role: tenant
          - id: installation
            role: category
          - id: MANUEL
            role: firstName
          - id: MARTINEZ MORANT
            role: middleName
          - id: 4XXXXXXXXJ
            role: documentNumber
          - id: email@gmail.com
            role: email
          - id: 6XXXXXXXX
            role: phoneNumber
          - id: '50007'
            role: zipcode
          - id: es_ES
            role: language
          - id: OK
            role: scoring_result
          - id: '0'
            role: scoring_level
          - id: CONTRACT_TO_DEFINE
            role: contract
          - id: '0'
            role: delay
          - id: '85'
            role: duration
          - id: 'false'
            role: isNewAppointment
          - id: 2023-10-03T15:00:00 - 2023-10-03T18:00:00
            role: validForAppointment
          items:
            $ref: '#/components/schemas/RelatedParty'
        relatedPlace:
          $ref: '#/components/schemas/RelatedPlace'
        requestedTimeSlot:
          type: array
          description: requestedTimeSlot
          items:
            $ref: '#/components/schemas/ValidFor'
        resourceOrderItem:
          type: array
          description: resourceOrderItem
          example:
          - id: "6545"
            resource:
              resourceCharacteristic:
              - name: type
                value: FTTH
              - name: territoryOwner
                value: NEBA
          - id: "6546"
            resource:
              resourceCharacteristic:
              - name: type
                value: MOBILE_LINE
              - name: msisdn
                value: "666777888"
              - name: tariff
                value: 3GB Ilimitada
          items:
            $ref: '#/components/schemas/ResourceOrderItem'
        searchDate:
          type: string
          description: |-
            Date when the order was created
            Format: time
          format: date-time
        searchResult:
          type: string
          description: Information on the result of the resource
          example: success
        status:
          type: string
          description: The life cycle state of the resource
          example: created
      description: SearchsTimeSlotsResponse rResponse of SearchsTimeSlots
    ValidFor:
      type: object
      properties:
        validFor:
          $ref: '#/components/schemas/RangePeriod'
      description: ValidFor reference
    CreateAppointment:
      required:
        - workOrderId
        - category
        - sellChannel
        - userRole
        - segment
        - customer
        - scoringLevel
        - scoringResult
        - validFor
        - duration
      type: object
      properties:
        workOrderId:
          type: string
          description: work order identifier. When the value is known for yoigo It is necessary to add letter "Y" in the orderWorkId, in entry parameters of iframe for example Y360852 for other CRM as MYSIM or HEOS (pepephone), the curent prefix already used as MYSIM_ , WD_ or PP.
          example: MYSIM_391588
        category:
          type: string
          description: used to categorize the order from a business perspective that can be useful for the OM system.
          example: installation
        sellChannel:
          type: string
          description: seller chanel.
          example: mysim
        userRole:
          type: string
          description: role played by the user.
          example: 10
        userCode:
          type: string
          description: user code.
          example: 12
        segment:
          type: string
          description: segment.
          example: Residencial
        customer:
          type: object
          allOf:
            - $ref: '#/components/schemas/Customer'
        scoringResult:
          type: string
          enum:
            - OK
            - RELEASE
            - RISK
            - A
            - R
          description: it is the overall risk value of customer fraud. This value for TMS-YOIGO comes from ROVE interface, other CRM have differents fraud systems.
          example: RISK
        scoringLevel:
          type: string
          pattern: ^[0-9]+$
          description: it is the risk level of customer fraud. This value for TMS-YOIGO comes from ROVE interface, other CRM have differents fraud systems.
          example: 1
        validFor:
          type: object
          allOf:
            - $ref: '#/components/schemas/RangePeriod'
        gescalId:
          type: string
          description: gescal 37 identifier.
          example: 01000500059400011 001B
        duration:
          type: string
          pattern: ^\d+$
          description: calculation duration.
          example: 80
        ctoPoleDB:
          type: string
          description: cto database response.
          enum:
            - POSTE
            - POSTE H
            - NO POSTE
          example: POSTE
        orderType:
          type: string
          description: order type.
          example: Alta FTTH + VOIP
        connectionInstallationFlow:
          type: string
          description: connection installation flow.
          example: INSTALA MM
        donorOperator:
          type: string
          description: donor operator.
          example: 00833
        linkState:
          type: string
          description: link state.
          example: V
    Customer:
      required:
        - firstName
        - documentNumber
        - phoneNumber
        - zipcode
        - language
      type: object
      properties:
        firstName:
          type: string
          description: user first name.
          example: Carmen
        middleName:
          type: string
          description: user middle name.
          example: Pérez Medina
        documentNumber:
          type: string
          description: user document number. It can be NIF, NIE  or PASSPORT.
          example: 12345678T
        email:
          type: string
          description: user email.
          example: test@pe.es
        phoneNumber:
          type: string
          description: user phone number.
          example: 686201221
        zipcode:
          type: string
          description: user zip code.
          example: 28036
        language:
          type: string
          pattern: ^[a-z]{2}_[A-Z]{2}$
          description: language used by the user.
          example: es_ES
    UpdateAppointment:
      required:
        - workOrderId
        - validFor
        - duration
      type: object
      properties:
        workOrderId:
          type: string
          description: work order identifier. When the value is known for yoigo It is necessary to add letter "Y" in the orderWorkId, in entry parameters of iframe for example Y360852 for other CRM as MYSIM or HEOS (pepephone), the curent prefix already used as MYSIM_ , WD_ or PP.
          example: MYSIM_391588
        scoringResult:
          type: string
          enum:
            - OK
            - RELEASE
            - RISK
            - A
            - R
          description: scoring result.
          example: RISK
        scoringLevel:
          type: string
          pattern: ^[0-9]+$
          description: it is the risk level of customer fraud. This value for TMS-YOIGO comes from ROVE interface, other CRM have differents fraud systems.
          example: 1
        sellChannel:
          type: string
          description: sell channel.
          example: mysim
        userRole:
          type: string
          description: user role.
          example: 10
        userCode:
          type: string
          description: user code.
          example: 12
        segment:
          type: string
          description: apointment segment.
          example: RESIDENTIAL
        duration:
          type: string
          pattern: ^\d+$
          description: calculation duration.
          example: 80
        customer:
          type: object
          allOf:
            - $ref: '#/components/schemas/Customer'
        validFor:
          type: object
          allOf:
            - $ref: '#/components/schemas/RangePeriod'
        ctoPoleDB:
          type: string
          description: cto database response.
          enum:
            - POSTE
            - POSTE H
            - NO POSTE
          example: POSTE
        orderType:
          type: string
          description: order type.
          example: Alta FTTH + VOIP
        connectionInstallationFlow:
          type: string
          description: connection installation flow.
          example: INSTALA MM
        donorOperator:
          type: string
          description: donor operator.
          example: 00833
        linkState:
          type: string
          description: link state.
          example: V
    SearchTimeSlots:
      required:
        - action
        - category
        - orderWorkId
      type: object
      properties:
        action:
          type: string
          description: the two actions that the component allows are NUEVACITA | MODIFICARCITA.
          example: MODIFICARCITA
        scoringLevel:
          type: string
          description: It is the risk level of customer fraud
          example: 0
        scoringResult:
          type: string
          description: 'It is the overall risk value of customer fraud. Allowed values are: OK, RELEASE, RISK, A, R'
          example: OK
        segment:
          type: string
          description: apointment segment.
          example: RESIDENTIAL
        gescal:
          type: string
          description: gescal 37.
          example: 28000010025000026         002D
        category:
          type: string
          description: used to categorize the order from a business perspective that can be useful for the OM system.
          example: installation
        orderWorkId:
          type: string
          description: order work identifier.
          example: MYSIM_123456
        relatedParty:
          type: object
          allOf:
            - $ref: '#/components/schemas/RelatedPartyExt'
        productSpecification:
          type: object
          allOf:
            - $ref: '#/components/schemas/Product'
        contact:
          type: object
          allOf:
            - $ref: '#/components/schemas/Contact'
        customer:
          type: object
          allOf:
            - $ref: '#/components/schemas/CustomerExt'
    RelatedPartyExt:
      type: object
      properties:
        donorOperator:
          type: string
          description: donor operator information
          example: '00008'
        creationDate:
          type: string
          format: date-time
          description: date when the appointment was created. The format is yyyy-MM-dd'T'HH:mm:ssZ.
        territoryOwner:
          type: string
          description: territory owner.
          example: BIDOR01
        connectionInstallationFlow:
          type: string
          description: connection installation flow. Rush installer (INSTALA_TESA, INSTALA_MM).
          example: INSTALA_TESA
        linkState:
          type: string
          description: |
            allowed values:
              "linkState": null, in case of not NEBA or VULA
              "linkState": "O", in case of NEBA PO
              "linkState": "V",  in case of NEBA PV or VULA
          example: V
        userCode:
          type: string
          description: user code.
          example: Code01
        userProfile:
          type: string
          description: user profile information. CRM must use 14 for new appointment, 10 for updateAppointment. FSM must send other user profiles.
          example: Profile01
        originAccessIsExternal:
          type: boolean
          description: new numbering sales information with external access origin and without transfer of access
          example: false
    Product:
      required:
        - schema
      type: object
      properties:
        schema:
          type: object
          description: schema. This is a map.
          additionalProperties:
            type: string
          example: id:Alta FTTH + VOIP__AGILETV
    Contact:
      required:
        - postCode
        - contactNumber
      type: object
      properties:
        emailAddress:
          type: string
          description: order contact email.
          example: joao.parreira@rupeal.com
        postCode:
          type: string
          description: order contact postal code.
          example: 28033
        contactNumber:
          type: string
          description: contact number of order contact.
          example: 666666444
    CustomerExt:
      required:
        - firstName
        - documentId
      type: object
      properties:
        firstName:
          type: string
          description: contact first name.
          example: Carmen
        midName:
          type: string
          description: contact mid name.
          example: María
        documentId:
          type: string
          description: contact document identifier.
          example: 11111111H
        documentIdCif:
          type: string
          description: document identifier CIF if cutomer is a company.
          example: 11111111H
        language:
          type: string
          pattern: ^[a-z]{2}_[A-Z]{2}$
          description: Client language. If not reported, by default it would be in Spanish (es_ES). ISO 639-1 Standard and ISO 3166-1 Standard
          example: es_ES
    CreateTaskAppointment:
      required:
        - workOrderId
        - sellChannel
        - userRole
        - segment
        - customer
        - scoringLevel
        - scoringResult
        - note
      type: object
      properties:
        workOrderId:
          type: string
          description: work order identifier. When the value is known for yoigo It is necessary to add letter "Y" in the orderWorkId, in entry parameters of iframe for example Y360852 for other CRM as MYSIM or HEOS (pepephone), the curent prefix already used as MYSIM_ , WD_ or PP
          example: MYSIM_391588
        sellChannel:
          type: string
          description: sell channel.
          example: mysim
        userRole:
          type: string
          description: user role.
          example: 10
        segment:
          type: string
          description: segment.
          example: Residencial
        customer:
          type: object
          allOf:
            - $ref: '#/components/schemas/Customer'
        scoringResult:
          type: string
          enum:
            - OK
            - RELEASE
            - RISK
            - A
            - R
          description: scoring result.
          example: RISK
        scoringLevel:
          type: string
          pattern: ^[0-9]+$
          description: it is the risk level of customer fraud. This value for TMS-YOIGO comes from ROVE interface, other CRM have differents fraud systems.
          example: 1
        startDate:
          type: string
          format: date
          description: start date.  The format is yyyy-MM-dd.
        endDate:
          type: string
          format: date
          description: end date.  The format is yyyy-MM-dd.
        timeZone:
          type: string
          description: time zone.
          enum:
            - TIME_ZONE_1
            - TIME_ZONE_2
            - TIME_ZONE_3
            - TIME_ZONE_4
        gescalId:
          type: string
          description: gescal 37 identifier.
          example: 01000500059400011 001B
        note:
          type: array
          description: item to highlight certain aspects of the appointment.
          items:
            $ref: '#/components/schemas/Note'
        duration:
          type: string
          pattern: ^\d+$
          description: calculation duration.
          example: 80
        ctoPoleDB:
          type: string
          description: cto database response.
          enum:
            - POSTE
            - POSTE H
            - NO POSTE
          example: POSTE
        orderType:
          type: string
          description: order type.
          example: Alta FTTH + VOIP
        connectionInstallationFlow:
          type: string
          description: connection installation flow.
          example: INSTALA MM
        donorOperator:
          type: string
          description: donor operator.
          example: 00833
        linkState:
          type: string
          description: link state.
          example: V
    BackendException:
      type: object
      properties:
        code:
          type: string
          description: error code.
          example: 400
        status:
          type: string
          description: error status.
          example: BAD_REQUEST
        message:
          type: string
          description: error message.
          example: Bad Request
        detailMsg:
          type: string
          description: error message obtained in the response.
          example: The [category] attribute is required.
  securitySchemes:
    Bearer:
      type: apiKey
      name: Authorization
      in: header