# Generated from contract.yaml by npm run gen:api in web/desk.
openapi: 3.1.0
info:
  title: telco customer portal
  version: 0.1.0
  description: >
    Customer access to bills, service status and a unified mailbox. Send the
    current account's scoped bearer credential to the service. A browser behind
    an operator session adapter uses a same-origin session cookie at its edge.
    Amounts and dates are supplied by the service that owns the record.
servers:
  - url: /
security:
  - customer: []
paths:
  /api/v1/portal/openapi.yaml:
    get:
      operationId: portalContract
      summary: Download this standalone API description
      security: []
      responses:
        '200':
          description: OpenAPI 3.1 YAML with local references
          content:
            application/yaml:
              schema:
                type: string
  /health/live:
    get:
      operationId: portalLive
      security: []
      responses:
        '200':
          description: Process is serving requests
  /health/ready:
    get:
      operationId: portalReady
      security: []
      responses:
        '200':
          description: Service is ready to accept requests
  /api/v1/portal/overview:
    get:
      operationId: portalOverview
      summary: Read billing and service status for the current account
      description: >-
        Both sources are requested in parallel. A temporarily unavailable
        section is null and named in unavailable. An authorization failure
        suppresses the entire response.
      responses:
        '200':
          description: Account overview with at least one available section
          content:
            application/json:
              schema:
                type: object
                required:
                  - billing
                  - service
                  - unavailable
                properties:
                  billing:
                    anyOf:
                      - $ref: '#/components/schemas/SelfcareBilling'
                      - type: 'null'
                  service:
                    anyOf:
                      - $ref: '#/components/schemas/SelfcareService'
                      - type: 'null'
                  unavailable:
                    $ref: '#/components/schemas/Unavailable'
        '401':
          $ref: '#/components/responses/Failure'
        '403':
          $ref: '#/components/responses/Failure'
        '503':
          $ref: '#/components/responses/Failure'
        default:
          $ref: '#/components/responses/Failure'
      parameters:
        - $ref: '#/components/parameters/language'
  /api/v1/portal/mailbox:
    get:
      operationId: portalMailbox
      summary: List current documents and receipts, newest first
      description: >-
        Answered objections and confirmed blocks keep their ref and receive a
        new read_path. Use the link returned with the revision the customer
        viewed.
      responses:
        '200':
          description: Available documents and the sections to retry
          content:
            application/json:
              schema:
                type: object
                required:
                  - documents
                  - unavailable
                properties:
                  documents:
                    type: array
                    items:
                      $ref: '#/components/schemas/Document'
                  unavailable:
                    $ref: '#/components/schemas/Unavailable'
        '401':
          $ref: '#/components/responses/Failure'
        '403':
          $ref: '#/components/responses/Failure'
        '503':
          $ref: '#/components/responses/Failure'
        default:
          $ref: '#/components/responses/Failure'
  /api/v1/portal/mailbox/{ref}/read:
    put:
      operationId: portalMarkRead
      summary: Acknowledge the document revision the customer opened
      parameters:
        - name: ref
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/DocumentRef'
        - name: version
          in: query
          description: >-
            Use the server-issued read_path. Invoice, objection and block links
            carry a revision.
          schema:
            type: string
            enum:
              - issued
              - received
              - answered
              - requested
              - confirmed
      responses:
        '204':
          description: The owner recorded the acknowledgement
        default:
          $ref: '#/components/responses/Failure'
  /api/v1/portal/billing:
    get:
      operationId: selfcareBilling
      summary: >-
        Bills, next estimate, objections and selectable plans for the
        authenticated customer.
      parameters:
        - $ref: '#/components/parameters/language'
      responses:
        '200':
          description: >-
            Bills, next estimate, objections and selectable plans for the
            authenticated customer.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SelfcareBilling'
        default:
          $ref: '#/components/responses/Failure'
  /api/v1/portal/service:
    get:
      summary: Customer subscriptions, service status and private receipts
      responses:
        '200':
          description: Customer subscriptions, service status and private receipts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SelfcareService'
        default:
          $ref: '#/components/responses/Failure'
      operationId: selfcareService
  /api/v1/portal/bills/{id}:
    get:
      operationId: selfcareBill
      summary: Read the sealed figures in a chosen language.
      parameters:
        - $ref: '#/components/parameters/id'
        - $ref: '#/components/parameters/language'
      responses:
        '200':
          description: Read the sealed figures in a chosen language.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SelfcareBill'
        default:
          $ref: '#/components/responses/Failure'
  /api/v1/portal/bills/{id}/itemisation:
    get:
      operationId: portalItemisation
      summary: Retrieve the account's available fixed-line call itemisation.
      parameters:
        - $ref: '#/components/parameters/id'
        - name: format
          in: query
          schema:
            type: string
            enum:
              - json
              - pdf
            default: json
      responses:
        '200':
          description: Permitted call detail for this invoice.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Itemisation'
            application/pdf:
              schema:
                type: string
                format: binary
        default:
          $ref: '#/components/responses/Failure'
  /api/v1/portal/bills/{id}/original:
    get:
      operationId: selfcareOriginal
      summary: >-
        Accessible original invoice. The private verification QR opens the
        account when an origin is configured.
      parameters:
        - $ref: '#/components/parameters/id'
        - name: format
          in: query
          schema:
            type: string
            enum:
              - html
              - pdf
            default: html
          description: >-
            Accessible HTML reading or the exact first-rendered PDF from the
            document archive.
      responses:
        '200':
          description: >-
            Accessible original invoice. The private verification QR opens the
            account when an origin is configured.
          content:
            application/pdf:
              schema:
                type: string
                format: binary
            text/html:
              schema:
                type: string
          headers:
            ETag:
              description: SHA-256 of the archived PDF for a PDF response.
              schema:
                type: string
            Content-Disposition:
              description: Filename supplied for the PDF.
              schema:
                type: string
        default:
          $ref: '#/components/responses/Failure'
  /api/v1/portal/bills/{id}/objections/{case_id}:
    put:
      operationId: selfcareObject
      summary: Record or replay a line objection and return its durable receipt.
      parameters:
        - $ref: '#/components/parameters/id'
        - $ref: '#/components/parameters/case_id'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - line
                - reason
              properties:
                line:
                  type: integer
                  minimum: 0
                reason:
                  type: string
                  minLength: 1
                  maxLength: 2000
      responses:
        '200':
          description: Record or replay a line objection and return its durable receipt.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SelfcareObjection'
        default:
          $ref: '#/components/responses/Failure'
  /api/v1/portal/bills/{id}/verification:
    post:
      operationId: selfcareVerifyShare
      summary: >-
        Issue a seven-day masked verification link. Replaces any previous link
        for this invoice.
      parameters:
        - $ref: '#/components/parameters/id'
        - $ref: '#/components/parameters/idempotency'
      responses:
        '200':
          description: >-
            Issue a seven-day masked verification link. Replaces any previous
            link for this invoice.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SelfcareVerification'
        default:
          $ref: '#/components/responses/Failure'
    delete:
      operationId: selfcareVerifyRevoke
      summary: Revoke the shared verification link.
      parameters:
        - $ref: '#/components/parameters/id'
      responses:
        '204':
          description: Revoke the shared verification link.
        default:
          $ref: '#/components/responses/Failure'
  /api/v1/portal/preview:
    get:
      operationId: selfcarePreview
      summary: >-
        Compare a dated switch with the existing subscription, including its
        activation date and scheduled tariff slices.
      parameters:
        - name: subscription
          in: query
          required: true
          schema:
            type: string
            format: uuid
        - name: plan
          in: query
          required: true
          schema:
            type: string
        - name: from
          in: query
          required: true
          schema:
            type: string
            format: date
      responses:
        '200':
          description: >-
            Compare a dated switch with the existing subscription, including its
            activation date and scheduled tariff slices.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SelfcarePreview'
        default:
          $ref: '#/components/responses/Failure'
  /api/v1/portal/subscriptions/{id}/outages/{case}:
    get:
      operationId: portalOutageReceipt
      summary: >-
        Read the current account's outage assessment, claim receipt and booking
        status.
      parameters:
        - $ref: '#/components/parameters/id'
        - $ref: '#/components/parameters/case'
      responses:
        '200':
          description: >-
            Current decision and the first 50 intakes ordered by received_at and
            then UUID. The claim field contains the first listed receipt or null
            when the case has no claims.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutageReceipt'
        default:
          $ref: '#/components/responses/Failure'
  /api/v1/portal/subscriptions/{id}/outages/{case}/claims/{request}:
    get:
      operationId: portalOutageClaimReceipt
      summary: >-
        Retrieve an individual intake receipt for the authenticated account,
        subscription and case.
      parameters:
        - $ref: '#/components/parameters/id'
        - $ref: '#/components/parameters/case'
        - $ref: '#/components/parameters/request'
      responses:
        '200':
          description: Original intake channel, UUID, business date and timestamp.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutageClaimReceipt'
        '404':
          $ref: '#/components/responses/Failure'
        default:
          $ref: '#/components/responses/Failure'
    put:
      operationId: portalOutageClaim
      summary: >-
        Submit a compensation claim for a reported outage and recover the
        original receipt on retry.
      parameters:
        - $ref: '#/components/parameters/id'
        - $ref: '#/components/parameters/case'
        - $ref: '#/components/parameters/request'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
      responses:
        '200':
          description: >-
            Outage status with the receipt for this request UUID in the claim
            field, including on replay and when the receipt falls outside the
            claims list.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutageReceipt'
        default:
          $ref: '#/components/responses/Failure'
  /api/v1/portal/subscriptions/{id}/blocks/{request}:
    put:
      summary: Request a selective network block
      parameters:
        - $ref: '#/components/parameters/id'
        - $ref: '#/components/parameters/request'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SelfcareBlockRequest'
      responses:
        '200':
          description: Request a selective network block
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SelfcareBlock'
        default:
          $ref: '#/components/responses/Failure'
      operationId: selfcareBlock
