---
id: DOM-ACC-CLS-004
title: Close Record
realises: CON-ACC-CLS-004
product_area: accounting
module: close
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
owned_by: SVC-ACC-CLS-fiscal-close
readable_by: []
custom_fields: none
identity: >-
  A successful period or year close has one snapshot identified by its run
  within the workspace. The read operation combines that stored snapshot with
  the run and later reopen requests; it does not store a second assembled
  record.
attributes:
  - name: close run and period
    kind: reference
    required: true
    computed: false
    notes: >-
      The snapshot identifies its run and the same unit, year and month that the
      run names.
  - name: captured readiness
    kind: collection
    required: true
    computed: false
    notes: Finalization copies the checklist calculated by revalidation.
  - name: reconciliation at close
    kind: collection
    required: true
    computed: false
    notes: >-
      The stored payment section includes the calculation’s accepted exceptions
      and their requester and approver references.
  - name: close totals
    kind: collection
    required: true
    computed: false
    notes: >-
      Totals preserve recognition results or the skip reason, skipped cost of
      goods sold work and warning acknowledgements.
  - name: captured at
    kind: date
    required: true
    computed: true
    notes: Finalization records when the snapshot is captured.
  - name: audit trail
    kind: computed
    required: true
    computed: true
    notes: >-
      The service builds request and completion entries from the close and
      linked reopens. It groups each reopen request with its completion rather
      than globally sorting every entry.
  - name: linked reopens
    kind: computed
    required: false
    computed: true
    notes: >-
      The service returns at most one hundred linked reopen runs, ordered by
      their identifiers from oldest to newest, without a continuation.
  - name: aging request
    kind: reference
    required: false
    computed: true
    notes: >-
      The finalization output on the run retains aging run, version, basis and
      month; the snapshot itself does not store that request.
relationships:
  - to: DOM-ACC-CLS-003
    cardinality: one snapshot to one successful close run
    ownership: >-
      The snapshot belongs to its run and restricts deletion of that run until
      the snapshot is removed.
    cross_service: false
  - to: DOM-ACC-CLS-002
    cardinality: one captured evaluation
    ownership: The snapshot retains its own copy of the close’s evaluation.
    cross_service: false
  - to: DOM-ACC-CLS-001
    cardinality: one closed month refers to the close request that retains its snapshot
    ownership: >-
      The period links to the close run; the snapshot repeats that run’s period
      under a composite foreign key.
    cross_service: false
invariants:
  - id: INV-DOM-ACC-CLS-004-01
    statement: The snapshot key permits at most one snapshot for a close run.
    enforced_at:
      - database
    provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/integration/db/fiscal-close.table.integration.spec.js#refuses
      a second snapshot of the run, by the primary key
  - id: INV-DOM-ACC-CLS-004-02
    statement: The snapshot’s composite reference requires its period to match its run.
    enforced_at:
      - database
    provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/integration/db/fiscal-close.table.integration.spec.js#refuses
      a snapshot that names a period other than its run’s, by the run’s foreign
      key
  - id: INV-DOM-ACC-CLS-004-03
    statement: The database roles have no permission to update a captured snapshot.
    enforced_at:
      - database
    provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/integration/db/fiscal-close.table.integration.spec.js#refuses
      the application role any update of a snapshot, which is written once
  - id: INV-DOM-ACC-CLS-004-04
    statement: >-
      Every snapshot document is a JSON object stored in fewer than 512
      kilobytes.
    enforced_at:
      - database
    provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/integration/services/persistence/period-close-snapshots.integration.spec.js#refuses
      a totals document of 512 kB or more
  - id: INV-DOM-ACC-CLS-004-05
    statement: >-
      The normal finalization path writes the snapshot, closes the period and
      succeeds the run in one transaction; a failed transaction leaves no
      snapshot.
    enforced_at:
      - service
      - database
    provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/integration/services/jobs/close-job.integration.spec.js#writes
      no close snapshot and requests no A/R snapshot
  - id: INV-DOM-ACC-CLS-004-06
    statement: The database refuses deletion of a run still referenced by a snapshot.
    enforced_at:
      - database
    provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/integration/db/fiscal-close.table.integration.spec.js#refuses
      deleting a run its snapshot names
  - id: INV-DOM-ACC-CLS-004-07
    statement: >-
      The record operation requires a close-kind run and its snapshot; a reopen
      or close without a snapshot is not found.
    enforced_at:
      - service
    provenance: observed
    source: >-
      services-accounting:modules/fiscal-close/services/runs/close-run-view.ts:closeRecordOf
  - id: INV-DOM-ACC-CLS-004-08
    statement: >-
      Reopening preserves the earlier snapshot and exposes the linked reopen
      through the record read.
    enforced_at:
      - service
      - database
    provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/integration/services/jobs/reopen-job.integration.spec.js#keeps
      the close’s snapshot
  - id: INV-DOM-ACC-CLS-004-09
    statement: >-
      The purge callback deletes snapshots, job roots and runs before calendar
      records, restricting deletion to the selected workspace.
    enforced_at:
      - database
      - service
    provenance: test
    source: >-
      services-accounting:modules/maintenance/tests/integration/services/participants/fiscal-close-participant.integration.spec.js#leaves
      the other tenant’s rows exactly as they were
physical:
  - period_close_snapshots
evidence:
  - >-
    services-accounting at f47cb263:
    modules/fiscal-close/db/period-close-snapshots.table.ts;
    services/persistence/period-close-snapshots.ts;
    services/runs/close-run-view.ts;
    services/jobs/fiscal-close-job-tasks.ts:finalizeClose;
    export/fiscal-close.dataset.ts;
    modules/maintenance/services/participants/fiscal-close-participant.ts;
    docs/architecture/accounting-2.0/04-domain-model.md (fiscal close).
  - 'react-console at baf6dae3: components/accounting/close/close-record.tsx.'
custom_field_declaration:
  provenance: unknown
  source: FND-ACC-CLS-053
---

# Close Record

## What It Models

A close record lets a reviewer inspect the evidence retained when a month closed. Its immutable core contains the binding readiness, payment assessment and close totals. The service adds the request, execution view and subsequent reopen history when someone reads it.

## Identity and Attributes

The run identifies the record. Stored documents preserve the earlier calculation despite later changes to the books. The service reconstructs audit entries from requests and successful completions; cancellation attribution remains in operational history. The aging request is available through the run’s finalization output rather than the snapshot.

## Relationships

The snapshot references exactly one run and repeats its period identity. A correction followed by another close creates another run and snapshot. Earlier evidence remains attached to its original close.

## Invariants

The invariant rows define snapshot uniqueness, period correspondence, bounded storage and update protection. The normal service path makes capture part of successful finalization. The database foreign key alone does not require a successful run status or close kind.

## How It Is Stored and Shared

The snapshot table enforces workspace isolation and withholds update privileges from application roles. The record operation assembles the console’s evidence view. Customer export embeds the snapshot inside its run; names are resolved by the console from returned person references.

## Open Design Questions

The service still owes resolved closer names under the approved plan. Linked reopen history is silently bounded, audit entries are not globally chronological, and the record lacks a requested-or-ready aging signal. These limitations need decisions or implementation corrections before preparation.
