---
id: ATS-ACC-BAT-010
scope: CAP-ACC-BAT-010
product_area: accounting
module: batches
revision: 2
status: proposed
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
  rhythm-v2-docs: 37405d50d1465ea0571a66095d98ebec4db04175
scenarios:
  - id: ATS-ACC-BAT-010-01
    title: Occurrences use the workspace’s local date
    level: api
    proves:
      - BR-CAP-ACC-BAT-010-01
    preconditions: >-
      The Denver recurrence runs after six in the evening locally, on the
      following UTC date.
    steps: Deliver its due occurrence.
    expected: >-
      The batch uses the Denver date, rendered name, unit currency and fiscal
      context.
    negative: false
    data_needs: Provide the schedule consumer in process.
    bound_to:
      - TST-ACC-BAT-116
      - TST-ACC-BAT-131
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#opens
      the new batch, dated the occurrence’s local date in Denver, and points the
      recurring batch at it
    category: boundary
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#opens
        the new batch, dated the occurrence’s local date in Denver, and points
        the recurring batch at it
      - >-
        services-accounting:modules/batches/tests/unit/rules/recurring-batch-rules.spec.js#is
        the local date in the schedule’s zone when the UTC date is already the
        next day
      - >-
        services-accounting:modules/batches/tests/unit/rules/recurring-batch-rules.spec.js#render
        the batch date with Liquid’s date filter, never moved across midnight
  - id: ATS-ACC-BAT-010-02
    title: Retained names gain a suffix
    level: browser
    proves:
      - BR-CAP-ACC-BAT-010-02
    preconditions: >-
      Two successive rolls encounter a populated prior batch and then an empty
      prior batch.
    steps: Deliver both occurrences and inspect allocated names.
    expected: >-
      Keeping the prior batch adds the next numeric suffix; deleting an empty
      prior batch releases the plain name.
    negative: false
    data_needs: Provide a recurring batch on the acceptance workspace.
    bound_to:
      - TST-ACC-BAT-116
      - TST-ACC-BAT-005
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#names
      the new batch with the " (2)" suffix when the previous batch is kept and
      still holds the name
    category: rule
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#names
        the new batch with the " (2)" suffix when the previous batch is kept and
        still holds the name
      - >-
        react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0515.spec.ts#ACT-ACC-0515
  - id: ATS-ACC-BAT-010-03
    title: Roll retires the prior intake batch
    level: browser
    proves:
      - BR-CAP-ACC-BAT-010-03
      - BR-CAP-ACC-BAT-010-04
      - BR-CAP-ACC-BAT-010-05
    preconditions: One current batch is empty and another contains payments.
    steps: Deliver each configuration’s due occurrence.
    expected: >-
      The empty batch is deleted without posting; the populated batch closes and
      one job posts it.
    negative: false
    data_needs: >-
      Provide the deployed scheduler (journeys) or the in-process consumer
      (integration).
    bound_to:
      - TST-ACC-BAT-116
      - TST-ACC-BAT-074
      - TST-ACC-BAT-006
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#posts
      the previous batch the roll leaves closed: one posting job of it, named in
      the run’s outcome
    category: transition
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#deletes
        the previous active batch, which nothing named
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#posts
        nothing when the previous batch was empty and so deleted (RB-20, D13)
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#posts
        the previous batch the roll leaves closed: one posting job of it, named
        in the run’s outcome
      - >-
        services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.integration.spec.js#leaves
        the system batch as it is when a roll takes it out of service
      - >-
        react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0516.spec.ts#ACT-ACC-0516
  - id: ATS-ACC-BAT-010-04
    title: Occurrence identity prevents duplicate rolls
    level: api
    proves:
      - BR-CAP-ACC-BAT-010-06
      - INV-DOM-ACC-BAT-001-08
    preconditions: The occurrence has already rolled successfully.
    steps: Deliver it again.
    expected: >-
      The existing result identifies the opened batch; no second batch or
      posting appears.
    negative: false
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-116
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#opens
      nothing for the same occurrence delivered again, and answers the same
      batch
    category: invariant
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#opens
        nothing for the same occurrence delivered again, and answers the same
        batch
  - id: ATS-ACC-BAT-010-05
    title: Roll failure rolls back its writes
    level: api
    proves:
      - BR-CAP-ACC-BAT-010-07
    preconditions: The roller fails after creating the replacement batch.
    steps: Deliver the occurrence.
    expected: >-
      The failure permits retry while leaving no replacement record and
      retaining the old current batch.
    negative: true
    data_needs: Provide a failing roller double.
    bound_to:
      - TST-ACC-BAT-116
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#leaves
      nothing: no new batch, the first batch still the active one, open
    category: failure
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#throws,
        so the queue retries the run
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#leaves
        nothing: no new batch, the first batch still the active one, open
  - id: ATS-ACC-BAT-010-06
    title: Repeated calendar failures pause scheduling
    level: api
    proves:
      - BR-CAP-ACC-BAT-010-08
    preconditions: No fiscal year covers the configuration’s next occurrence date.
    steps: Deliver five occurrences and inspect the configuration.
    expected: >-
      Each failure explains the missing calendar and opens nothing; the fifth
      leaves the schedule paused with its reason.
    negative: true
    data_needs: Provide fiscal years ending before the occurrences.
    bound_to: []
    provenance: proposed
    source: 'services-accounting:docs/accounting/recurring-batches.md#The roll'
    category: failure
    test_evidence: []
  - id: ATS-ACC-BAT-010-07
    title: Inactive delivery skips intake
    level: api
    proves:
      - BR-CAP-ACC-BAT-010-09
    preconditions: An inactive configuration still has a queued occurrence.
    steps: Deliver the stale occurrence.
    expected: The run records a skip reason without opening a batch.
    negative: true
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to: []
    provenance: proposed
    source: 'services-accounting:modules/batches/services/roll/recurring-batch-roll.ts'
    category: edge
    test_evidence: []
  - id: ATS-ACC-BAT-010-08
    title: Preview requires an available next occurrence
    level: api
    proves:
      - BR-CAP-ACC-BAT-010-11
    preconditions: 'Configurations include active, inactive, paused and disabled schedules.'
    steps: Preview each configuration.
    expected: >-
      Only the active configuration returns its next plan without changing
      history; the others return 409.
    negative: true
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-117
      - TST-ACC-BAT-061
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/preview-next-roll.integration.spec.js#refuses
      409 for a recurring batch whose schedule the system paused
    category: validation
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/preview-next-roll.integration.spec.js#answers
        the plan of its next occurrence, dated the occurrence’s local date in
        the schedule’s zone
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/preview-next-roll.integration.spec.js#records
        no run: the schedule’s history is the one run it had
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/preview-next-roll.integration.spec.js#refuses
        409 for an inactive recurring batch
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/preview-next-roll.integration.spec.js#refuses
        409 for a recurring batch whose schedule the system paused
      - >-
        services-accounting:modules/batches/tests/integration/services/roll/preview-next-roll.integration.spec.js#refuses
        409 for a recurring batch whose schedule is disabled with no pause
      - >-
        services-accounting:modules/batches/tests/e2e/recurring-batches.e2e.spec.js#records
        nothing: the history is still empty
  - id: ATS-ACC-BAT-010-09
    title: Manual intake occupies a generated name
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-001-02
      - BR-CAP-ACC-BAT-010-02
    exercises:
      - CAP-ACC-BAT-010
      - CAP-ACC-BAT-001
    workflows: []
    preconditions: An Open manual batch already has the rendered name Daily.
    steps: >-
      Roll the stream whose next rendered name is Daily and retrieve both
      batches.
    expected: The manual batch stays Daily and the generated batch is Daily (2).
    negative: false
    data_needs: >-
      An isolated workspace with the stated business-unit calendar, documents
      and configuration.
    bound_to: []
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#refuses
      a name another batch of the unit has 409, name_in_use, in 1.0’s sentence
      (D14);
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#names
      the new batch with the " (2)" suffix when the previous batch is kept and
      still holds the name
  - id: ATS-ACC-BAT-010-10
    title: Rolling does not duplicate a due close
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-005-04
      - BR-CAP-ACC-BAT-010-06
    exercises:
      - CAP-ACC-BAT-010
      - CAP-ACC-BAT-005
    workflows: []
    preconditions: A populated active batch has a due close and the stream is due to roll.
    steps: Deliver close and roll occurrences in both orders using separate fixtures.
    expected: >-
      Each fixture has one replacement intake batch; the predecessor has no
      duplicate current posting.
    negative: true
    data_needs: >-
      An isolated workspace with the stated business-unit calendar, documents
      and configuration.
    bound_to: []
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#posts
      nothing more when the same occurrence runs again: the batch is no longer
      open;
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#opens
      nothing for the same occurrence delivered again, and answers the same
      batch
  - id: ATS-ACC-BAT-010-11
    title: Inactive intake survives until reactivation
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-009-07
      - BR-CAP-ACC-BAT-010-09
    exercises:
      - CAP-ACC-BAT-010
      - CAP-ACC-BAT-009
    workflows:
      - WF-ACC-BAT-003
    preconditions: A stream has an Open active batch.
    steps: >-
      Deactivate it, deliver a stale occurrence, then reactivate with the
      current version.
    expected: >-
      The stale occurrence opens nothing; reactivation attempts a first batch
      and returns its result.
    negative: false
    data_needs: >-
      An isolated workspace with the stated business-unit calendar, documents
      and configuration.
    bound_to: []
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/recurring-batches.e2e.spec.js#answers
      no next run once deactivated;
      services-accounting:modules/batches/services/roll/recurring-batch-roll.ts
  - id: ATS-ACC-BAT-010-12
    title: Run history connects retirement to accounting
    category: rule
    level: api
    proves:
      - BR-CAP-ACC-BAT-010-10
    preconditions: Two completed rolls have distinct occurrence times and outcomes.
    steps: >-
      Read the stream’s run history and inspect generated and replaced batch
      references and posting outcomes.
    expected: >-
      The later occurrence appears first and both outcomes retain their plan,
      disposition and accounting request or refusal.
    negative: false
    data_needs: >-
      Owned records in an isolated workspace with the stated calendar and
      accounting setup.
    bound_to: []
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/recurring-batches.e2e.spec.js#answers
      the run the consumer recorded, every property of it
