---
id: TST-ACC-REC-071
title: Settlement financial identity and resolution
kind: integration
product_area: accounting
module: reconciliation
revision: 1
status: draft
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js
implements:
  - ATS-ACC-REC-007-01
  - ATS-ACC-REC-007-02
  - ATS-ACC-REC-007-03
  - ATS-ACC-REC-007-04
  - ATS-ACC-REC-007-05
  - ATS-ACC-REC-007-06
  - ATS-ACC-REC-007-07
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 5
isolation: Suite-owned workspace fixtures and deterministic records removed by suite cleanup.
evidence:
  - >-
    services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js
  - 'Declared test doubles: Doubled: the clock (`TEST_CLOCK`, 2026-10-07T12:00:00Z, a Wednesday in New York).'
bindings:
  - scenario: ATS-ACC-REC-007-01
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#refuses
        parts that do not total the item (400, `split_parts_total`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#refuses
        a part of the other sign (400, `split_part_sign`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#refuses
        a single part (400, `split_parts_count`)
  - scenario: ATS-ACC-REC-007-02
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#refuses
        an item a reconciliation claims, naming it (409, `item_claimed`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#refuses
        a resolved item (409, `item_resolved`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#refuses
        an item a reconciliation claims (409, `item_claimed`)
  - scenario: ATS-ACC-REC-007-03
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#resolves
        the parent `split`, by the caller, at the next version
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#writes
        parts that inherit every fact of the parent, with their own amounts, parent and source keys
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#gives
        each part the parent’s evidence files
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#clears
        the parent’s open overdue-settlement exception
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#records
        `item.split` with the parts and the versions
  - scenario: ATS-ACC-REC-007-04
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#writes
        off an item with its entry: Dr the write-off account, Cr the merchant clearing account, in the unit’s
        batch on its date
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#mirrors
        the entry of a negative item: Dr the clearing account, Cr the write-off account
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#dates
        the request on the November batch’s date, the resolution date its document date
  - scenario: ATS-ACC-REC-007-05
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#refuses
        a write-off where the unit has no write-off account (409, `write_off_account_missing`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#leaves
        the item unresolved when its write-off is refused (the transaction rolled back)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#refuses
        a write-off where the unit has no batch for its request (400, `no_open_batch`)
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#leaves
        the item unresolved, and asks for nothing, when refused for want of a batch
  - scenario: ATS-ACC-REC-007-06
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#resolves
        an item otherwise, asking the ledger for nothing
  - scenario: ATS-ACC-REC-007-07
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/settlement-items.integration.spec.js#keys
        a request per operation: the same key on a split is a request of its own
---

# Settlement financial identity and resolution

## Verification Boundary

This suite calls production services over the real test database. Fixture setup may write records directly; the exercised commands and queries retain their normal database enforcement.

## What This Suite Proves

The executable assertions identified in the binding records supply the registered scenario observations. When a scenario names several suites, this suite supplies its listed assertions and does not independently establish every clause.

## What It Does Not Prove

Deployed infrastructure, live console behavior and shared scheduling delivery are outside this local boundary.

## Real Dependencies and Test Doubles

PostgreSQL, migrations and the exercised production code are real. Fixtures supply the financial world and caller context; deterministic setup and owner-side inspection do not replace database enforcement.

## Must Not Be Doubled

The exercised database constraints, transactional services and route enforcement remain real. Replacing them would remove the boundary this suite registers.
