---
id: TST-ACC-REC-059
title: Exclusive whole-item allocations
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/reconciliation-allocations.integration.spec.js
implements:
  - ATS-ACC-REC-009-01
  - ATS-ACC-REC-009-04
  - ATS-ACC-REC-009-05
  - ATS-ACC-REC-009-06
  - ATS-ACC-REC-009-07
  - ATS-ACC-REC-010-01
  - ATS-ACC-REC-010-03
  - ATS-ACC-REC-010-04
  - ATS-ACC-REC-010-06
  - ATS-ACC-REC-010-08
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/reconciliation-allocations.integration.spec.js
bindings:
  - scenario: ATS-ACC-REC-009-01
    assertions:
      - >-
        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
  - scenario: ATS-ACC-REC-009-04
    assertions:
      - >-
        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
  - scenario: ATS-ACC-REC-009-05
    assertions:
      - >-
        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
  - scenario: ATS-ACC-REC-009-06
    assertions:
      - >-
        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
  - scenario: ATS-ACC-REC-009-07
    assertions:
      - >-
        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
  - scenario: ATS-ACC-REC-010-01
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
        a manual item without a note or evidence, of a kind not entered by hand, and of the wrong sign, all at
        once
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
        a capture entered by hand with 400
  - scenario: ATS-ACC-REC-010-03
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
        an adjustment without a GL account, or with another unit’s, with 400
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#enters
        an adjustment booked to a GL account of the unit
  - scenario: ATS-ACC-REC-010-04
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#writes
        the fee as a manual item of the batch, claimed by it
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#counts
        the manual item and its claim in the batch, one version on
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#records
        batch.manual-item-added with the item and its idempotency key
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#answers
        a repeat of the same key and body with the first answer, entering nothing more
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
        the same key with another body with 409 idempotency-key-reused
  - scenario: ATS-ACC-REC-010-06
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#takes
        it out of the batch’s items and totals, one version on, keeping the count of items entered
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#resolves
        the item withdrawn, naming the batch
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#refuses
        to remove it again with 404
  - scenario: ATS-ACC-REC-010-08
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/services/persistence/reconciliation-allocations.integration.spec.js#balances
        the negative payout with the two manual items
---

# Exclusive whole-item allocations

## 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.
