Skip to content

ATS-ACC-BAT-004Use the batch’s permitted lifecycle actions: Capability Test Specification

Markdown

ATS-ACC-BAT-004

Use the batch’s permitted lifecycle actions: Capability Test Specification

Markdown
  • DocumentProposed
  • Product intentProposed

KindAcceptance test setProduct areaAccountingModuleBatch ManagementRevision2

Read atservices-accounting f47cb263react-console baf6dae3rhythm-v2-docs 37405d50

Coverage

  • Rule covered
  • Transition gap: FND-ACC-BAT-058
  • Validation covered
  • Permission gap: FND-ACC-BAT-058
  • Edge covered
  • Failure gap: FND-ACC-BAT-058
  • Boundary covered
  • Concurrency gap: FND-ACC-BAT-058
  • Invariant covered
  • Interaction covered

Test Scenarios

15 scenarios proving CAP-ACC-BAT-004; 8 bound to an existing test.

01 Transitions return the resulting statetransitionbrowsernegativetest
Proves
BR-CAP-ACC-BAT-004-01 BR-CAP-ACC-BAT-004-02
Preconditions
The selected batch starts Open.
Steps
Close, reopen and close it, then request Close again.
Expected
Successful responses show the new state; closing twice returns 409.
Data
Provide no fixtures beyond the stated setup.
Bound to
Source
services-accounting:modules/batches/tests/e2e/batch-actions.e2e.spec.js#answers each status action with the updated batch
02 Reopen clears posting errorstransitionapinegativetest
Proves
BR-CAP-ACC-BAT-004-03
Preconditions
The selected records are Error, Open and Archived.
Steps
Request Reopen on each.
Expected
Error becomes Open without errors; Open fails and Archived directs the user to unarchive.
Data
Provide an errored batch from a failed posting.
Bound to
Source
services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#clears the errors of an errored batch on reopen, so the open batch carries none (journey ACT-ACC-0521)
03 Archiving removes automatic closeinteractionapinegativetest
Proves
BR-CAP-ACC-BAT-004-04 BR-CAP-ACC-BAT-004-05
Preconditions
An Open batch has a close schedule; Closed and Posted batches also exist.
Steps
Archive each, unarchive eligible records and try unarchiving Open.
Expected
Open and Closed archive without their schedules; Posted fails; unarchive returns Open and refuses an already-open record.
Data
Provide no fixtures beyond the stated setup.
Bound to
Source
services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#archives an open batch and a closed one, and unarchives to open
04 Available actions reflect statusruleunittest
Proves
BR-CAP-ACC-BAT-004-06
Preconditions
Every batch status is represented and the caller holds all action permissions.
Steps
Retrieve each action list.
Expected
The list agrees with the declared transition table.
Data
Provide no fixtures beyond the stated setup.
Bound to
Source
services-accounting:modules/batches/tests/unit/actions/batch-actions.spec.js#offers an open batch post, close and archive
05 Each transition checks its permissionpermissionbrowsernegativetest
Proves
BR-CAP-ACC-BAT-004-07
Preconditions
Reader, staff and administrator personas can inspect Open and Posted batches.
Steps
Inspect and invoke each available transition.
Expected
Readers receive no actions; staff receive ordinary actions without Unpost; administrators receive the recovery actions; denied calls return 403.
Data
Provide the acceptance personas.
Bound to
Source
services-accounting:modules/batches/tests/unit/actions/batch-actions.spec.js#refuses a caller without the action’s permission, 403, before the command runs
06 Locks disable transitionsinvariantapinegativetest
Proves
BR-CAP-ACC-BAT-004-08
Preconditions
The batch has an update lock.
Steps
Retrieve its actions and request Archive.
Expected
The disabled ordinary actions identify the lock and Archive returns a locked-record refusal.
Data
Provide no fixtures beyond the stated setup.
Bound to
Source
services-accounting:modules/batches/tests/unit/actions/batch-actions.spec.js#lists a locked batch’s status actions with the refusal the command would answer as disabled_reason
07 System batches reject staff transitionsedgeapinegativetest
Proves
BR-CAP-ACC-BAT-004-09
Preconditions
A fiscal close has created a deferred-revenue batch.
Steps
As an administrator, retrieve and invoke its actions.
Expected
The list is empty; attempted actions return a system-batch 409 without changing the record.
Data
Provide a fiscal close's system batch.
Bound to
Source
services-accounting:modules/batches/tests/e2e/system-batches.e2e.spec.js#offers an administrator no action for the system batch
08 Actions reject unsupported requestsvalidationapinegativetest
Proves
BR-CAP-ACC-BAT-004-11
Preconditions
The batch is Open.
Steps
Invoke an unavailable action and submit Close with another batch reference in its body.
Expected
Both requests return 400; the unsupported-action error identifies the choices.
Data
Provide no fixtures beyond the stated setup.
Bound to
Source
services-accounting:modules/batches/tests/e2e/batch-actions.e2e.spec.js#refuses an action the batch has not 400, naming the actions
09 Archive protection ends through Unarchiveinteractionapinegativeproposed
Proves
BR-CAP-ACC-BAT-003-03 BR-CAP-ACC-BAT-004-05
Preconditions
Morning starts Open with description First.
Steps
Archive Morning, try to change its description, unarchive it and save Second.
Expected
The archived save returns 409; the final read is Open with description Second.
Data
An isolated workspace with the stated business-unit calendar, documents and configuration.
Source
services-accounting:modules/batches/services/persistence/batches.ts:changeBatch; services-accounting:modules/batches/services/rules/batch-rules.ts:assertBatchChangesAllowed; services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#archives an open batch and a closed one, and unarchives to open
10 Manual close cancels a scheduled closeinteractionapiproposed
Proves
BR-CAP-ACC-BAT-004-02 BR-CAP-ACC-BAT-005-05
Preconditions
Morning is Open with a future close occurrence.
Steps
Close it manually and deliver the old occurrence after it is due.
Expected
Morning remains Closed and the old delivery cannot close it again.
Data
An isolated workspace with the stated business-unit calendar, documents and configuration.
Source
services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#refuses closing a batch that is not open; services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#removes the schedule and the time when the batch is closed
11 Reopening retires one attention generationinteractionapiproposed
Proves
BR-CAP-ACC-BAT-004-03 BR-CAP-ACC-BAT-008-04
Preconditions
Attention publication is enabled and Morning is Open.
Steps
Close Morning, inspect its attention, reopen it, then close it again.
Expected
The first item is resolved and the second close creates a new generation.
Data
An isolated workspace with the stated business-unit calendar, documents and configuration.
Source
services-accounting:modules/batches/tests/integration/services/persistence/batches.integration.spec.js#clears the errors of an errored batch on reopen, so the open batch carries none (journey ACT-ACC-0521); services-accounting:modules/batches/tests/integration/services/persistence/batch-attention-items.integration.spec.js#resolves a reopened batch reopened, and its next close opens the second generation
12 Post produces a protected completed batchinteractionapinegativeproposed
Proves
BR-CAP-ACC-BAT-004-01 BR-CAP-ACC-BAT-013-03
Preconditions
Morning is Open with one eligible invoice.
Steps
Post through the named action, wait for completion and attempt Archive.
Expected
Morning becomes Posted with an entry; Archive returns 409 and preserves it.
Data
An isolated workspace with the stated business-unit calendar, documents and configuration.
Source
services-accounting:modules/batches/tests/e2e/batch-actions.e2e.spec.js#answers each status action with the updated batch; services-accounting:modules/batches/tests/e2e/batch-postings.e2e.spec.js#posts a batch as a durable job: the answer is the job, and the job posts the batch
13 Unpost restores ordinary actionsinteractionapiproposed
Proves
BR-CAP-ACC-BAT-004-06 BR-CAP-ACC-BAT-016-06
Preconditions
Morning is Posted in an Open period.
Steps
Unpost through the named action and retrieve the resulting action catalogue.
Expected
Morning is Open and offers Close and Archive again.
Data
An isolated workspace with the stated business-unit calendar, documents and configuration.
Source
services-accounting:modules/batches/tests/unit/actions/batch-actions.spec.js#offers a batch posting for half an hour nothing, and one stuck in posting for over an hour unpost; services-accounting:modules/batches/tests/e2e/batch-postings.e2e.spec.js#unposts a posted batch as a durable job: the batch is open again and its entries are deleted
14 Fiscal collections reject ordinary controlsinteractionapinegativeproposed
Proves
BR-CAP-ACC-BAT-004-09 BR-CAP-ACC-BAT-020-11
Preconditions
Fiscal close has produced a Posted deferred-revenue system batch.
Steps
Retrieve its ordinary actions and attempt Close, Archive and Unpost.
Expected
The action list is empty and each attempted ordinary action is refused without changing fiscal entries.
Data
An isolated workspace with the stated business-unit calendar, documents and configuration.
Source
services-accounting:modules/batches/tests/e2e/system-batches.e2e.spec.js#offers an administrator no action for the system batch; react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0528.spec.ts#ACT-ACC-0528
15 Stuck-posting actions respect the one-hour boundaryboundaryapinegativeproposed
Proves
BR-CAP-ACC-BAT-004-06
Preconditions
Two Posting batches last changed exactly one hour ago and one hour plus one second ago.
Steps
Retrieve their permitted actions at a fixed clock.
Expected
Only the older batch offers Unpost.
Data
Owned records in an isolated workspace with the stated calendar and accounting setup.
Source
services-accounting:modules/batches/tests/unit/actions/batch-actions.spec.js#offers a batch posting for half an hour nothing, and one stuck in posting for over an hour unpost

The Markdown files under specs/ in rhythmsoftware/rhythm-v2-docs are the canonical source of truth. This reader is a generated, read-only projection of them.