openapi: 3.0.0
info:
  title: Barrings API
  description: Barrings REST API
  version: '3.2'
  contact:
    name: administrator
    email: mas-barrings@masmovil.com
servers:
  - url: https://barrings.masstack.com/v3/
    description: production
  - url: https://barrings.sta.masstack.com/v3/
    description: staging
tags:
  - name: Masks
    description: Barrings operations masks
  - name: Services
    description: Barrings operations services
  - name: Operations
    description: Barrings regularization
paths:
  /orgs/{orgId}/subscriptions/{subscriptionId}/services/{serviceId}:
    get:
      tags: [ Services ]
      summary: Get one service
      description: Request a service
      operationId: getService
      parameters:
        - $ref: "#/components/parameters/orgIdParam"
        - $ref: "#/components/parameters/subscriptionIdParam"
        - $ref: "#/components/parameters/serviceIdParam"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServiceStatusDto"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "404":
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    patch:
      tags: [ Services ]
      summary: Patch update one service
      description: Request a service barring over a subscription.
      operationId: operateService
      parameters:
        - $ref: "#/components/parameters/orgIdParam"
        - $ref: "#/components/parameters/subscriptionIdParam"
        - $ref: "#/components/parameters/serviceIdParam"
      requestBody:
        description: Contains services set and the reason to operate over a subscription
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ServiceOperationRequest'
        required: true
      responses:
        "202":
          description: Successfully accepted the operation request, returned the externalId and subscriptionId
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceOperationResponse'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orgs/{orgId}/subscriptions/{subscriptionId}/services:
    get:
      tags: [ Services ]
      summary: Get all subscription service
      description: Request all subscription service
      operationId: getSubscriptionServices
      parameters:
        - $ref: "#/components/parameters/orgIdParam"
        - $ref: "#/components/parameters/subscriptionIdParam"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServiceStatusListDto"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    patch:
      tags: [ Services ]
      summary: Patch update services
      description: Request services barring over a subscription.
      operationId: operateServices
      parameters:
        - $ref: "#/components/parameters/orgIdParam"
        - $ref: "#/components/parameters/subscriptionIdParam"
      requestBody:
        description: Contains services set and the reason to operate over a subscription
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MultiServicesOperationRequest'
        required: true
      responses:
        "202":
          description: Successfully accepted the operation request, returned the externalId and subscriptionId
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceOperationResponse'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orgs/{orgId}/subscriptions/{subscriptionId}/services/history:
    get:
      tags: [ Services ]
      summary: Get service status history
      description: Request service status history
      operationId: getServiceHistory
      parameters:
        - $ref: "#/components/parameters/orgIdParam"
        - $ref: "#/components/parameters/subscriptionIdParam"
        - $ref: "#/components/parameters/serviceIdQueryParam"
      responses:
        "200":
          description: OK
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ServiceStatusHistoryListResponse"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "404":
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orgs/{orgId}/masks:
    get:
      tags: [ Masks ]
      summary: Get barring masks catalogue
      description: Gets the barring masks catalogue
      operationId: getMaskCatalogue
      parameters:
        - $ref: "#/components/parameters/orgIdParam"
        - $ref: "#/components/parameters/operationTypeCodeParam"
        - $ref: "#/components/parameters/codeParam"
        - $ref: "#/components/parameters/subscriptionTypeParam"
      responses:
        "200":
          description: Successfully returned the barring mask catalogue
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaskCatalogueListDto'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orgs/{orgId}/masks/{maskId}:
    get:
      operationId: getMaskById
      summary: Get mask by id
      description: Return a mask if exists
      tags: [ Masks ]
      parameters:
        - $ref: "#/components/parameters/orgIdParam"
        - $ref: "#/components/parameters/maskIdParam"
      responses:
        200:
          description: The mask
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/MaskCatalogueDto"
        404:
          description: Not Found
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        400:
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        500:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /orgs/{orgId}/subscriptions/{subscriptionId}/masks:
    get:
      tags: [ Masks ]
      operationId: getSubscriptionMasks
      summary: Get masks applied to a subscription
      description: Get masks applied to a subscription
      parameters:
        - $ref: "#/components/parameters/orgIdParam"
        - $ref: "#/components/parameters/subscriptionIdParam"
      responses:
        "200":
          description: Successfully returned the masks associated to a subscription.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionMasksResponse'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    patch:
      tags: [ Masks ]
      summary: Patch for apply or remove masks
      description: Request a barring masks set operation over a subscription.
      operationId: operateSubscriptionMasks
      parameters:
        - $ref: "#/components/parameters/orgIdParam"
        - $ref: "#/components/parameters/subscriptionIdParam"
      requestBody:
        description: Contains the operation and the masks code set, that contains
          the barrings masks to operate over a subscription
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MasksOperationRequest'
        required: true
      responses:
        "202":
          description: Successfully accepted the operation request, returned the evaluation
            of mask, network services new status application pending
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MasksOperationResponse'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "404":
          description: SubscriptionId not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "409":
          description: Conflict to apply or remove barrings with subscription with
            invalid status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orgs/{orgId}/subscriptions/{subscriptionId}/masks/deferred:
    get:
      tags: [ Masks ]
      operationId: getSubscriptionDeferredMasks
      summary: Get deferred masks that will be applied to a subscription
      description: Get deferred masks that will be applied to a subscription
      parameters:
        - $ref: "#/components/parameters/orgIdParam"
        - $ref: "#/components/parameters/subscriptionIdParam"
      responses:
        "200":
          description: Successfully returned the deferred masks that will be applied to the subscription.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriptionDeferredMasksResponse'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orgs/{orgId}/subscriptions/{subscriptionId}/masks/prepaid:
    patch:
      tags: [ Masks ]
      summary: Patch for apply or remove masks for prepaid subscriptions
      description: Request a barring masks set operation over a prepaid subscription.
      operationId: operatePrepaidSubscriptionMasks
      parameters:
        - $ref: "#/components/parameters/orgIdParam"
        - $ref: "#/components/parameters/subscriptionIdParam"
      requestBody:
        description: Contains the operation and the masks code set, that contains
          the barrings masks to operate over a prepaid subscription
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MasksPrepaidOperationRequest'
        required: true
      responses:
        "202":
          description: Successfully accepted the operation request, returned the evaluation
            of mask, network services new status application pending
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MasksOperationResponse'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "404":
          description: SubscriptionId not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "409":
          description: Conflict to apply or remove barrings with subscription with
            invalid status
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /orgs/{orgId}/subscriptions/{subscriptionId}/masks/history:
    get:
      tags: [ Masks ]
      parameters:
        - $ref: "#/components/parameters/orgIdParam"
        - $ref: "#/components/parameters/subscriptionIdParam"
      operationId: getSubscriptionMasksHistory
      summary: Get masks applied history to a subscription
      description: Return a history list of of barred masks
      responses:
        200:
          description: History list of masks
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/SubscriptionMasksHistoryResponse"
        400:
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        500:
          description: Unexpected error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
  /operations:
    get:
      tags:
        - Operations
      summary: Get all operations
      description: Request all operations
      operationId: getOperations
      responses:
        "200":
          description: List with all operations
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegularizationListDto"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      tags:
        - Operations
      summary: Post to upload csv file with regularization
      description: Upload file with subscriptions to regularization.
      operationId: postOperationsFile
      requestBody:
        description: Contains the CSV file with regularization data and a string reason for the operation.
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                file:
                  type: string
                  format: binary
                  description: The CSV file containing the regularization data.
                reason:
                  type: string
                  description: A string explaining the reason for this regularization.
                  example: "Regularization for debt masks."
              required:
                - file
                - reason
            encoding:
              file:
                contentType: text/csv
        required: true
      responses:
        "202":
          description: File uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UploadFileResponse'
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "404":
          description: SubscriptionId not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /operations/{regularizationId}/items:
    get:
      tags:
        - Operations
      summary: Get all operations items with regularization id
      description: Return all operations items associated to regularization id
      operationId: getOperationsItems
      parameters:
        - $ref: "#/components/parameters/regularizationIdParam"
        - $ref: "#/components/parameters/offsetParam"
        - $ref: "#/components/parameters/limitParam"
      responses:
        "200":
          description: List with all operations items by id
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegularizationItemListDto"
        "400":
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "401":
          description: Unauthorized request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "403":
          description: Forbidden resource
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        "500":
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  parameters:
    orgIdParam:
      name: orgId
      in: path
      required: true
      description: A masmovil tenant
      schema:
        type: string
      example: masmovil
    subscriptionIdParam:
      name: subscriptionId
      in: path
      required: true
      description: Subscription identifier
      schema:
        type: string
      example: 22222
    serviceIdParam:
      name: serviceId
      in: path
      required: true
      description: Service identifier
      schema:
        type: integer
        format: int64
      example: 11111
    maskIdParam:
      name: maskId
      schema:
        type: integer
        format: int64
      in: path
      required: true
      description: Mask Id
      example: 1
    operationTypeCodeParam:
      name: operationTypeCode
      in: query
      required: false
      description: The operation type code of the mask
      schema:
        type: string
      example: DEBT
    codeParam:
      name: code
      in: query
      required: false
      description: The name code of the mask
      schema:
        type: string
      example: DEBT_MOBILE_HOTLP
    subscriptionTypeParam:
      name: subscriptionType
      in: query
      required: false
      description: The subscription type code of the mask
      schema:
        type: string
      example: MOBILE
    serviceIdQueryParam:
      name: serviceId
      in: query
      description: Service identifier
      schema:
        type: integer
        format: int64
      example: 10
    regularizationIdParam:
      name: regularizationId
      in: path
      required: true
      description: Regularization identifier
      schema:
        type: string
      example: 22222
    offsetParam:
      name: offset
      in: query
      required: true
      description: Number of items to skip (for pagination)
      schema:
        type: integer
        minimum: 0
      example: 0
    limitParam:
      name: limit
      in: query
      required: false
      description: Maximum number of items to return (for pagination)
      schema:
        type: integer
        minimum: 1
      example: 20
  schemas:
    MasksOperationRequest:
      type: object
      required:
        - action
        - barringsMasksCodes
      properties:
        action:
          type: string
          description: Action of the operation, the operation that applies the set
            of masks provided
          enum:
            - APPLY
            - REMOVE
          example: APPLY
        barringsMasksCodes:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            type: string
        reason:
          type: string
          description: Reason of barring operation
          enum:
            - DEBT
            - RISK
            - MIGRATION
            - ATC
            - CUST
          example: MIGRATION
          minItems: 1
    MasksPrepaidOperationRequest:
      type: object
      required:
        - action
        - barringsMasksCodes
      properties:
        action:
          type: string
          description: Action of the operation, the operation that applies the set
            of masks provided
          enum:
            - APPLY
            - REMOVE
          example: APPLY
        barringsMasksCodes:
          type: array
          minItems: 1
          uniqueItems: true
          items:
            type: string
        reason:
          type: string
          description: Reason of barring operation
          enum:
            - DEBT
            - RISK
            - MIGRATION
            - ATC
            - CUST
          example: MIGRATION
          minItems: 1
        deferredDate:
          type: string
          format: date-time
          description: Date when the barring will be applied
          example: 2025-02-01T09:00:00Z
    MasksOperationResponse:
      type: object
      required:
        - externalId
      properties:
        externalId:
          type: string
          description: External identifier of the business process operation triggered
            and associated to the request
          example: 1234451112-a3a2
    ServiceOperationRequest:
      type: object
      required:
        - reason
        - active
      properties:
        reason:
          type: string
          description: Reason
          example: CUST
          enum:
            - CUST
            - PROD
        active:
          type: boolean
          example: true
      description: Request to update one service
    MultiServicesOperationRequest:
      type: object
      required:
        - reason
        - services
      properties:
        reason:
          type: string
          description: Reason
          example: CUST
          enum:
            - CUST
            - PROD
        services:
          type: array
          items:
            $ref: '#/components/schemas/ServiceDto'
          minItems: 1
          uniqueItems: true
      description: Request to update many services
    ServiceOperationResponse:
      type: object
      required:
        - externalId
      properties:
        externalId:
          type: string
          description: External identifier of the business process operation triggered
            and associated to the request
          example: 1234451112-a3a2
      description: Barrings services operation result
    ServiceDto:
      type: object
      required:
        - serviceId
        - active
      properties:
        serviceId:
          type: integer
          description: Service Id
          format: int64
          example: 10
        active:
          type: boolean
          example: true
          description: Desired service status
      description: Service with status
    ServiceStatusDto:
      type: object
      required:
        - serviceId
        - serviceName
        - active
        - statusReason
        - order
        - date
      properties:
        serviceId:
          type: integer
          description: Service Id
          format: int64
          example: 1111
        serviceName:
          type: string
          description: Service Name
          example: "OUTGOING_VOICE"
        active:
          type: boolean
          example: true
          description: Service status
        statusReason:
          type: array
          items:
            type: string
        order:
          type: object
          $ref: '#/components/schemas/OrderDto'
        date:
          type: string
          format: date-time
          description: Date when the service status was last updated
          example: "2024-01-01T00:00:00Z"
        username:
          type: string
          description: User who performed the last service status update
          example: "MB_Limits"
    OrderDto:
      type: object
      required:
        - running
        - orders
      properties:
        running:
          type: boolean
          description: Order running status
          example: true
        orders:
          type: array
          items:
            type: string
          description: External id list
    ServiceStatusListDto:
      type: array
      items:
        $ref: '#/components/schemas/ServiceStatusDto'
    SubscriptionMasksResponse:
      type: array
      description: Mask code list
      items:
        $ref: "#/components/schemas/MaskCode"
    MaskCode:
      type: string
      description: Mask code
      example: DEBT_MOBILE_LP
    SubscriptionDeferredMasksResponse:
      type: array
      description: Deferred Masks list
      items:
        $ref: "#/components/schemas/DeferredMask"
    DeferredMask:
      type: object
      required:
        - mask
        - deferredDate
      properties:
        mask:
          type: string
          example: "CUST_ORANGETV_RESTRICTED"
        deferredDate:
          type: string
          format: date-time
          example: 2025-02-01T09:00:00Z
    SubscriptionMasksHistoryResponse:
      type: array
      items:
        $ref: "#/components/schemas/MaskHistoryResponse"
    MaskHistoryResponse:
      type: object
      required:
        - id
        - mask
        - subscription_id
        - operation
        - user
        - date
      properties:
        id:
          type: integer
          format: int64
          example: 1
          description: 'history id'
        mask:
          $ref: "#/components/schemas/ReducedMaskDto"
        operation:
          type: string
          enum: [ "APPLY", "REMOVE" ]
        subscription_id:
          type: string
          example: 14
          description: 'subscription id'
        user:
          type: string
          example: "MB_username"
        date:
          type: string
          format: date-time
    UploadFileResponse:
      type: object
      properties:
        fileName:
          type: string
          description: The name of the file that was uploaded.
          example: "regularization_data.csv"
        message:
          type: string
          description: A confirmation message indicating the status of the upload.
          example: "File uploaded successfully."
    ReducedMaskDto:
      type: object
      required:
        - id
        - code
        - name
        - description
      properties:
        id:
          type: integer
          format: int64
          example: 14
          description: 'The mask id'
        code:
          type: string
          example: DEBT_MOBILE_RESTRICTED
          description: Then mask code
        name:
          type: string
          example: Restringido
        description:
          type: string
          example: DEBT_MOBILE_RESTRICTED description
          description: Then mask description
    MaskCatalogueListDto:
      type: array
      items:
        $ref: '#/components/schemas/MaskCatalogueDto'
      description: List of barring masks
    MaskCatalogueDto:
      required:
        - id
        - code
      type: object
      properties:
        id:
          type: integer
          description: Mask Id
          format: int64
          example: 10
        code:
          type: string
          description: Barrings mask code, external identifier
          example: DEBT_MOBILE_LP
        description:
          type: string
          description: Barrings mask description
          example: Line services suspension due to debt
        name:
          type: string
          description: Barrings mask business name
          example: Redireccion Internet
        operationTypeCode:
          type: string
          description: Operation type group code
          example: DEBT
        subscriptionTypeCode:
          type: string
          description: Subscription type code
          example: MOBILE
        services:
          $ref: '#/components/schemas/ServiceCatalogueListDto'
          description: List of mask services
      description: Barring mask
    ServiceCatalogueListDto:
      type: array
      items:
        $ref: '#/components/schemas/ServiceCatalogueDto'
    ServiceCatalogueDto:
      required:
        - id
        - code
      type: object
      properties:
        id:
          type: integer
          description: Service Id
          format: int64
          example: 10
        code:
          type: string
          description: Service code
          example: OUTGOING_VOICE
        description:
          type: string
          description: Service description
          example: Outgoing Voice
    ServiceStatusHistoryListResponse:
      type: array
      items:
        $ref: "#/components/schemas/ServiceStatusHistoryResponse"
    ServiceStatusHistoryResponse:
      type: object
      required:
        - id
        - subscriptionId
        - serviceId
        - serviceName
        - serviceStatus
        - operationTypeId
        - operationType
        - username
        - updateDate
      properties:
        id:
          type: integer
          format: int64
          example: 1
          description: The history id
        subscriptionId:
          type: string
          example: 14
          description: The subscription id
        serviceId:
          type: integer
          format: int64
          example: 1
          description: The service id
        serviceName:
          type: string
          example: ROAMING
          description: The service name
        serviceStatus:
          type: boolean
          example: true
          description: The service status (true = active, false = inactive)
        operationTypeId:
          type: integer
          format: int64
          example: 1
          description: The operation type id
        operationType:
          type: string
          example: CUST
          description: The operation type code
        username:
          type: string
          example: barrings
          description: The username
        updateDate:
          type: string
          format: date-time
          example: 2024-11-19T09:34:10Z
          description: The update date
    RegularizationListDto:
      type: array
      items:
        $ref: "#/components/schemas/RegularizationDto"
    RegularizationItemListDto:
      type: array
      items:
        $ref: "#/components/schemas/RegularizationItemDto"
    RegularizationDto:
      type: object
      required:
        - username
        - userReason
        - requestDate
        - fileName
      properties:
        id:
          type: string
          example: 44444
          description: The regularization id
        username:
          type: string
          example: MB_admin
          description: User who performs the regularization
        userReason:
          type: string
          example: Remove debt from subscriptions
          description: Reason to perform the regularization
        requestDate:
          type: string
          format: date-time
          example: 2024-11-19T09:34:10Z
          description: The date of the regularization
        fileName:
          type: string
          example: debt-2025-06.csv
          description: Name of the csv file related to the regularization
        status:
          type: integer
          format: int64
          example: 1
          description: The regularization status
        requestedQuantity:
          type: integer
          format: int64
          example: 321
          description: The quantity of subscriptions (lines of the csv) to regularize
        requestedCompleted:
          type: integer
          format: int64
          example: 321
          description: The quantity of subscriptions (lines of the csv) regularized ok
        requestedError:
          type: integer
          format: int64
          example: 321
          description: The quantity of subscriptions (lines of the csv) regularized ko
        requestedUnprocessed:
          type: integer
          format: int64
          example: 321
          description: The quantity of subscriptions (lines of the csv) unprocessed
    RegularizationItemDto:
      type: object
      required:
        - tenant
        - subscriptionId
        - status
        - operation
        - masks
      properties:
        id:
          type: string
          example: 44444
          description: The regularization item id
        tenant:
          type: string
          example: yoigo
          description: The subscription tenant
        subscriptionId:
          type: string
          example: 44444
          description: The subscription id
        status:
          type: integer
          format: int64
          example: 1
          description: The regularization item status
        operation:
          type: string
          example: APPLY
          description: The operation to perform
        masks:
          type: string
          example: DEBT_MOBILE_HOTLP,DEBT_MOBILE_RESTRICTED
          description: A comma separated list of mask to operate
        subscriptionType:
          type: string
          example: MOBILE
          description: The subscription type
    ErrorResponse:
      type: object
      required:
        - code
        - tracingId
      properties:
        tracingId:
          type: string
          description: Trace id of the related request to track the exception
          example: 0e3f7e20-6a4b-4344-bad0-fe8576e72adc
        code:
          type: string
          description: Error code string for fast identification
          example: INVALID_BARRING_MASK
        message:
          type: string
          description: Message description or detail of error
          example: 'OA3_400_01: Validation error in some parameters. See swagger documentation'
      description: Rest service error response
  x-releaseInfo:
    description: >
      
      
      ### Release Notes
      
      * **1.5.0** : Create new endpoints for console operations
        - Get all operations created from console GET /operations
        - Post operations to upload csv file with subscriptions to regularization. POST /operations
        - Get all operations items associated to one operation GET /operations/{regularizationId}/items
      * **0.3.3** : Remove POST /orgs/{orgId}/subscriptions/{subscriptionId}/barrings-masks/operations
        - Remove deprecated endpoint
      * **0.3.2** : Create new endpoints for operate prepaid subscriptions masks and get deferred masks
        - Operate prepaid subscription masks POST /orgs/{orgId}/subscriptions/{subscriptionId}/masks/prepaid
        - Get deferred masks for subscription GET /orgs/{orgId}/subscriptions/{subscriptionId}/masks/deferred
      * **0.3.1** : Create GET /orgs/{orgId}/subscriptions/{subscriptionId}/services/history
        - Get service status history
      * **0.3.0** : Update endpoints related to subscriptionId
        - Change from int64 to string in subscription_id property in MaskHistoryResponse
        - Change from int64 to string in subscriptionId path param (all endpoints)
        - Change SubscriptionMasksResponse from object to string array (masks)
      * **0.2.6** : Create GET /orgs/{orgId}/subscriptions/{subscriptionId}/masks/history
        - Get subscription masks history
      * **0.1.1** : Changes GET /orgs/{orgId}/subscriptions/{subscriptionId}/services/
        - Add current orders data to services endpoints
      * **0.1.0** : Added new endpoint 
        - New Patch in url /orgs/{orgId}/subscriptions/{subscriptionId}/masks
      * **0.0.17** : Changes POST /orgs/{orgId}/subscriptions/{subscriptionId}/barrings-masks/operations
        - added customers masks