---
id: ADR-ACC-CLS-008
title: Calendar Maintenance Follows Successful Closure
product_area: accounting
module: close
revision: 1
status: proposed
design_intent: proposed
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
decision: >-
  Calendar generation follows close success, commits one year per call and
  retains that success even if the maintenance job fails.
constrains:
  - WF-ACC-CLS-001
  - DOM-ACC-CLS-003
  - SVC-ACC-CLS-fiscal-close
origin: >-
  fiscal-close design L7 (Rhythm 1.0 GEN-6);
  services-accounting:docs/milestones/ACCT-M1-books-and-invoices.md#D10.2;
  docs/migrations/fiscal-close/README.md (FC2-4 departures)
alternatives:
  - option: Generate the calendar before committing closure.
    why_not: >-
      A maintenance failure would then keep an otherwise ready month from
      completing.
  - option: Commit all generated years with one output.
    why_not: >-
      The inspected implementation chooses separate Books calls; no cited
      decision establishes why a single transaction was rejected.
consequences:
  - The run can report success while its job later fails.
  - >-
    Committed generated years can precede a missing maintenance output, and
    replay recalculates the remaining need.
  - A subsequent close can replenish the calendar again.
supersedes: []
evidence:
  - >-
    services-accounting at f47cb263:
    modules/fiscal-close/services/jobs/fiscal-close-job-tasks.ts:rollForward;
    modules/books/services/persistence/fiscal-years.ts:generateFiscalYears
    (named).
---

# Calendar Maintenance Follows Successful Closure

## Context

Future calendar availability is related maintenance, but the current task places it after the completed monthly decision.

## Decision

Generate until three open years start after the closed month. A Books validation refusal stops the loop; other failure can settle the job failed while the close remains successful.

## Alternatives Considered

Generate the calendar before committing closure. A maintenance failure would then keep an otherwise ready month from completing.

Commit all generated years with one output. The inspected implementation chooses separate Books calls; no cited decision establishes why a single transaction was rejected.

## Consequences

The run can report success while its job later fails. Committed generated years can precede a missing maintenance output, and replay recalculates the remaining need. A subsequent close can replenish the calendar again.
