---
id: CAP-ACC-TRX-018
title: Preserve and read monthly receivables aging
feature: FEAT-ACC-TRX-05
product_area: accounting
module: transactions
revision: 1
status: draft
product_intent: proposed
implementation_evidence: observed
supersedes:
  - CAP-ACC-RPT-006
  - CAP-ACC-RPT-007
  - CAP-ACC-RPT-008
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources:
  - 'services-accounting:docs/snapshots/ar-aging.md#The A/R Aging Snapshot (`accounting.ar_aging`)'
purpose: Finance reviews a stable month-end position with a clear publication version.
outcomes:
  - Finance reviews a stable month-end position with a clear publication version.
  - >-
    Readers receive only published data and restart paging after a version change. Staff rerun controls remain
    a delivery gap.
concepts:
  - CON-ACC-TRX-005
actors:
  - ACT-ACC-002
  - ACT-ACC-024
surfaces:
  - console
  - api
  - job
permissions:
  - key: accounting.ar-aging.read
    where_checked: api
    scope: tenant
  - key: accounting.ar-snapshot-items.query
    where_checked: service
    scope: tenant
  - key: accounting.ar-snapshot-totals.query
    where_checked: service
    scope: tenant
rules:
  - id: BR-CAP-ACC-TRX-018-01
    proved_by: [ATS-ACC-TRX-018-01, TST-ACC-TRX-120]
    statement: >-
      After a month closes in the workspace calendar, scheduled planning creates its first snapshot version
      once for each eligible workspace.
    kind: lifecycle
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/runs/ar-aging-pipeline.integration.spec.js#it
      plans nothing twice: a second pass creates no run, and the ledger holds one run per tenant
    origin: 'services-accounting:docs/snapshots/ar-aging.md#The A/R Aging Snapshot (`accounting.ar_aging`)'
  - id: BR-CAP-ACC-TRX-018-02
    proved_by: [ATS-ACC-TRX-017-08, ATS-ACC-TRX-018-02, ATS-ACC-TRX-018-08, ATS-ACC-TRX-020-09, TST-ACC-TRX-119, TST-ACC-TRX-120]
    statement: >-
      Capture records month-end debt and negative unapplied money as known at that cutoff, excluding
      later-recorded backdated transactions.
    kind: calculation
    enforced_at:
      - service
      - database
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/runs/ar-aging-pipeline.integration.spec.js#it
      captures the open items as known at September’s end: the back-dated check recorded on 5 October is not
      in it
    origin: 'services-accounting:docs/snapshots/ar-aging.md#The A/R Aging Snapshot (`accounting.ar_aging`)'
  - id: BR-CAP-ACC-TRX-018-03
    proved_by: [ATS-ACC-TRX-018-03, TST-ACC-TRX-001, TST-ACC-TRX-120]
    statement: >-
      Snapshot items retain document and customer labels and classify debt into current, thirty-day bands
      through one hundred and twenty days, then older debt, with a separate unapplied bucket.
    kind: calculation
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/runs/ar-aging-pipeline.integration.spec.js#it
      copies each item’s number, its business unit and currency, and the customer’s name from CRM
    origin: 'services-accounting:docs/snapshots/ar-aging.md#The A/R Aging Snapshot (`accounting.ar_aging`)'
  - id: BR-CAP-ACC-TRX-018-04
    proved_by: [ATS-ACC-TRX-018-04, TST-ACC-TRX-120]
    statement: >-
      Publication requires successful validation and reconciled totals; failed capture rolls back its rows and
      schedules another attempt.
    kind: invariant
    enforced_at:
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/runs/ar-aging-pipeline.integration.spec.js#it
      leaves none of the failed run’s rows behind: its transaction rolled back
    origin: 'services-accounting:docs/snapshots/ar-aging.md#The A/R Aging Snapshot (`accounting.ar_aging`)'
  - id: BR-CAP-ACC-TRX-018-05
    proved_by: [ATS-ACC-TRX-017-08, ATS-ACC-TRX-018-05, ATS-ACC-TRX-018-08, ATS-ACC-TRX-020-09, TST-ACC-TRX-120]
    statement: >-
      Published data remains immutable; rerunning creates a new current version on publication while
      preserving superseded rows by run.
    kind: invariant
    enforced_at:
      - database
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/runs/ar-aging-pipeline.integration.spec.js#it
      keeps version 1’s rows as they were captured, readable by its run
    origin: 'services-accounting:docs/snapshots/ar-aging.md#The A/R Aging Snapshot (`accounting.ar_aging`)'
  - id: BR-CAP-ACC-TRX-018-06
    proved_by: [ATS-ACC-TRX-018-06, ATS-ACC-TRX-018-08, TST-ACC-TRX-001]
    statement: >-
      Month reads expose published data only, explain unavailable runs and reject a cursor when newer
      publication would mix versions.
    kind: policy
    enforced_at:
      - api
      - service
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/ar-aging.e2e.spec.js#it refuses the first version’s
      cursor with 409 version_changed, rather than continuing in the second version
    origin: 'services-accounting:docs/snapshots/ar-aging.md#The A/R Aging Snapshot (`accounting.ar_aging`)'
  - id: BR-CAP-ACC-TRX-018-07
    proved_by: [ATS-ACC-TRX-018-07, TST-ACC-TRX-001, TST-ACC-TRX-120]
    statement: Aging and dataset reads require their corresponding authorities and isolate workspace records.
    kind: permission
    enforced_at:
      - api
      - database
    must_prove: true
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/e2e/ar-aging.e2e.spec.js#it refuses a principal holding
      only the application’s access with 403 permission_missing
    origin: 'services-accounting:docs/snapshots/ar-aging.md#The A/R Aging Snapshot (`accounting.ar_aging`)'
  - id: BR-CAP-ACC-TRX-018-08
    proved_by: []
    statement: >-
      Credit applications reduce both invoice and credit open items on their date rather than creating a third
      item; reversal restores both on its own date.
    kind: calculation
    enforced_at:
      - service
    must_prove: false
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/runs/ar-aging-credit-application.integration.spec.js#it
      restores both on the reversal’s date
    origin: 'services-accounting:docs/snapshots/ar-aging.md#The A/R Aging Snapshot (`accounting.ar_aging`)'
