---
id: TST-ACC-CLS-017
title: 'Close, reopen and retained-record API lifecycle'
kind: api-lifecycle
product_area: accounting
module: close
revision: 1
status: draft
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
repository: services-accounting
files:
  - modules/fiscal-close/tests/e2e/fiscal-close-runs.e2e.spec.js
implements:
  - ATS-ACC-CLS-007-03
  - ATS-ACC-CLS-008-01
  - ATS-ACC-CLS-008-02
  - ATS-ACC-CLS-008-05
  - ATS-ACC-CLS-009-02
  - ATS-ACC-CLS-010-03
  - ATS-ACC-CLS-011-01
  - ATS-ACC-CLS-011-03
  - ATS-ACC-CLS-012-03
  - ATS-ACC-CLS-012-05
  - ATS-ACC-CLS-013-01
  - ATS-ACC-CLS-013-03
  - ATS-ACC-CLS-013-04
  - ATS-ACC-CLS-014-02
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 3
isolation: >-
  The suite owns test-identifier workspaces and fixture records, removed by its
  teardown.
binding_policy: >-
  Each binding identifies the assertions this suite executes; combined scenarios
  may require other bound suites. Existence is not a recorded execution result.
evidence:
  - >-
    services-accounting:modules/fiscal-close/tests/e2e/fiscal-close-runs.e2e.spec.js
  - provenance: test
    source: >-
      services-accounting:modules/fiscal-close/tests/e2e/fiscal-close-runs.e2e.spec.js
    assertion_titles:
      - fiscal close runs (end to end)
      - the close
      - 'answers 200 with the run queued, a period close of faa’s September'
      - answers the same run for the same idempotency key
      - reads the run succeeded with its six steps
      - says why the revenue and COGS steps were skipped
      - lists the fiscal years the roll-forward generated as the step’s outputs
      - 'carries the readiness evaluated in the close, and the period as closed'
      - 'lists the run’s events, oldest first'
      - refuses a close without an idempotency key with 400
      - refuses a principal without accounting.fiscal-periods.close with 403
      - answers 404 for a run the tenant does not have
      - answers 404 for the run in another tenant
      - the runs and the record
      - lists the tenant’s close runs
      - refuses an unknown kind with 400
      - answers the completed close’s record
      - refuses retrying a run that did not fail with 409
      - >-
        refuses a reader’s retry with 403: the handler requires the run’s kind’s
        key
      - refuses cancelling a finished run with 409
      - the reopen
      - refuses a reason under ten characters with 400
      - answers 200 with the reopen run
      - 'ends the reopen succeeded, the period open again'
      - lists the reopen in the close’s record
real_dependencies: >-
  The local dispatcher, access and permission enforcement, domain services and
  database are exercised. Signing keys and workspace registration use local
  fixtures, and durable jobs use the in-process runner. This is a local API
  test, not a deployed authentication or workflow test.
product_intent: proposed
implementation_evidence: observed
---
# Close, reopen and retained-record API lifecycle

## Verification Boundary

The suite exercises the local public API dispatcher with signed request contexts and PostgreSQL. Durable work uses the in-process runner. AWS workflow delivery and a deployed console are outside this verification boundary.

## What This Suite Proves

The local API suite submits a close, follows its six steps, reads its retained record and reopens it. It checks replay, validation, missing grants, foreign runs and recovery refusals on ineligible outcomes.

## What It Does Not Prove

This register records assertion scope without claiming a passing run or complete coverage of every rule and scenario variant.

## Real Dependencies and Test Doubles

The local dispatcher, access and permission enforcement, domain services and database are exercised. Signing keys and workspace registration use local fixtures, and durable jobs use the in-process runner. This is a local API test, not a deployed authentication or workflow test.

## Must Not Be Doubled

Keep the dispatcher’s enforced grants, request validation, production persistence and database constraints real. A local runner cannot substitute for deployed workflow qualification.
