---
id: ATS-ACC-REC-009
scope: CAP-ACC-REC-009
product_area: accounting
module: reconciliation
revision: 3
status: proposed
approved_by: null
approved_at: null
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
scenarios:
  - id: ATS-ACC-REC-009-01
    title: All invalid claim items reported
    level: api
    proves:
      - BR-CAP-ACC-REC-009-01
    preconditions: 'Items are ineligible, resolved, incompatible and already claimed here.'
    steps: Claim them together and separately try five hundred and one references.
    expected: One response lists all item problems; oversized input fails and nothing is claimed.
    negative: true
    data_needs: Provide allocation fixture for this case.
    bound_to:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
        every problem at once with 400, naming each item
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
        an item already claimed in this batch with 400
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
        more than 500 items with 400
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#writes
        no claim after the refusals
      - TST-ACC-REC-059
    provenance: test
    source: >-
      services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
      every problem at once with 400, naming each item
    category: validation
  - id: ATS-ACC-REC-009-02
    title: One active claim under competition
    level: api
    proves:
      - BR-CAP-ACC-REC-009-02
    preconditions: Items are held by draft or finalized reconciliations and two drafts compete for a free one.
    steps: Try held claims and simultaneous claims of the free item.
    expected: 'Existing holdings prevent another claim, and concurrency leaves one winning active claim.'
    negative: true
    data_needs: Provide Two preparers for this case.
    bound_to:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/reconciliation-batches/claim-concurrency.integration.spec.js#lets
        the first claim succeed
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/reconciliation-batches/claim-concurrency.integration.spec.js#refuses
        the second with 409 item_held naming the first batch and its preparer
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/reconciliation-batches/claim-concurrency.integration.spec.js#leaves
        exactly one active claim of the item
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/reconciliation-allocations.table.integration.spec.js#refuses
        a second draft’s claim of an item another draft holds
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/reconciliation-allocations.table.integration.spec.js#refuses
        a draft’s claim of an item a finalized batch holds
      - >-
        services-accounting:modules/reconciliation/tests/e2e/reconciliation-matching.e2e.spec.js#refuses a
        claim of an item another batch holds with 409 item_held, naming that batch and its preparer
      - TST-ACC-REC-075
      - TST-ACC-REC-034
      - TST-ACC-REC-027
    provenance: test
    source: >-
      services-accounting:modules/reconciliation/tests/integration/services/reconciliation-batches/claim-concurrency.integration.spec.js#lets
      the first claim succeed
    category: concurrency
  - id: ATS-ACC-REC-009-03
    title: Calculated status and difference
    level: api
    proves:
      - BR-CAP-ACC-REC-009-03
    preconditions: 'Drafts have zero claims, partial claims and balancing claims.'
    steps: Derive display status and inspect stored generated differences.
    expected: 'Draft, In Progress and Balanced follow claim count and exact claimed-minus-payout money.'
    negative: false
    data_needs: No additional fixture beyond the case setup.
    bound_to:
      - >-
        services-accounting:modules/reconciliation/tests/unit/rules/batch-status.spec.js#is a draft with
        nothing claimed, whatever its difference
      - >-
        services-accounting:modules/reconciliation/tests/unit/rules/batch-status.spec.js#is in progress with a
        claim and a difference short of zero
      - >-
        services-accounting:modules/reconciliation/tests/unit/rules/batch-status.spec.js#is balanced with a
        claim and a difference of exactly zero
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/reconciliation-batches.table.integration.spec.js#generates
        the difference as claimed items less payouts, the brief’s sign
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/reconciliation-batches/brief-example.integration.spec.js#is
        in progress once the 42 captures and the refund are claimed, 27500 over the payout
      - TST-ACC-REC-083
      - TST-ACC-REC-036
      - TST-ACC-REC-074
    provenance: test
    source: >-
      services-accounting:modules/reconciliation/tests/unit/rules/batch-status.spec.js#is a draft with nothing
      claimed, whatever its difference
    category: rule
  - id: ATS-ACC-REC-009-04
    title: Claims retain why and who
    level: api
    proves:
      - BR-CAP-ACC-REC-009-04
    preconditions: An open draft has two candidates.
    steps: Claim both and inspect allocation and audit data.
    expected: 'Ranks, explanations, original batch and claimant persist, with totals and version advancing once.'
    negative: false
    data_needs: No additional fixture beyond the case setup.
    bound_to:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#balances
        the batch with the two claims, one version on
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#stores
        the tier and the reasons the ranking gives each claim, and its operational batch
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#records
        batch.items-claimed with the ids, the amount and the versions
      - >-
        services-accounting:modules/reconciliation/tests/e2e/reconciliation-matching.e2e.spec.js#stores each
        claim with its tier, its explanation, its operational batch and who claimed it
      - TST-ACC-REC-059
      - TST-ACC-REC-027
    provenance: test
    source: >-
      services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#balances
      the batch with the two claims, one version on
    category: transition
  - id: ATS-ACC-REC-009-05
    title: Release history and reclaim
    level: api
    proves:
      - BR-CAP-ACC-REC-009-05
    preconditions: The draft holds a matched item and a manual entry.
    steps: 'Release with a reason, reclaim the matched item and try releasing the manual entry.'
    expected: Release preserves history and frees the matched item; manual entries require removal instead.
    negative: false
    data_needs: No additional fixture beyond the case setup.
    bound_to:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#takes
        the released claim out of the totals, one version on
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#keeps
        the released claim as history, with its time, actor and reason
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#lets
        the released item be claimed again
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
        to release an item the batch does not claim with 400
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
        to release a manual item as a claim with 400
      - TST-ACC-REC-059
    provenance: test
    source: >-
      services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#takes
      the released claim out of the totals, one version on
    category: transition
  - id: ATS-ACC-REC-009-06
    title: Authoritative acceptance is repeat-safe
    level: api
    proves:
      - BR-CAP-ACC-REC-009-06
    preconditions: Candidates span authoritative and correlation or weak ranks.
    steps: Accept authoritative matches twice.
    expected: Only eligible authoritative candidates are claimed; the repeat adds nothing or changes no version.
    negative: false
    data_needs: No additional fixture beyond the case setup.
    bound_to:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#claims
        the tier 1 and tier 3 candidates and nothing else
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#changes
        the totals and the version in the same command
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#claims
        nothing more when accepted again, leaving the version as it was
      - TST-ACC-REC-059
    provenance: test
    source: >-
      services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#claims
      the tier 1 and tier 3 candidates and nothing else
    category: edge
  - id: ATS-ACC-REC-009-07
    title: Open state and current version guard claims
    level: api
    proves:
      - BR-CAP-ACC-REC-009-07
    preconditions: Open and finalized examples exist.
    steps: 'Claim with a stale version, claim into finalized state and release a finalized claim.'
    expected: All guarded changes are refused.
    negative: true
    data_needs: No additional fixture beyond the case setup.
    bound_to:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
        a claim at a version that is not the batch’s with 409 StaleObject
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
        a claim in a batch that is not open with 409 batch-not-open
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/reconciliation-allocations.table.integration.spec.js#refuses
        a claim into a finalized batch
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/reconciliation-allocations.table.integration.spec.js#refuses
        the release of a finalized batch’s claim
      - >-
        services-accounting:modules/reconciliation/tests/e2e/reconciliation-matching.e2e.spec.js#refuses a
        claim at a version already moved on with 409
      - TST-ACC-REC-059
      - TST-ACC-REC-034
      - TST-ACC-REC-027
    provenance: test
    source: >-
      services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
      a claim at a version that is not the batch’s with 409 StaleObject
    category: validation
  - id: ATS-ACC-REC-009-08
    title: Whole-item context and capacity
    level: api
    proves:
      - BR-CAP-ACC-REC-009-08
      - BR-CAP-ACC-REC-009-09
    preconditions: Incompatible items and a draft at its claim limit are available.
    steps: 'Try cross-context, partial and over-limit claims.'
    expected: Database enforcement rejects every incompatible or excessive allocation.
    negative: true
    data_needs: No additional fixture beyond the case setup.
    bound_to:
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/reconciliation-allocations.table.integration.spec.js#refuses
        an item of another merchant account and currency
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/reconciliation-allocations.table.integration.spec.js#refuses
        an item of another business unit
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/reconciliation-allocations.table.integration.spec.js#refuses
        a claim of part of an item (RHF35)
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/reconciliation-batches.table.integration.spec.js#refuses
        a 10,001st claim
      - TST-ACC-REC-034
      - TST-ACC-REC-036
    provenance: test
    source: >-
      services-accounting:modules/reconciliation/tests/integration/db/reconciliation-allocations.table.integration.spec.js#refuses
      an item of another merchant account and currency
    category: boundary
  - id: ATS-ACC-REC-009-09
    title: Claiming requires update
    level: api
    proves:
      - BR-CAP-ACC-REC-009-10
    preconditions: A caller can read but cannot update.
    steps: Submit a claim as that caller.
    expected: The command is forbidden.
    negative: true
    data_needs: Use a caller whose role grants inspection only.
    bound_to:
      - >-
        services-accounting:modules/reconciliation/tests/e2e/reconciliation-matching.e2e.spec.js#refuses the
        reader a claim with 403
      - TST-ACC-REC-027
    provenance: test
    source: >-
      services-accounting:modules/reconciliation/tests/e2e/reconciliation-matching.e2e.spec.js#refuses the
      reader a claim with 403
    category: permission
  - id: ATS-ACC-REC-009-10
    title: Competing edits on one draft
    level: api
    proves:
      - AS-JNY-ACC-REC-001-02
    preconditions: Two preparers hold the same draft version.
    steps: >-
      Submit competing claims at one draft version, then race a payout amount replacement with release of a
      claim.
    expected: >-
      One competing claim is stale; the payout edit succeeds and the release either succeeds first or is
      stale, with totals agreeing with retained holdings.
    negative: true
    data_needs: Use the isolated reconciliation fixture unit.
    bound_to:
      - >-
        react-console:acceptance/accounting/playwright/journeys/reconciliation-close/ACT-ACC-0598.spec.ts#ACT-ACC-0598
      - TST-ACC-REC-008
    provenance: test
    source: >-
      react-console:acceptance/accounting/playwright/journeys/reconciliation-close/ACT-ACC-0598.spec.ts#ACT-ACC-0598
    category: concurrency
  - id: ATS-ACC-REC-009-11
    title: Manual removal changes allocation totals
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-REC-009-03
      - BR-CAP-ACC-REC-010-07
    interacts_with:
      - CAP-ACC-REC-010
    relies_on:
      - ATS-ACC-REC-009-03
      - ATS-ACC-REC-010-06
    preconditions: Use one isolated workspace with the financial records and caller roles required by the relied-on cases.
    steps:
      - do: 'Claim captures, add a fee and remove that fee at the current draft version.'
        expect: 'The fee is withdrawn, matched claims remain and the difference changes by the removed amount.'
        provenance: proposed
        source:
          - >-
            specs/accounting/reconciliation/planning/capabilities/CAP-ACC-REC-009-claim-what-a-deposit-paid-out-without-two-people-claiming.md
          - >-
            specs/accounting/reconciliation/planning/capabilities/CAP-ACC-REC-010-enter-the-fees-reserves-and-corrections-the-processor-took.md
    expected: 'The fee is withdrawn, matched claims remain and the difference changes by the removed amount.'
    negative: false
    data_needs: >-
      Local merchant and bank accounts, an open operational batch and distinct preparation and approval
      callers.
    bound_to: []
    provenance: proposed
    source:
      - >-
        specs/accounting/reconciliation/planning/capabilities/CAP-ACC-REC-009-claim-what-a-deposit-paid-out-without-two-people-claiming.md
      - >-
        specs/accounting/reconciliation/planning/capabilities/CAP-ACC-REC-010-enter-the-fees-reserves-and-corrections-the-processor-took.md
  - id: ATS-ACC-REC-009-12
    title: Allocation balance gates approval
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-REC-009-03
      - BR-CAP-ACC-REC-011-03
      - BR-CAP-ACC-REC-011-06
      - AS-JNY-ACC-REC-001-03
    interacts_with:
      - CAP-ACC-REC-011
    relies_on:
      - ATS-ACC-REC-009-03
      - ATS-ACC-REC-011-11
    preconditions: Use one isolated workspace with the financial records and caller roles required by the relied-on cases.
    steps:
      - do: 'Claim a partial explanation, try approval, claim the remaining money and approve independently.'
        expect: The incomplete attempt remains open; the completed explanation finalizes with holdings sealed.
        provenance: proposed
        source:
          - >-
            specs/accounting/reconciliation/planning/capabilities/CAP-ACC-REC-009-claim-what-a-deposit-paid-out-without-two-people-claiming.md
          - >-
            specs/accounting/reconciliation/planning/capabilities/CAP-ACC-REC-011-approve-a-balanced-reconciliation-and-move-the-deposit-to.md
    expected: The incomplete attempt remains open; the completed explanation finalizes with holdings sealed.
    negative: false
    data_needs: >-
      Local merchant and bank accounts, an open operational batch and distinct preparation and approval
      callers.
    bound_to: []
    provenance: proposed
    source:
      - >-
        specs/accounting/reconciliation/planning/capabilities/CAP-ACC-REC-009-claim-what-a-deposit-paid-out-without-two-people-claiming.md
      - >-
        specs/accounting/reconciliation/planning/capabilities/CAP-ACC-REC-011-approve-a-balanced-reconciliation-and-move-the-deposit-to.md
