---
id: STATE-ACC-BAT-005
title: Revenue recognition schedule and its entries
object: DOM-ACC-BAT-005
product_area: accounting
module: batches
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
states:
  - name: open
    meaning: >-
      Some releases remain unrecognised; entries can already include recognised
      amounts.
  - name: recognized
    meaning: The fiscal process has released every schedule entry.
  - name: void
    meaning: >-
      Ordinary recovery retired an Open plan, excluding it from further native
      recognition.
  - name: cancelled
    meaning: Retained status vocabulary without an established native producer.
transitions:
  - from: open
    to: recognized
    trigger: Fiscal accounting releases the final pending amount.
    guard: >-
      The caller period is Open or Closing and the schedule generation is
      current.
    side_effects:
      - >-
        Mark released amounts Recognized and produce their fiscal system-ledger
        entries.
    who: Fiscal close through the recognition function
    provenance: observed
    source: >-
      services-accounting:modules/batches/services/close/close-rules.ts:recogniseSchedule;
      modules/batches/services/close/revenue-recognition.ts:recogniseDueEntries
  - from: recognized
    to: open
    trigger: Fiscal reopening takes back affected recognition.
    guard: The caller period is Closed or Reopening.
    side_effects:
      - >-
        Return recognised entries dated from the period start, or recognised in
        that period, to Unrecognized; retain unaffected earlier releases.
    who: Fiscal reopening through the unrecognition function
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/revenue-recognition.integration.spec.js#un-recognizes
      A's and B's September entries and opens both schedules again
  - from: open
    to: void
    trigger: Ordinary unposting retires an Open schedule.
    guard: The voiding update selects the Open status.
    side_effects:
      - Preserve the schedule and entry records without changing entry statuses.
    who: The unposting execution task
    provenance: observed
    source: >-
      services-accounting:modules/batches/services/persistence/revenue-recognition-schedules.ts:voidUnrecognizedSchedules
invalid:
  - from: void
    to: open
    why: >-
      Native reads exclude the reversed generation; later posting creates
      another plan rather than reopening this one.
  - from: recognized
    to: void
    why: >-
      The voiding update selects Open plans only. It leaves Recognized plans
      untouched without proving the originating batch period is closed.
invariants:
  - INV-DOM-ACC-BAT-005-03
  - INV-DOM-ACC-BAT-005-04
  - INV-DOM-ACC-BAT-005-05
concurrency: >-
  Fiscal recognition locks affected current schedules within the caller
  transaction. Ordinary recovery retires plans in its batch-locked transaction.
  These boundaries do not establish a policy for unposting a plan whose releases
  have already been recognised.
evidence:
  - >-
    services-accounting at f47cb263:
    modules/batches/db/revenue-recognition-schedules.table.ts;
    services/persistence/revenue-recognition-schedules.ts;
    services/close/revenue-recognition.ts, close-rules.ts;
    services/engine/unpost-batches.ts
---

# Revenue Recognition Schedule and Its Entries

## The Lifecycle

```mermaid
stateDiagram-v2
  [*] --> open: generate revenue plan
  open --> recognized: release final amount
  recognized --> open: take back affected releases
  open --> void: retire ordinary generation
  void --> [*]
```

Entry status is a separate vocabulary. Native recognition and reopening move affected entries between Unrecognized and Recognized; retiring a schedule does not change those entries.

## Transitions Explained

The transition rows distinguish releasing revenue, undoing fiscal recognition and retiring the source generation. Recognition includes due earlier releases, subject to the source booking-date check.

## What Cannot Happen

The native process does not restore a retired plan. Recognized is excluded from the voiding update; that exclusion is not proof that unposting the originating collection is always refused.

## Concurrency and Timing

The unresolved policy concerns already recognised revenue when source accounting is removed. The current implementation can preserve fiscal recognition while retiring or reversing the source generation, and the design does not invent compensation.
