---
id: TST-ACC-REC-033
title: Payout management constraints
kind: integration
product_area: accounting
module: reconciliation
revision: 1
status: draft
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js
implements:
  - ATS-ACC-REC-001-01
  - ATS-ACC-REC-001-02
  - ATS-ACC-REC-001-03
  - ATS-ACC-REC-002-03
  - ATS-ACC-REC-002-07
  - ATS-ACC-REC-003-02
  - ATS-ACC-REC-020-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/db/payouts.table.integration.spec.js'
bindings:
  - scenario: ATS-ACC-REC-001-01
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#stores
        a zero payout
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#stores
        a negative payout, a debit of the bank account
  - scenario: ATS-ACC-REC-001-02
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#refuses
        a merchant account in another currency
  - scenario: ATS-ACC-REC-001-03
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#allows
        the same reference on another merchant account
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#allows
        the reference again once the payout holding it is voided
  - scenario: ATS-ACC-REC-002-03
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#refuses
        a change to the amount of a payout in a finalized batch (INV-09)
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#refuses
        a change to the accounting date of a payout in a finalized batch
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#lets
        a payout in a finalized batch take a note
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#refuses
        a change to the currency (write-once)
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#refuses
        a change to the origin (write-once)
  - scenario: ATS-ACC-REC-002-07
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#refuses
        the application role a delete (no DELETE privilege)
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#refuses
        the owner a delete outside a tenant purge
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#lets
        the owner delete inside a tenant purge
  - scenario: ATS-ACC-REC-003-02
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#refuses
        a verified payout without who verified it and when
  - scenario: ATS-ACC-REC-020-07
    assertions:
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#hides
        them from another tenant
      - >-
        services-accounting:modules/reconciliation/tests/integration/db/payouts.table.integration.spec.js#refuses
        a row written for another tenant
---

# Payout management constraints

## Verification Boundary

This suite exercises record constraints and database security using the application role and suite-owned fixtures. Direct writes isolate database enforcement from command behavior.

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