evidence:
  - services-accounting at f47cb263: 'Inspected references: scenario-bound tests in modules/batches/tests.'
  - react-console at baf6dae3: >-
      Inspected references:
      acceptance/accounting/playwright/journeys/batches-posting (ACT-ACC-0515,
      0516).
  - >-
    Pinned design objects, state models and workflows identify invariant and
    interaction obligations; scenario test anchors remain in test_evidence.
product_intent: proposed
coverage:
  rule: covered
  transition: 'gap: FND-ACC-BAT-064'
  validation: covered
  permission: 'gap: FND-ACC-BAT-064'
  edge: covered
  failure: covered
  boundary: covered
  concurrency: 'gap: FND-ACC-BAT-064'
  invariant: covered
  interaction: covered
coverage_notes:
  permission: >-
    Concurrent distinct occurrences, inactive delivery, permission checks on
    preview and history, and all predecessor lock and state combinations need
    proof.
  concurrency: >-
    Concurrent distinct occurrences, inactive delivery, permission checks on
    preview and history, and all predecessor lock and state combinations need
    proof.
rule_coverage:
  - rule: BR-CAP-ACC-BAT-010-01
    scenarios:
      - ATS-ACC-BAT-010-01
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#opens
      the new batch, dated the occurrence’s local date in Denver, and points the
      recurring batch at it
  - rule: BR-CAP-ACC-BAT-010-02
    scenarios:
      - ATS-ACC-BAT-010-02
      - ATS-ACC-BAT-010-09
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#names
      the new batch with the " (2)" suffix when the previous batch is kept and
      still holds the name
  - rule: BR-CAP-ACC-BAT-010-03
    scenarios:
      - ATS-ACC-BAT-010-03
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#deletes
      the previous active batch, which nothing named
  - rule: BR-CAP-ACC-BAT-010-04
    scenarios:
      - ATS-ACC-BAT-010-03
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#posts
      the previous batch the roll leaves closed: one posting job of it, named in
      the run’s outcome
  - rule: BR-CAP-ACC-BAT-010-05
    scenarios:
      - ATS-ACC-BAT-010-03
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#posts
      nothing when the previous batch was empty and so deleted (RB-20, D13)
  - rule: BR-CAP-ACC-BAT-010-06
    scenarios:
      - ATS-ACC-BAT-010-04
      - ATS-ACC-BAT-010-10
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#opens
      nothing for the same occurrence delivered again, and answers the same
      batch
  - rule: BR-CAP-ACC-BAT-010-07
    scenarios:
      - ATS-ACC-BAT-010-05
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/batch-roller.integration.spec.js#leaves
      nothing: no new batch, the first batch still the active one, open
  - rule: BR-CAP-ACC-BAT-010-08
    scenarios:
      - ATS-ACC-BAT-010-06
    provenance: proposed
    source: 'services-accounting:docs/accounting/recurring-batches.md#The roll'
  - rule: BR-CAP-ACC-BAT-010-09
    scenarios:
      - ATS-ACC-BAT-010-07
      - ATS-ACC-BAT-010-11
    provenance: proposed
    source: 'services-accounting:modules/batches/services/roll/recurring-batch-roll.ts'
  - rule: BR-CAP-ACC-BAT-010-11
    scenarios:
      - ATS-ACC-BAT-010-08
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/roll/preview-next-roll.integration.spec.js#refuses
      409 for a recurring batch whose schedule the system paused
