openapi: 3.1.0

info:
  title: Tvarka Due Diligence API
  version: 0.1.0
  summary: Machine-to-machine Lithuanian legal-entity due-diligence data, with optionally QES-signed responses.
  description: |
    Real-time due-diligence data on Lithuanian legal entities, retrieved on demand from the state
    registers administered by VĮ Registrų centras (JAR, JADIS, JANGIS, NTR) and from the Lithuanian
    court information system (LITEKO), normalized to JSON and delivered machine-to-machine.

    The service is provided as a legal service by a Lithuanian advokatas. It is **not public**:
    production keys are issued only after the client signs the engagement agreement (TPS) with a
    qualified electronic signature. The TPS carries the data-protection framework: purpose limitation,
    the legitimate-interest attestation for beneficial-owner data, and retention terms. See Get access.

    ## Response tiers
      * **Plain JSON** (default): `application/json`, integrity by TLS. Every response envelope
        carries `meta.responseId` and the retrieval timestamp.
      * **Signed JSON**: `?sign=jades-t` or `?sign=jades-lt` returns `application/jose+json` - the
        same JSON envelope wrapped in a JAdES signature (ETSI TS 119 182-1, flattened JWS JSON
        serialization) created with the qualified electronic signature of the responsible advokatas
        and a qualified timestamp (level T); level LT additionally embeds the certificate chain and
        revocation material for long-term validation. Verifiable with the EU DSS library.
      * **Evidence container**: `?format=asice` returns `application/vnd.etsi.asic-e+zip` - an
        ASiC-E container holding the normalized JSON, the raw source XML exactly as returned by the
        register, and a qualified signature at LT level with a qualified timestamp. Suitable for
        audit files and court use; validates with standard EU validators.

    Signing is inline and synchronous; a signed tier typically adds 0.5-1.5 s to the response time.
    `sign` and `format=asice` are mutually exclusive.

    ## What the signature means
      The signature certifies **provenance and integrity**: that the identified advokatas relayed
      this data unmodified from the named official source at the stated time, as part of a legal
      service. A response is NOT an official document issued by VĮ Registrų centras; official
      RC-issued documents are a separate deliverable of the Tvarka platform.

    ## Billing
      Pay-per-use, metered per successful data delivery: one `dd.pull.<product>` usage event per
      answered call, plus `dd.sign.jades_t` / `dd.sign.jades_lt` / `dd.sign.asice` for signed tiers.
      A no-data answer (404 with problem type ending `/no-data`) and upstream register failures
      (502) are NOT billed. Prices are published on the docs page; volume tiers apply to the plain
      tier.

    ## Beneficial-owner (UBO) data
      JANGIS beneficial-owner data is served under the legitimate-interest regime. The client's
      standing legal basis is attested in the TPS; each UBO call MUST carry a `purpose`, which is
      logged per call.

    ## Get access
      Sandbox keys (fixture data, zero-rated) are self-serve after a short review. Production keys
      require BOTH acceptance of the Terms of Service (https://api.tvarka.pro/terms) and a
      QES-signed TPS; a 403 names whichever is missing. The same surface is also exposed as an MCP server for agent
      integrations; tool names mirror the `operationId`s of this contract. MCP tools take the
      Lithuanian legal-entity code as their key input; the property-object-by-unique-number
      operation is REST-only.
  termsOfService: https://api.tvarka.pro/terms
  contact: { name: Tvarka Due Diligence, url: https://api.tvarka.pro/docs, email: dd@tvarka.pro }
  license: { name: Proprietary, url: https://tvarka.pro }
  x-status: >-
    v0.1.0 (2026-08-11). PLAIN TIER IMPLEMENTED (tvarka/dd_api/), behind FEATURE_DD_API_ENABLED,
    not yet deployed: key auth with TPS-gated production access, per-call metering with the
    ratified price table, sandbox environment answering synthetic payloads at zero price, and the
    six register-backed products plus the composite report over the production rc_broker path
    (ActionTypes 17/249/437 and the NTR pair 90+95/190) and the litigation archive.
    SIGNED TIERS FAIL CLOSED: sign / format=asice answer 503 until the unattended PKCS#11 signing
    worker exists, and the feature flag alone cannot serve an unsigned body at a signed price.
    Personal codes are exposed on production keys (owner decision 2026-08-11). Signing host is
    staged: operator workstation first (existing Tvarka middleware in high-risk non-interactive
    PIN mode as the polling worker), then a dedicated Ubuntu box on the same worker protocol.
    Seizures (TAAR) answers 503 product-unavailable until its ActionType is confirmed from the
    broker catalog (info.php); never guess ActionTypes. Not yet wired into docs publication or
    scripts/check_atk_openapi.py.

servers:
  - url: https://api.tvarka.pro
    description: Production. Final host is set at implementation; sandbox is selected by key type on the same host.

security:
  - apiKey: []

tags:
  - name: entities
    description: Registry data on a Lithuanian legal entity, addressed by its JAR code.
  - name: real-estate
    description: Real Property Register data, legal-entity scope only.
  - name: reports
    description: Composite due-diligence deliverables.

paths:
  /v1/entities/{code}:
    get:
      tags: [entities]
      operationId: getEntityProfile
      summary: Entity profile - core JAR attributes and current management.
      description: >-
        Extended JAR data: name, legal form, status, registered address, registration dates,
        capital, activities, and current management members. Source product JAR_ISPLESTINIS.
      parameters:
        - $ref: '#/components/parameters/EntityCode'
        - $ref: '#/components/parameters/Sign'
        - $ref: '#/components/parameters/Format'
      responses:
        '200':
          description: Entity profile in the requested tier.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/EntityProfileResponse' }
              example:
                data:
                  code: '300000001'
                  name: UAB Pavyzdys
                  legalForm: { code: '310', name: Uždaroji akcinė bendrovė }
                  status: { code: '0', name: Teisinis statusas neįregistruotas }
                  registeredAddress: Vilnius, Pavyzdžio g. 1
                  registrationDate: '2019-03-29'
                  deregistrationDate: null
                  capital: { amount: 2500, currency: EUR }
                  activities: [Kompiuterių programavimo veikla]
                  euid: null
                  lei: null
                  managementMembers:
                    - { role: VADOVAS, firstName: VARDENIS, lastName: PAVARDENIS, appointmentDate: '2019-03-29' }
                meta:
                  responseId: 3f6f2c9e-0000-4000-8000-000000000000
                  retrievedAt: '2026-08-11T12:00:00Z'
                  source: VĮ Registrų centras
                  product: JAR_ISPLESTINIS
                  target: '300000001'
                  disclaimer: >-
                    Real-time data relay by Tvarka, provided as a legal service by a Lithuanian
                    advokatas. Not an official document issued by VĮ Registrų centras.
            application/jose+json:
              schema: { $ref: '#/components/schemas/JadesJson' }
            application/vnd.etsi.asic-e+zip:
              schema: { $ref: '#/components/schemas/AsiceContainer' }
        '400': { $ref: '#/components/responses/BadRequest' }
        '401': { $ref: '#/components/responses/Unauthorized' }
        '402': { $ref: '#/components/responses/PaymentRequired' }
        '403': { $ref: '#/components/responses/Forbidden' }
        '404': { $ref: '#/components/responses/NotFound' }
        '429': { $ref: '#/components/responses/TooManyRequests' }
        '502': { $ref: '#/components/responses/UpstreamUnavailable' }

  /v1/entities/{code}/participants:
    get:
      tags: [entities]
      operationId: getEntityParticipants
      summary: Current participants (shareholders/members) from JADIS.
      description: Source product JADIS_DALYVIAI.
      parameters:
        - $ref: '#/components/parameters/EntityCode'
        - $ref: '#/components/parameters/Sign'
        - $ref: '#/components/parameters/Format'
      responses:
        '200':
          description: Participant list in the requested tier.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/ParticipantsResponse' }
            application/jose+json:
              schema: { $ref: '#/components/schemas/JadesJson' }
            application/vnd.etsi.asic-e+zip:
              schema: { $ref: '#/components/schemas/AsiceContainer' }
        '400': { $ref: '#/components/responses/BadRequest' }
        '401': { $ref: '#/components/responses/Unauthorized' }
        '402': { $ref: '#/components/responses/PaymentRequired' }
        '403': { $ref: '#/components/responses/Forbidden' }
        '404': { $ref: '#/components/responses/NotFound' }
        '429': { $ref: '#/components/responses/TooManyRequests' }
        '502': { $ref: '#/components/responses/UpstreamUnavailable' }

  /v1/entities/{code}/ubo:
    get:
      tags: [entities]
      operationId: getEntityUbo
      summary: Beneficial owners declared in JANGIS (legitimate-interest gated).
      description: >-
        Beneficial-owner declarations. Requires a `purpose` on every call; the standing legal basis
        is attested in the client's TPS. Source product JANGIS_NAUDOS_GAVEJAI.
      parameters:
        - $ref: '#/components/parameters/EntityCode'
        - $ref: '#/components/parameters/Purpose'
        - $ref: '#/components/parameters/PurposeNote'
        - $ref: '#/components/parameters/Sign'
        - $ref: '#/components/parameters/Format'
      responses:
        '200':
          description: Beneficial-owner declaration in the requested tier.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/UboResponse' }
            application/jose+json:
              schema: { $ref: '#/components/schemas/JadesJson' }
            application/vnd.etsi.asic-e+zip:
              schema: { $ref: '#/components/schemas/AsiceContainer' }
        '400': { $ref: '#/components/responses/BadRequest' }
        '401': { $ref: '#/components/responses/Unauthorized' }
        '402': { $ref: '#/components/responses/PaymentRequired' }
        '403': { $ref: '#/components/responses/Forbidden' }
        '404': { $ref: '#/components/responses/NotFound' }
        '429': { $ref: '#/components/responses/TooManyRequests' }
        '502': { $ref: '#/components/responses/UpstreamUnavailable' }

  /v1/entities/{code}/real-estate:
    get:
      tags: [real-estate]
      operationId: getEntityRealEstate
      summary: Real property held by the legal entity, with rights summary.
      description: >-
        Objects and rights registered to the legal entity in the Real Property Register.
        Legal-entity scope only; natural-person property searches are not offered.
        Source product NTR_JA_TURTAS.
      parameters:
        - $ref: '#/components/parameters/EntityCode'
        - $ref: '#/components/parameters/Sign'
        - $ref: '#/components/parameters/Format'
      responses:
        '200':
          description: Property list in the requested tier.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/EntityRealEstateResponse' }
            application/jose+json:
              schema: { $ref: '#/components/schemas/JadesJson' }
            application/vnd.etsi.asic-e+zip:
              schema: { $ref: '#/components/schemas/AsiceContainer' }
        '400': { $ref: '#/components/responses/BadRequest' }
        '401': { $ref: '#/components/responses/Unauthorized' }
        '402': { $ref: '#/components/responses/PaymentRequired' }
        '403': { $ref: '#/components/responses/Forbidden' }
        '404': { $ref: '#/components/responses/NotFound' }
        '429': { $ref: '#/components/responses/TooManyRequests' }
        '502': { $ref: '#/components/responses/UpstreamUnavailable' }

  /v1/real-estate/{uniqueNumber}:
    get:
      tags: [real-estate]
      operationId: getRealEstateObject
      summary: Full register extract for one property object, by unique number.
      description: >-
        Resolves the object and returns the full register extract (register data, objects, persons,
        rights, and the register's own labeled technical detail). Internally a two-step register
        chain; billed as one product. Source product NTR_OBJEKTAS.
      parameters:
        - $ref: '#/components/parameters/UniqueNumber'
        - $ref: '#/components/parameters/Sign'
        - $ref: '#/components/parameters/Format'
      responses:
        '200':
          description: Property extract in the requested tier.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/RealEstateObjectResponse' }
            application/jose+json:
              schema: { $ref: '#/components/schemas/JadesJson' }
            application/vnd.etsi.asic-e+zip:
              schema: { $ref: '#/components/schemas/AsiceContainer' }
        '400': { $ref: '#/components/responses/BadRequest' }
        '401': { $ref: '#/components/responses/Unauthorized' }
        '402': { $ref: '#/components/responses/PaymentRequired' }
        '403': { $ref: '#/components/responses/Forbidden' }
        '404': { $ref: '#/components/responses/NotFound' }
        '429': { $ref: '#/components/responses/TooManyRequests' }
        '502': { $ref: '#/components/responses/UpstreamUnavailable' }

  /v1/entities/{code}/cases:
    get:
      tags: [entities]
      operationId: getEntityCases
      summary: Court-case involvement from the LITEKO hearing calendar.
      description: >-
        Hearings and case participation where the entity appears as a party, from the LITEKO
        court-hearing calendar (weekly full refresh plus on-demand freshening). Field mapping is
        PRELIMINARY until the litigation model mapping is finalized.
      parameters:
        - $ref: '#/components/parameters/EntityCode'
        - $ref: '#/components/parameters/Sign'
        - $ref: '#/components/parameters/Format'
      responses:
        '200':
          description: Case involvement in the requested tier.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/CasesResponse' }
            application/jose+json:
              schema: { $ref: '#/components/schemas/JadesJson' }
            application/vnd.etsi.asic-e+zip:
              schema: { $ref: '#/components/schemas/AsiceContainer' }
        '400': { $ref: '#/components/responses/BadRequest' }
        '401': { $ref: '#/components/responses/Unauthorized' }
        '402': { $ref: '#/components/responses/PaymentRequired' }
        '403': { $ref: '#/components/responses/Forbidden' }
        '404': { $ref: '#/components/responses/NotFound' }
        '429': { $ref: '#/components/responses/TooManyRequests' }
        '502': { $ref: '#/components/responses/UpstreamUnavailable' }

  /v1/entities/{code}/seizures:
    get:
      tags: [entities]
      operationId: getEntitySeizures
      summary: Property seizure acts pertinent to the entity (Turto arešto aktų registras).
      description: >-
        Seizure acts where the entity appears, from the Property Seizure Acts Register administered
        by VĮ Registrų centras, with the parties and the seized assets recorded on each act.
        An entity with no acts is a clean record, not a no-data answer, and is answered and billed
        as such. Source product TAAR_ISRASAS.
      parameters:
        - $ref: '#/components/parameters/EntityCode'
        - $ref: '#/components/parameters/Sign'
        - $ref: '#/components/parameters/Format'
      responses:
        '200':
          description: Seizure-act list in the requested tier.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/SeizuresResponse' }
            application/jose+json:
              schema: { $ref: '#/components/schemas/JadesJson' }
            application/vnd.etsi.asic-e+zip:
              schema: { $ref: '#/components/schemas/AsiceContainer' }
        '400': { $ref: '#/components/responses/BadRequest' }
        '401': { $ref: '#/components/responses/Unauthorized' }
        '402': { $ref: '#/components/responses/PaymentRequired' }
        '403': { $ref: '#/components/responses/Forbidden' }
        '404': { $ref: '#/components/responses/NotFound' }
        '429': { $ref: '#/components/responses/TooManyRequests' }
        '502': { $ref: '#/components/responses/UpstreamUnavailable' }

  /v1/entities/{code}/dd-report:
    get:
      tags: [reports]
      operationId: getEntityDdReport
      summary: Composite due-diligence report - profile, participants, UBO, property, seizures, cases.
      description: >-
        One call, one billable bundle: entity profile, participants, beneficial owners, real
        property with rights, seizure acts, and case involvement. Requires `purpose` because the
        bundle contains beneficial-owner data.
      parameters:
        - $ref: '#/components/parameters/EntityCode'
        - $ref: '#/components/parameters/Purpose'
        - $ref: '#/components/parameters/PurposeNote'
        - $ref: '#/components/parameters/Sign'
        - $ref: '#/components/parameters/Format'
      responses:
        '200':
          description: Composite report in the requested tier.
          content:
            application/json:
              schema: { $ref: '#/components/schemas/DdReportResponse' }
            application/jose+json:
              schema: { $ref: '#/components/schemas/JadesJson' }
            application/vnd.etsi.asic-e+zip:
              schema: { $ref: '#/components/schemas/AsiceContainer' }
        '400': { $ref: '#/components/responses/BadRequest' }
        '401': { $ref: '#/components/responses/Unauthorized' }
        '402': { $ref: '#/components/responses/PaymentRequired' }
        '403': { $ref: '#/components/responses/Forbidden' }
        '404': { $ref: '#/components/responses/NotFound' }
        '429': { $ref: '#/components/responses/TooManyRequests' }
        '502': { $ref: '#/components/responses/UpstreamUnavailable' }

components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        Per-client API key, issued after TPS signature (production) or docs-page review (sandbox).
        Send as `Authorization: Bearer <key>`.

  parameters:
    EntityCode:
      name: code
      in: path
      required: true
      description: Lithuanian legal-entity code (JAR kodas).
      schema: { type: string, pattern: '^[0-9]{7,9}$' }
    UniqueNumber:
      name: uniqueNumber
      in: path
      required: true
      description: Real Property Register unique object number (unikalus numeris), e.g. 4400-2038-0234.
      schema: { type: string, minLength: 9, maxLength: 20 }
    Sign:
      name: sign
      in: query
      required: false
      description: >-
        Signature tier for the JSON envelope. `jades-t` adds a qualified signature and qualified
        timestamp; `jades-lt` additionally embeds revocation material for long-term validation.
        Mutually exclusive with `format=asice`.
      schema: { type: string, enum: [none, jades-t, jades-lt], default: none }
    Format:
      name: format
      in: query
      required: false
      description: >-
        `asice` returns the evidence container (normalized JSON + raw register XML + qualified
        LT-level signature) instead of a JSON body. Mutually exclusive with `sign`.
      schema: { type: string, enum: [json, asice], default: json }
    Purpose:
      name: purpose
      in: query
      required: true
      description: Purpose of processing for this call; logged. The standing basis is attested in the TPS.
      schema:
        type: string
        enum: [AML_KYC, BUSINESS_RELATIONSHIP_DD, TRANSACTION_DD, LEGAL_CLAIM, OTHER]
    PurposeNote:
      name: purposeNote
      in: query
      required: false
      description: Free-text clarification, expected when purpose is OTHER.
      schema: { type: string, maxLength: 500 }

  responses:
    BadRequest:
      description: Validation problem (bad code format, conflicting sign/format, missing purpose).
      content:
        application/problem+json:
          schema: { $ref: '#/components/schemas/Problem' }
    Unauthorized:
      description: Missing or unknown API key.
      content:
        application/problem+json:
          schema: { $ref: '#/components/schemas/Problem' }
    PaymentRequired:
      description: Key suspended for billing reasons.
      content:
        application/problem+json:
          schema: { $ref: '#/components/schemas/Problem' }
    Forbidden:
      description: >-
        Production access is not (yet) open for this client. The problem type says which
        precondition is missing: `/tps-required` when the engagement agreement is not signed,
        `/terms-acceptance-required` when the Terms of Service have not been accepted. Also
        returned when the key's scope does not cover this product or data category.
      content:
        application/problem+json:
          schema: { $ref: '#/components/schemas/Problem' }
    NotFound:
      description: >-
        Unknown entity or the register returned no data (problem type ends `/no-data`). Not billed.
      content:
        application/problem+json:
          schema: { $ref: '#/components/schemas/Problem' }
    TooManyRequests:
      description: Per-key rate limit exceeded.
      content:
        application/problem+json:
          schema: { $ref: '#/components/schemas/Problem' }
    UpstreamUnavailable:
      description: The source register did not answer. Not billed.
      content:
        application/problem+json:
          schema: { $ref: '#/components/schemas/Problem' }

  schemas:
    Problem:
      type: object
      description: RFC 9457 problem details.
      required: [type, title, status]
      properties:
        type: { type: string, format: uri }
        title: { type: string }
        status: { type: integer }
        detail: { type: string }
        instance: { type: string }

    Meta:
      type: object
      required: [responseId, retrievedAt, source, product, target, disclaimer]
      properties:
        responseId: { type: string, format: uuid }
        retrievedAt: { type: string, format: date-time }
        source:
          type: string
          description: >-
            The source register(s) behind this answer, e.g. "VĮ Registrų centras", "LITEKO", or both
            for the composite report. Sandbox responses read "Sandbox (synthetic data)" so synthetic
            data can never be mistaken for a register answer.
        product:
          type: string
          description: Internal product code, e.g. JAR_ISPLESTINIS, JADIS_DALYVIAI, JANGIS_NAUDOS_GAVEJAI, NTR_JA_TURTAS, NTR_OBJEKTAS, TAAR_ISRASAS, BYLOS, DD_REPORT.
        target: { type: string, description: The queried identifier. }
        signature:
          type: object
          description: Present on signed tiers.
          properties:
            level: { type: string, enum: [jades-t, jades-lt, asice-lt] }
            signedAt: { type: string, format: date-time }
            signatory: { type: string, description: Name of the signing advokatas. }
        disclaimer:
          type: string
          description: >-
            Fixed wording: a real-time data relay provided as a legal service by a Lithuanian
            advokatas, and not an official document issued by VĮ Registrų centras.

    JadesJson:
      type: object
      description: >-
        JAdES flattened JWS JSON serialization (ETSI TS 119 182-1). The `payload` is the same JSON
        envelope served by the plain tier, byte-for-byte. Flattened JSON rather than compact because
        every level we ship carries unsigned properties (`etsiU`), which a compact JWS cannot hold.
        Verify with the EU DSS library; note that the signature is computed over the SHA-256 of the
        JWS signing input, so verification must treat it as prehashed.
      required: [payload, protected, signature]
      properties:
        payload: { type: string, description: base64url of the response envelope. }
        protected:
          type: string
          description: >-
            base64url of the signed header (alg RS256, x5c chain, x5t#S256, and the critical `sigT`
            claimed signing time).
        header:
          type: object
          description: Unsigned properties.
          properties:
            etsiU:
              type: array
              description: >-
                base64url-encoded JAdES unsigned components, in order: `sigTst` (the qualified
                signature timestamp) always; for the LT level also `xVals` (certificate chain) and
                `rVals` (OCSP revocation values, fetched after the timestamp).
              items: { type: string }
        signature: { type: string, description: base64url of the RSA signature value. }

    AsiceContainer:
      type: string
      format: binary
      description: >-
        ASiC-E evidence container. payload.json (normalized envelope), source.xml (raw register
        response), and the qualified LT-level signature with qualified timestamp.

    LegalForm:
      type: object
      properties:
        code: { type: string }
        name: { type: string }

    EntityStatus:
      type: object
      properties:
        code: { type: string }
        name: { type: string }

    ManagementMember:
      type: object
      properties:
        role: { type: string, description: Registry role code, e.g. VADOVAS. }
        firstName: { type: string }
        lastName: { type: string }
        appointmentDate: { type: string, format: date }
        personalCode:
          type: string
          description: >-
            Personal code (asmens kodas), returned on production keys. Processing basis is the
            client's TPS; UBO and dd-report calls additionally log the declared purpose.

    EntityProfile:
      type: object
      required: [code, name]
      properties:
        code: { type: string }
        name: { type: string }
        legalForm: { $ref: '#/components/schemas/LegalForm' }
        status: { $ref: '#/components/schemas/EntityStatus' }
        registeredAddress: { type: string }
        registrationDate: { type: string, format: date }
        deregistrationDate:
          type: [string, 'null']
          format: date
        capital:
          type: object
          properties:
            amount: { type: number }
            currency: { type: string }
        activities:
          type: array
          items: { type: string }
        euid:
          type: [string, 'null']
          description: European Unique Identifier as used in BRIS, when derivable.
        lei:
          type: [string, 'null']
          description: Legal Entity Identifier, when one exists.
        managementMembers:
          type: array
          items: { $ref: '#/components/schemas/ManagementMember' }

    EntityProfileResponse:
      type: object
      required: [data, meta]
      properties:
        data: { $ref: '#/components/schemas/EntityProfile' }
        meta: { $ref: '#/components/schemas/Meta' }

    Participant:
      type: object
      properties:
        personType: { type: string, enum: [natural, legal] }
        firstName: { type: string }
        lastName: { type: string }
        personalCode: { type: string, description: Personal code of a natural-person participant, returned on production keys. }
        legalName: { type: string, description: Set when personType is legal. }
        legalCode: { type: string, description: Set when personType is legal. }
        shareCount: { type: number }
        nominalValue: { type: number }
        acquisitionDate: { type: string, format: date }

    ParticipantsData:
      type: object
      required: [code]
      properties:
        code: { type: string }
        name: { type: string }
        filingDate: { type: string, format: date }
        status: { type: string }
        participants:
          type: array
          items: { $ref: '#/components/schemas/Participant' }

    ParticipantsResponse:
      type: object
      required: [data, meta]
      properties:
        data: { $ref: '#/components/schemas/ParticipantsData' }
        meta: { $ref: '#/components/schemas/Meta' }

    UboBeneficiary:
      type: object
      properties:
        firstName: { type: string }
        lastName: { type: string }
        personalCode: { type: string, description: Personal code, returned on production keys. }
        birthDate: { type: string, format: date }
        citizenship: { type: string }
        residenceCountry: { type: string }
        ownershipPct: { type: number }
        indirectOwnershipPct: { type: number }
        controlBasis: { type: string }
        declarationDate: { type: string, format: date }
        roleNames:
          type: array
          items: { type: string }

    UboData:
      type: object
      required: [code]
      properties:
        code: { type: string }
        name: { type: string }
        beneficiaries:
          type: array
          items: { $ref: '#/components/schemas/UboBeneficiary' }

    UboResponse:
      type: object
      required: [data, meta]
      properties:
        data: { $ref: '#/components/schemas/UboData' }
        meta: { $ref: '#/components/schemas/Meta' }

    RealEstateItem:
      type: object
      properties:
        uniqueNumber: { type: string }
        type: { type: string }
        name: { type: string }
        address: { type: string }
        registerNo: { type: string }
        rights:
          type: array
          items: { type: string }

    EntityRealEstateData:
      type: object
      required: [code]
      properties:
        code: { type: string }
        objects:
          type: array
          items: { $ref: '#/components/schemas/RealEstateItem' }

    EntityRealEstateResponse:
      type: object
      required: [data, meta]
      properties:
        data: { $ref: '#/components/schemas/EntityRealEstateData' }
        meta: { $ref: '#/components/schemas/Meta' }

    LabeledValue:
      type: object
      properties:
        label: { type: string }
        value: { type: string }

    RealEstateObjectData:
      type: object
      required: [uniqueNumber]
      properties:
        uniqueNumber: { type: string }
        name: { type: string }
        address: { type: string }
        sections:
          type: array
          description: The register's own labeled technical detail for the object, preserved as returned.
          items: { $ref: '#/components/schemas/LabeledValue' }

    RealEstateObjectResponse:
      type: object
      required: [data, meta]
      properties:
        data: { $ref: '#/components/schemas/RealEstateObjectData' }
        meta: { $ref: '#/components/schemas/Meta' }

    CaseItem:
      type: object
      description: PRELIMINARY mapping from the LITEKO hearing calendar.
      properties:
        caseNumber: { type: string }
        court: { type: string }
        hearingDate: { type: string, format: date-time }
        partyRole: { type: string }
        status: { type: string }

    CasesData:
      type: object
      required: [code]
      properties:
        code: { type: string }
        cases:
          type: array
          items: { $ref: '#/components/schemas/CaseItem' }

    CasesResponse:
      type: object
      required: [data, meta]
      properties:
        data: { $ref: '#/components/schemas/CasesData' }
        meta: { $ref: '#/components/schemas/Meta' }

    SeizureActParty:
      type: object
      properties:
        role: { type: string, enum: [DEBTOR, CREDITOR], description: Which side of the act this party is on. }
        isLegalPerson: { type: boolean }
        code: { type: string }
        name: { type: string }

    SeizureActOwner:
      type: object
      properties:
        role: { type: string, enum: [OWNER, CUSTODIAN] }
        name: { type: string }
        code: { type: string }
        ownedPart: { type: string, description: 'Share of the asset, e.g. 1/1.' }

    SeizureActAsset:
      type: object
      properties:
        typeCode:
          type: string
          description: >-
            Register's asset-type code. Passed through as a code because the register publishes no
            label set for it; inventing names would mean guessing.
        details:
          type: array
          description: >-
            The register returns asset attributes positionally, and their meaning depends on the
            asset type (for a vehicle: make and model, VIN, registration plate). They are published
            in the order given rather than under invented field names.
          items: { type: string }
        arrestTerm: { type: string }
        owners:
          type: array
          items: { $ref: '#/components/schemas/SeizureActOwner' }

    SeizureAct:
      type: object
      properties:
        actNumber: { type: string }
        actName: { type: string, description: 'Act title as registered, usually including the enforcement case number.' }
        actTypeCode: { type: string, description: Register code; no published label set. }
        statusCode: { type: string, description: Register code; no published label set. }
        registeredAt: { type: string }
        issuedAt: { type: string }
        issuingAuthority: { type: string, description: 'The institution that imposed the seizure, typically a bailiff.' }
        issuingOfficer: { type: string }
        legalBasis: { type: string, description: 'The court order or other instrument the seizure rests on.' }
        amount: { type: string, description: 'Secured amount as recorded, e.g. "28149,31 Eur".' }
        restriction: { type: string, description: 'Restriction imposed, e.g. "Apribotas disponavimas".' }
        priority: { type: string, description: 'Creditor priority queue, e.g. "III eilė".' }
        parties:
          type: array
          items: { $ref: '#/components/schemas/SeizureActParty' }
        assets:
          type: array
          items: { $ref: '#/components/schemas/SeizureActAsset' }

    SeizuresData:
      type: object
      required: [code]
      properties:
        code: { type: string }
        acts:
          type: array
          items: { $ref: '#/components/schemas/SeizureAct' }

    SeizuresResponse:
      type: object
      required: [data, meta]
      properties:
        data: { $ref: '#/components/schemas/SeizuresData' }
        meta: { $ref: '#/components/schemas/Meta' }

    DdReportData:
      type: object
      required: [profile]
      properties:
        profile: { $ref: '#/components/schemas/EntityProfile' }
        participants: { $ref: '#/components/schemas/ParticipantsData' }
        ubo: { $ref: '#/components/schemas/UboData' }
        realEstate: { $ref: '#/components/schemas/EntityRealEstateData' }
        seizures: { $ref: '#/components/schemas/SeizuresData' }
        # cases below

        cases: { $ref: '#/components/schemas/CasesData' }

    DdReportResponse:
      type: object
      required: [data, meta]
      properties:
        data: { $ref: '#/components/schemas/DdReportData' }
        meta: { $ref: '#/components/schemas/Meta' }