scenarios:
  - id: SC-CAP-ACC-TRX-018-01
    given: A September-dated check was first recorded on October fifth.
    when: 'Capture September, then request a reconstructed version.'
    then: >-
      The first version excludes information unknown at cutoff; the later version includes it and replaces the
      current publication.
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/runs/ar-aging-pipeline.integration.spec.js#it
      includes the back-dated check recorded after the period end: the invoice it paid is 70.00
  - id: SC-CAP-ACC-TRX-018-02
    given: One workspace contains an incorrectly classified aging item.
    when: Run its monthly capture alongside other workspaces.
    then: >-
      Validation fails and rolls back that capture, schedules retry and leaves independent publications
      unaffected.
    provenance: test
    source: >-
      services-accounting:modules/transactions/tests/integration/services/runs/ar-aging-pipeline.integration.spec.js#it
      names the check that failed: the bucket of the misfiled item
edge_cases: []
depends_on:
  - CAP-ACC-TRX-020
related:
  - CAP-ACC-TRX-017
journeys: []
evidence:
  - >-
    services-accounting at f47cb263875bbc0c5640fba7dae6785ec32695f8:
    modules/transactions/aws/api/ar-aging.routes.ts (getArAging); aws/snapshots.module.ts,
    snapshots.configuration.ts, lambda/PLANNER.ts, DISPATCHER.ts, RUN.ts, logic/snapshot-run.step-function.ts;
    services/ar-aging/published-ar-aging.ts; services/runs/*; services/persistence/ar-snapshot-items.ts,
    ar-snapshot-totals.ts, snapshot-runs.ts; db/ar-snapshot-items.table.ts, ar-snapshot-totals.table.ts,
    ar-snapshot-items-published.view.ts, ar-snapshot-totals-published.view.ts, snapshot-run-jobs.table.ts,
    snapshot-run-job-steps.table.ts, snapshot-run-job-events.table.ts; metadata/ar-aging.objects.ts;
    queries/ar-aging.query.ts; export/ar-snapshots.dataset.ts; docs/snapshots/ar-aging.md;
    docs/debt/snapshot-routes-stack-budget-2026-10-22.md; tests e2e/ar-aging.e2e.spec.js,
    integration/services/runs/*, integration/services/persistence/ar-snapshot-*, snapshot-runs.
  - >-
    react-console at baf6dae382d6f41dce976c7f848667ccc37e076f: journey ACT-ACC-0817 (no spec); no aging page
    in the registered scope.
controls: [TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-IAM-006, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-006, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-LOG-004, TC-AVL-001, TC-AVL-004, TC-MON-001, TC-MON-002, TC-MON-004, TC-PI-001, TC-PI-002, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002]
exercised_by: [FAS-ACC-TRX-05-01, FAS-ACC-TRX-05-02, FAS-ACC-TRX-05-04, FAS-ACC-TRX-05-05]
suites: [TST-ACC-TRX-001, TST-ACC-TRX-119, TST-ACC-TRX-120]
---

# Preserve and read monthly receivables aging

## Purpose

Finance reviews a stable month-end position with a clear publication version.

## How It Works

Scheduled planning starts eligible monthly captures after the month ends locally. Capture reconstructs information known at the cutoff and classifies the open items. Validation reconciles item classification and totals before publication. Failure rolls back captured rows and schedules retry. A rerun creates a later version without changing earlier captured data. Readers receive only published data and restart paging after a version change. Staff rerun controls remain a delivery gap.

## Relationships

- Coordinate financial commands across applications supplies or continues the related financial work.
- Explain a customer’s current financial position supplies or continues the related financial work.