evidence:
  - >-
    Bindings identify existing tests at the pinned revisions; proposed cases remain unbound and describe the
    proof still needed.
coverage:
  rule: covered
  transition: covered
  validation: covered
  permission: covered
  edge: covered
  boundary: covered
  concurrency: covered
  interaction: covered
  failure: 'gap: FND-ACC-REC-054'
  invariant: 'gap: FND-ACC-REC-054'
coverage_notes:
  design_completeness: >-
    Covered categories count specified cases, including proposed cases. Exhaustive state-transition,
    permission-key and domain-invariant traceability remains a separate proof gap.
---

# Allocate settlement money to one explanation: Capability Test Specification

## Coverage

| Rule | Proved by |
|---|---|
| `BR-CAP-ACC-REC-009-01` | `ATS-ACC-REC-009-01` |
| `BR-CAP-ACC-REC-009-02` | `ATS-ACC-REC-009-02` |
| `BR-CAP-ACC-REC-009-03` | `ATS-ACC-REC-009-03` |
| `BR-CAP-ACC-REC-009-04` | `ATS-ACC-REC-009-04` |
| `BR-CAP-ACC-REC-009-05` | `ATS-ACC-REC-009-05` |
| `BR-CAP-ACC-REC-009-06` | `ATS-ACC-REC-009-06` |
| `BR-CAP-ACC-REC-009-07` | `ATS-ACC-REC-009-07` |
| `BR-CAP-ACC-REC-009-08` | `ATS-ACC-REC-009-08` |
| `BR-CAP-ACC-REC-009-09` | `ATS-ACC-REC-009-08` |
| `BR-CAP-ACC-REC-009-10` | `ATS-ACC-REC-009-09` |

## Interactions With Related Capabilities

Manual removal changes allocation totals. Allocation balance gates approval. Proposed interaction cases require executable proof.