transition_coverage:
  - state_model: STATE-ACC-BAT-001
    transition: 1
    from: open
    to: closed
    gap: FND-ACC-BAT-064
    provenance: unknown
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#removes
      the schedule and the time when the batch is closed
    note: >-
      The existing scenario set is not an exhaustive proof of this transition
      and all its side effects.
  - state_model: STATE-ACC-BAT-001
    transition: 18
    from: open
    to: deleted
    gap: FND-ACC-BAT-064
    provenance: unknown
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#deletes
      the batch a recurring batch names as its active batch and clears the
      reference (DEF-ACT-0012)
    note: >-
      The existing scenario set is not an exhaustive proof of this transition
      and all its side effects.
  - state_model: STATE-ACC-BAT-002
    transition: 3
    from: active
    to: paused
    gap: FND-ACC-BAT-064
    provenance: unknown
    source: 'services-accounting:docs/accounting/recurring-batches.md#The roll'
    note: >-
      The existing scenario set is not an exhaustive proof of this transition
      and all its side effects.
permission_coverage:
  - key: accounting.recurring-batches.read
    surface: api
    scenarios: []
    gap: FND-ACC-BAT-064
    provenance: unknown
    source: FND-ACC-BAT-064
    note: >-
      An aggregate persona check does not establish exhaustive allow and deny
      proof for every named surface.