components:
  securitySchemes:
    customer:
      type: http
      scheme: bearer
      description: Credential scoped to one billing account
  responses:
    Failure:
      description: >-
        RFC 9457 problem. Codes from the owning service are preserved for client
        errors. Gateway codes include auth.required, auth.forbidden,
        portal.invalid, portal.account-mismatch, portal.unavailable, not-found,
        method-not-allowed and request.too-large.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  schemas:
    Unavailable:
      type: array
      uniqueItems: true
      items:
        type: string
        enum:
          - billing
          - service
    DocumentRef:
      type: string
      description: Stable kind and UUID of one customer document
      pattern: >-
        ^(bill|objection|notice|block|cancellation):[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$
    Document:
      type: object
      required:
        - ref
        - kind
        - data
        - issued
        - title
        - sender
        - read_path
      properties:
        ref:
          $ref: '#/components/schemas/DocumentRef'
        issued:
          type: string
          format: date
        title:
          type: string
        sender:
          type: string
        read_path:
          type: string
          format: uri-reference
      oneOf:
        - properties:
            kind:
              const: bill
            data:
              $ref: '#/components/schemas/SelfcareBillSummary'
        - properties:
            kind:
              const: objection
            data:
              $ref: '#/components/schemas/SelfcareObjection'
        - properties:
            kind:
              enum:
                - notice
                - block
                - cancellation
            data:
              $ref: '#/components/schemas/SelfcareContractReceipt'
    Problem:
      type: object
      required:
        - type
        - title
        - status
        - detail
        - code
      properties:
        type:
          type: string
        title:
          type: string
        status:
          type: integer
        detail:
          type: string
        code:
          type: string
        rule:
          type: string
        fix:
          type: string
        pointer:
          type: string
      description: An RFC 9457 problem. code identifies the gateway or domain refusal.
    SelfcareBillLine:
      type: object
      required:
        - line
        - label
        - kind
        - item
        - from
        - to
        - amount
        - why
      properties:
        line:
          type: integer
          minimum: 0
        label:
          type: string
        kind:
          type: string
        item:
          type: string
        from:
          type: string
          format: date
        to:
          type: string
          format: date
        amount:
          type: string
          description: Exact decimal EUR amount
        why:
          type: string
    SelfcareBillReading:
      type: object
      required:
        - period
        - usage_state
        - gross
        - net
        - vat
        - prices
        - lines
      properties:
        period:
          type: string
        usage_state:
          type: string
          enum:
            - no-records
            - included
            - charged
        gross:
          type: string
          description: Exact decimal EUR amount
        net:
          type: string
          description: Exact decimal EUR amount
        vat:
          type: string
          description: Exact decimal EUR amount
        prices:
          type: string
        lines:
          type: array
          items:
            $ref: '#/components/schemas/SelfcareBillLine'
    SelfcareBillSummary:
      type: object
      required:
        - id
        - number
        - sealed_on
        - kind
        - period
        - gross
        - read_on
      properties:
        id:
          type: string
          format: uuid
        number:
          type: string
        sealed_on:
          type: string
          format: date
        kind:
          type: string
        period:
          type: string
          format: date
        gross:
          type: string
          description: Exact decimal EUR amount
        read_on:
          anyOf:
            - type: string
              format: date
            - type: 'null'
    SelfcareObjection:
      type: object
      required:
        - id
        - bill
        - line
        - reason
        - status
        - received_on
        - answered_on
        - read_on
        - answer
        - remedy_bill
        - amount
        - currency
        - prices
      properties:
        id:
          type: string
          format: uuid
        bill:
          type: string
          format: uuid
        line:
          type: integer
          minimum: 0
        reason:
          type: string
        status:
          type: string
          enum:
            - received
            - answered
        received_on:
          type: string
          format: date
        answered_on:
          anyOf:
            - type: string
              format: date
            - type: 'null'
        read_on:
          anyOf:
            - type: string
              format: date
            - type: 'null'
        answer:
          anyOf:
            - type: string
            - type: 'null'
        remedy_bill:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
        amount:
          type: string
          description: Exact decimal EUR amount
        currency:
          const: EUR
        prices:
          type: string
    SelfcareBilling:
      type: object
      required:
        - account
        - as_of
        - open
        - open_error
        - bills
        - objections
        - subscriptions
        - plans
      properties:
        account:
          type: string
          format: uuid
        as_of:
          type: string
          format: date
        open:
          anyOf:
            - $ref: '#/components/schemas/SelfcareBillReading'
            - type: 'null'
        open_error:
          anyOf:
            - type: string
            - type: 'null'
        bills:
          type: array
          items:
            $ref: '#/components/schemas/SelfcareBillSummary'
        objections:
          type: array
          items:
            $ref: '#/components/schemas/SelfcareObjection'
        subscriptions:
          type: array
          items:
            type: object
            required:
              - id
              - book
              - plan
            properties:
              id:
                type: string
                format: uuid
              book:
                type: string
              plan:
                type: string
        plans:
          type: array
          items:
            type: object
            required:
              - reference
              - name
            properties:
              reference:
                type: string
              name:
                type: string
    SelfcareArrival:
      type: object
      properties:
        id:
          type: string
          format: uuid
        appointment_on:
          anyOf:
            - type: string
              format: date
            - type: 'null'
        approved_cents:
          anyOf:
            - type: integer
              format: int64
            - type: 'null'
        status:
          type: string
          enum:
            - registered
            - agreed
            - failed
            - done
            - approved
            - review
        source:
          type: string
        next_step:
          type:
            - string
            - 'null'
        expected_on:
          type:
            - string
            - 'null'
          format: date
      required:
        - id
        - appointment_on
        - approved_cents
        - status
      additionalProperties: false
    SelfcareBlock:
      type: object
      properties:
        id:
          type: string
          format: uuid
        date:
          type: string
          format: date
        status:
          type: string
          enum:
            - requested
            - confirmed
        category:
          type: string
          enum:
            - premium
            - international
        blocked:
          type: boolean
      required:
        - id
        - date
        - status
        - category
        - blocked
      additionalProperties: false
    SelfcareSubscription:
      type: object
      properties:
        id:
          type: string
          format: uuid
        contract_id:
          type: string
          format: uuid
        product:
          type: string
        state:
          type: string
        plan:
          anyOf:
            - type: string
            - type: 'null'
        book_version:
          anyOf:
            - type: string
            - type: 'null'
        appointments:
          type: array
          items:
            $ref: '#/components/schemas/SelfcareArrival'
        outages:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                format: uuid
              reported_on:
                type: string
                format: date
            required:
              - id
              - reported_on
            additionalProperties: false
        outage:
          anyOf:
            - type: object
              properties:
                kind:
                  const: outage
                  type: string
                incident:
                  type: string
                  format: uuid
                status:
                  type: string
                  enum:
                    - reported
                    - fixed
                reported_on:
                  type: string
                  format: date
                managed:
                  type: boolean
                eligible:
                  anyOf:
                    - type: boolean
                    - type: 'null'
                monthly_fee_cents:
                  anyOf:
                    - type: integer
                      format: int64
                    - type: 'null'
                reduction_cents:
                  anyOf:
                    - type: integer
                      format: int64
                    - type: 'null'
                approved_cents:
                  anyOf:
                    - type: integer
                      format: int64
                    - type: 'null'
                booked_cents:
                  anyOf:
                    - type: integer
                      format: int64
                    - type: 'null'
                journal:
                  anyOf:
                    - type: string
                    - type: 'null'
                estimate_cents:
                  anyOf:
                    - type: integer
                      format: int64
                    - type: 'null'
                through:
                  anyOf:
                    - type: string
                      format: date
                    - type: 'null'
                rule:
                  type: string
                date:
                  type: string
                  format: date
                updated_on:
                  type: string
                  format: date
                source:
                  type: string
                next_step:
                  type:
                    - string
                    - 'null'
                expected_on:
                  type:
                    - string
                    - 'null'
                  format: date
                claimed_cents:
                  type:
                    - integer
                    - 'null'
                  minimum: 0
              required:
                - kind
                - incident
                - status
                - reported_on
                - approved_cents
                - booked_cents
                - journal
                - estimate_cents
                - through
                - rule
                - date
                - updated_on
              additionalProperties: false
            - type: 'null'
        switch:
          anyOf:
            - type: object
              properties:
                kind:
                  const: switch
                  type: string
                status:
                  type: string
                  enum:
                    - requested
                    - scheduled
                    - delayed
                    - completed
                    - cancelled
                date:
                  type: string
                  format: date
                updated_on:
                  type: string
                  format: date
                source:
                  type: string
                next_step:
                  type:
                    - string
                    - 'null'
                expected_on:
                  type:
                    - string
                    - 'null'
                  format: date
              required:
                - kind
                - status
                - date
                - updated_on
              additionalProperties: false
            - type: 'null'
        porting:
          anyOf:
            - type: object
              properties:
                kind:
                  const: porting
                  type: string
                status:
                  type: string
                  enum:
                    - requested
                    - scheduled
                    - delayed
                    - completed
                    - cancelled
                date:
                  type: string
                  format: date
                updated_on:
                  type: string
                  format: date
                source:
                  type: string
                next_step:
                  type:
                    - string
                    - 'null'
                expected_on:
                  type:
                    - string
                    - 'null'
                  format: date
              required:
                - kind
                - status
                - date
                - updated_on
              additionalProperties: false
            - type: 'null'
        arrears:
          anyOf:
            - type: object
              properties:
                kind:
                  const: arrears
                  type: string
                status:
                  type: string
                  enum:
                    - warned
                    - restricted
                    - lifted
                amount_cents:
                  type: integer
                  format: int64
                disputed_cents:
                  type: integer
                  format: int64
                reference:
                  type: string
                date:
                  type: string
                  format: date
                updated_on:
                  type: string
                  format: date
                source:
                  type: string
                next_step:
                  type:
                    - string
                    - 'null'
                expected_on:
                  type:
                    - string
                    - 'null'
                  format: date
              required:
                - kind
                - status
                - amount_cents
                - disputed_cents
                - reference
                - date
                - updated_on
              additionalProperties: false
            - type: 'null'
        timeline:
          type: array
          items:
            type: object
            properties:
              kind:
                type: string
              status:
                type: string
              date:
                type: string
                format: date
              source:
                type: string
              next_step:
                type:
                  - string
                  - 'null'
              expected_on:
                type:
                  - string
                  - 'null'
                format: date
              incident:
                type:
                  - string
                  - 'null'
                format: uuid
            required:
              - kind
              - status
              - date
            additionalProperties: false
        selective_blocks:
          type: array
          items:
            $ref: '#/components/schemas/SelfcareBlock'
      required:
        - id
        - contract_id
        - product
        - state
        - plan
        - book_version
        - appointments
        - outage
        - switch
        - porting
        - arrears
        - timeline
        - selective_blocks
      additionalProperties: false
    SelfcareContractReceipt:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - block
            - cancellation
            - notice
        date:
          type: string
          format: date
        status:
          type: string
        text:
          type: string
        read_on:
          anyOf:
            - type: string
              format: date
            - type: 'null'
        sender:
          type:
            - string
            - 'null'
        dispatch_reference:
          type:
            - string
            - 'null'
        effective_on:
          type:
            - string
            - 'null'
          format: date
      required:
        - id
        - type
        - date
        - status
        - text
        - read_on
      additionalProperties: false
    SelfcareService:
      type: object
      properties:
        account:
          type: string
          format: uuid
        as_of:
          type: string
          format: date
        subscriptions:
          type: array
          items:
            $ref: '#/components/schemas/SelfcareSubscription'
        receipts:
          type: array
          items:
            $ref: '#/components/schemas/SelfcareContractReceipt'
        support:
          type: object
          required:
            - email
            - phone
          properties:
            email:
              type: string
            phone:
              type: string
      required:
        - account
        - as_of
        - subscriptions
        - receipts
        - support
      additionalProperties: false
    SelfcareBill:
      type: object
      required:
        - period
        - usage_state
        - gross
        - net
        - vat
        - prices
        - lines
        - id
        - number
        - kind
        - sealed_on
        - lang
        - due_on
      properties:
        period:
          type: string
        usage_state:
          type: string
          enum:
            - no-records
            - included
            - charged
        gross:
          type: string
          description: Exact decimal EUR amount
        net:
          type: string
          description: Exact decimal EUR amount
        vat:
          type: string
          description: Exact decimal EUR amount
        prices:
          type: string
        lines:
          type: array
          items:
            $ref: '#/components/schemas/SelfcareBillLine'
        id:
          type: string
          format: uuid
        number:
          type: string
        kind:
          type: string
        sealed_on:
          type: string
          format: date
        lang:
          type: string
        due_on:
          anyOf:
            - type: string
              format: date
            - type: 'null'
    Itemisation:
      type: object
      required:
        - bill
        - number
        - prices
        - calls
      properties:
        bill:
          type: string
          format: uuid
        number:
          type: string
        prices:
          type: string
          enum:
            - gross
            - net
        calls:
          type: array
          minItems: 1
          items:
            type: object
            required:
              - answered_at
              - destination
              - seconds
              - billed_units
              - amount
              - lines
            properties:
              answered_at:
                type: string
                description: Answer time including the switch offset
              destination:
                type: string
              seconds:
                type: integer
                minimum: 1
              billed_units:
                type: integer
                minimum: 0
                description: Seconds charged after tariff rounding and allowances
              amount:
                type: string
                description: Decimal EUR charge from the sealed rating
              lines:
                type: array
                items:
                  type: integer
                  minimum: 0
                description: Zero-based positions in the sealed invoice
    SelfcareVerification:
      type: object
      required:
        - path
        - expires_on
        - qr_path
      properties:
        path:
          type: string
        expires_on:
          type: string
          format: date
        qr_path:
          anyOf:
            - type: string
            - type: 'null'
    SelfcarePreview:
      type: object
      required:
        - from
        - currency
        - assumption
        - current
        - proposed
      properties:
        from:
          type: string
          format: date
        currency:
          const: EUR
        assumption:
          type: string
        current:
          type: object
          required:
            - reference
            - first
            - regular
            - prices
            - first_lines
            - following_lines
          properties:
            reference:
              type: string
            first:
              type: string
              description: Exact decimal EUR amount
            regular:
              type: string
              description: Exact decimal EUR amount
            prices:
              enum:
                - gross
                - net
              type: string
            first_lines:
              type: array
              items:
                type: object
                properties:
                  label:
                    type: string
                  kind:
                    type: string
                  item:
                    type: string
                  from:
                    type: string
                    format: date
                  to:
                    type: string
                    format: date
                  amount:
                    type: string
                    description: Exact decimal EUR amount
            following_lines:
              type: array
              items:
                type: object
                properties:
                  label:
                    type: string
                  kind:
                    type: string
                  item:
                    type: string
                  from:
                    type: string
                    format: date
                  to:
                    type: string
                    format: date
                  amount:
                    type: string
                    description: Exact decimal EUR amount
        proposed:
          type: object
          required:
            - reference
            - first
            - regular
            - prices
            - first_lines
            - following_lines
          properties:
            reference:
              type: string
            first:
              type: string
              description: Exact decimal EUR amount
            regular:
              type: string
              description: Exact decimal EUR amount
            prices:
              enum:
                - gross
                - net
              type: string
            first_lines:
              type: array
              items:
                type: object
                properties:
                  label:
                    type: string
                  kind:
                    type: string
                  item:
                    type: string
                  from:
                    type: string
                    format: date
                  to:
                    type: string
                    format: date
                  amount:
                    type: string
                    description: Exact decimal EUR amount
            following_lines:
              type: array
              items:
                type: object
                properties:
                  label:
                    type: string
                  kind:
                    type: string
                  item:
                    type: string
                  from:
                    type: string
                    format: date
                  to:
                    type: string
                    format: date
                  amount:
                    type: string
                    description: Exact decimal EUR amount
    OutageClaimReceipt:
      type: object
      properties:
        id:
          type: string
          format: uuid
        channel:
          type: string
        received_on:
          type: string
          format: date
        received_at:
          type: string
          format: date-time
      required:
        - id
        - channel
        - received_on
        - received_at
      additionalProperties: false
    OutageReceipt:
      type: object
      properties:
        id:
          type: string
          format: uuid
        subscription:
          type: string
          format: uuid
        reported_on:
          type: string
          format: date
        repaired_on:
          anyOf:
            - type: string
              format: date
            - type: 'null'
        state:
          type: string
          enum:
            - reported
            - received
            - review
            - proposed
            - external
            - zero
            - pending
            - posted
        revision:
          type: integer
          format: int64
        claim:
          anyOf:
            - $ref: '#/components/schemas/OutageClaimReceipt'
            - type: 'null'
        claims:
          type: array
          items:
            $ref: '#/components/schemas/OutageClaimReceipt'
        estimate_cents:
          type:
            - integer
            - 'null'
        assessment_cents:
          anyOf:
            - type: integer
              format: int64
            - type: 'null'
        approved_cents:
          anyOf:
            - type: integer
              format: int64
            - type: 'null'
        booked_cents:
          anyOf:
            - type: integer
              format: int64
            - type: 'null'
        journal:
          anyOf:
            - type: string
            - type: 'null'
        through:
          anyOf:
            - type: string
              format: date
            - type: 'null'
        rule:
          type: string
        next_step:
          type: string
        decision_reason:
          anyOf:
            - type: string
            - type: 'null'
        contact:
          type: string
        booking_status:
          type:
            - string
            - 'null'
          enum:
            - pending
            - unavailable
            - posted
            - null
        external_settled:
          type: boolean
      required:
        - id
        - subscription
        - reported_on
        - repaired_on
        - state
        - revision
        - claim
        - claims
        - estimate_cents
        - assessment_cents
        - approved_cents
        - booked_cents
        - journal
        - through
        - rule
        - next_step
        - decision_reason
        - contact
        - booking_status
        - external_settled
      additionalProperties: false
    SelfcareBlockRequest:
      type: object
      properties:
        category:
          type: string
          enum:
            - premium
            - international
        blocked:
          type: boolean
      required:
        - category
        - blocked
      additionalProperties: false
  parameters:
    case:
      name: case
      required: true
      in: path
      schema:
        type: string
        format: uuid
    id:
      name: id
      required: true
      in: path
      schema:
        type: string
        format: uuid
    case_id:
      name: case_id
      required: true
      in: path
      schema:
        type: string
        format: uuid
    request:
      name: request
      required: true
      in: path
      schema:
        type: string
        format: uuid
    language:
      name: lang
      in: query
      schema:
        type: string
        enum:
          - de
          - de-easy
          - en
        default: de
    idempotency:
      name: Idempotency-Key
      in: header
      required: false
      description: >-
        On any POST: a retry with the same key gets the first answer again (with
        Idempotent-Replayed: true), never a second effect. Per caller, bound to
        the method, path and body, kept 24 hours; 5xx answers are not kept.
      schema:
        type: string
        minLength: 1
        maxLength: 255