executable_coverage:
  bound_scenarios: 6
  unbound_scenarios:
    - ATS-ACC-BAT-010-06
    - ATS-ACC-BAT-010-07
    - ATS-ACC-BAT-010-09
    - ATS-ACC-BAT-010-10
    - ATS-ACC-BAT-010-11
    - ATS-ACC-BAT-010-12
  gap: FND-ACC-BAT-064
---

# Advance a scheduled stream and post its predecessor: Capability Test Specification

## Coverage

The scenarios define focused checks for this outcome. The coverage map distinguishes specified checks from unresolved proof; executable bindings identify inspected assertions and carry no execution result.

| Rule | Proof Specification or Gap |
|---|---|
| `BR-CAP-ACC-BAT-010-01` | `ATS-ACC-BAT-010-01` |
| `BR-CAP-ACC-BAT-010-02` | `ATS-ACC-BAT-010-02`, `ATS-ACC-BAT-010-09` |
| `BR-CAP-ACC-BAT-010-03` | `ATS-ACC-BAT-010-03` |
| `BR-CAP-ACC-BAT-010-04` | `ATS-ACC-BAT-010-03` |
| `BR-CAP-ACC-BAT-010-05` | `ATS-ACC-BAT-010-03` |
| `BR-CAP-ACC-BAT-010-06` | `ATS-ACC-BAT-010-04`, `ATS-ACC-BAT-010-10` |
| `BR-CAP-ACC-BAT-010-07` | `ATS-ACC-BAT-010-05` |
| `BR-CAP-ACC-BAT-010-08` | `ATS-ACC-BAT-010-06` |
| `BR-CAP-ACC-BAT-010-09` | `ATS-ACC-BAT-010-07`, `ATS-ACC-BAT-010-11` |
| `BR-CAP-ACC-BAT-010-11` | `ATS-ACC-BAT-010-08` |

## Interactions With Related Capabilities

Manual intake occupies a generated name. Rolling does not duplicate a due close. Inactive intake survives until reactivation. These checks use the related capability’s outcome as part of the setup or verification. Unbound interactions remain proposed until a suite executes the complete chain.
