---
id: ATS-ACC-BAT-016
scope: CAP-ACC-BAT-016
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-016-01
    title: Recovery access and state are checked
    level: browser
    proves:
      - BR-CAP-ACC-BAT-016-01
      - BR-CAP-ACC-BAT-016-02
    preconditions: Staff and administrator personas can inspect a Posted and an Open batch.
    steps: Unpost Posted as staff and Open as administrator.
    expected: Staff receive 403 without changing Posted; the invalid state returns 409.
    negative: true
    data_needs: Provide the acceptance personas.
    bound_to:
      - TST-ACC-BAT-057
      - TST-ACC-BAT-055
      - TST-ACC-BAT-119
      - TST-ACC-BAT-027
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-postings.e2e.spec.js#refuses
      an unposting without the unposting permission, 403, and leaves the batch
      posted
    category: permission
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/e2e/batch-postings.e2e.spec.js#refuses
        an unposting without the unposting permission, 403, and leaves the batch
        posted
      - >-
        services-accounting:modules/batches/tests/e2e/batch-actions.e2e.spec.js#refuses
        unposting a batch that is not posted 409
      - >-
        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
      - >-
        react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0540.spec.ts#ACT-ACC-0540
  - id: ATS-ACC-BAT-016-02
    title: Ordinary unposting deletes ledger rows
    level: browser
    proves:
      - BR-CAP-ACC-BAT-016-03
      - BR-CAP-ACC-BAT-016-04
      - BR-CAP-ACC-BAT-016-05
      - BR-CAP-ACC-BAT-016-06
      - INV-DOM-ACC-BAT-003-05
      - INV-DOM-ACC-BAT-005-04
    preconditions: Two batches are Posted and the first contains deferred revenue.
    steps: >-
      Unpost the first and inspect all ledger history, posting history,
      schedules and the second batch.
    expected: >-
      The first has no entries or reversal entries, retains a reversed posting
      record, voids open schedules and becomes Open without posting time; the
      second is unchanged.
    negative: false
    data_needs: Provide the acceptance workspace.
    bound_to:
      - TST-ACC-BAT-112
      - TST-ACC-BAT-094
      - TST-ACC-BAT-092
      - TST-ACC-BAT-076
      - TST-ACC-BAT-057
      - TST-ACC-BAT-017
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#deletes
      the batch’s entries and their lines, and tells how many entries
    category: transition
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#deletes
        the batch’s entries and their lines, and tells how many entries
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#leaves
        the other batch’s entries and lines untouched
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#keeps
        the posting history: the first posting reversed, the second current
      - >-
        services-accounting:modules/batches/tests/integration/services/persistence/subledger-entries.queries.integration.spec.js#lists
        no entry when history is asked for either: nothing is written as a
        reversal
      - >-
        services-accounting:modules/batches/tests/integration/services/persistence/revenue-recognition-schedules.queries.integration.spec.js#reads
        the current schedule by its id, and none once its posting is not the
        current one
      - >-
        services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#has
        no posting time after the unposting job, which is its last job
        (DEF-ACT-0513)
      - >-
        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
      - >-
        react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0527.spec.ts#ACT-ACC-0527
  - id: ATS-ACC-BAT-016-03
    title: Posted dependents block isolated recovery
    level: api
    proves:
      - BR-CAP-ACC-BAT-016-07
    preconditions: Posted November depends on Posted October.
    steps: Unpost October alone.
    expected: The dependency refusal leaves October Posted.
    negative: true
    data_needs: Provide two dependent batches.
    bound_to:
      - TST-ACC-BAT-105
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/rebuilt-documents.integration.spec.js#refuses
      to unpost October while November, which depends on it, is posted
    category: invariant
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/rebuilt-documents.integration.spec.js#refuses
        to unpost October while November, which depends on it, is posted
  - id: ATS-ACC-BAT-016-04
    title: Closed periods block recovery
    level: api
    proves:
      - BR-CAP-ACC-BAT-016-08
    preconditions: September’s posted batch remains after period close.
    steps: Request Unpost through the action and job paths.
    expected: >-
      The action creates no job and identifies the closed period; the job fails
      its check and leaves Posted unchanged.
    negative: true
    data_needs: Provide a fiscal close.
    bound_to:
      - TST-ACC-BAT-070
      - TST-ACC-BAT-010
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/posting-period-guard.integration.spec.js#refuses
      the batch action `unpost` (`period_not_open`), submitting no job
    category: validation
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/close/posting-period-guard.integration.spec.js#refuses
        the batch action `unpost` (`period_not_open`), submitting no job
      - >-
        services-accounting:modules/batches/tests/integration/services/close/posting-period-guard.integration.spec.js#fails
        the unposting job on its check step with the refusal
      - >-
        services-accounting:modules/batches/tests/integration/services/close/posting-period-guard.integration.spec.js#leaves
        the batch posted, its posting unreversed
      - >-
        react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0520.spec.ts#ACT-ACC-0520
  - id: ATS-ACC-BAT-016-05
    title: Reposting writes a fresh current set
    level: api
    proves:
      - BR-CAP-ACC-BAT-016-09
    preconditions: The batch was posted and then unposted.
    steps: Post again and inspect ledger history.
    expected: >-
      A new posting owns one fresh set of entries without old rows or
      compensating reversals.
    negative: false
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-112
      - TST-ACC-BAT-105
      - TST-ACC-BAT-057
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#writes
      one fresh set when the batch is posted again, equal in size to the first
    category: rule
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#writes
        one fresh set when the batch is posted again, equal in size to the first
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#lists,
        history included, only the fresh set after the repost: no stale entry,
        no reversal
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/rebuilt-documents.integration.spec.js#posts
        October again as a new posting, whose entries equal the first and are
        the only set
      - >-
        services-accounting:modules/batches/tests/e2e/batch-postings.e2e.spec.js#makes
        post, unpost and post of one batch three jobs through the routes, and
        posts the batch again
  - id: ATS-ACC-BAT-016-06
    title: Guarded deletion preserves failed work
    level: api
    proves:
      - BR-CAP-ACC-BAT-016-10
    preconditions: >-
      One posting’s deletion will fail; others hold reversals or are already
      reversed.
    steps: >-
      Unpost the first and directly attempt the other guarded deletions,
      including from another workspace.
    expected: >-
      The failed job preserves posting, entries and batch; invalid direct
      deletions return the guarded database error.
    negative: true
    data_needs: Provide refusing fixtures.
    bound_to:
      - TST-ACC-BAT-113
      - TST-ACC-BAT-112
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-refusal.integration.spec.js#keeps
      the posting, its entries and the batch as they were, and fails the
      unposting step with the refusal
    category: failure
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/unpost-refusal.integration.spec.js#keeps
        the posting, its entries and the batch as they were, and fails the
        unposting step with the refusal
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#refuses
        (RHA02) a posting that holds a reversal entry, and keeps the reversal
        line marked is_reversal
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#refuses
        (RHA02) a posting that is already reversed
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#refuses
        (RHA02) a posting of another tenant
  - id: ATS-ACC-BAT-016-07
    title: Locks and system type restrict unposting
    level: api
    proves:
      - BR-CAP-ACC-BAT-016-11
    preconditions: A posted ordinary batch is locked and a fiscal system batch is Posted.
    steps: Attempt actions and job submissions for both.
    expected: >-
      The action reports the lock; the system job refuses recovery and leaves
      its batch Posted.
    negative: true
    data_needs: Provide a fiscal close.
    bound_to:
      - TST-ACC-BAT-076
      - TST-ACC-BAT-063
      - TST-ACC-BAT-074
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/system-batches.e2e.spec.js#answers
      an unposting naming the system batch with its job, and the job fails with
      the refusal
    category: edge
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#is
        not unposted by the action (DEF-ACT-0503)
      - >-
        services-accounting:modules/batches/tests/e2e/system-batches.e2e.spec.js#answers
        an unposting naming the system batch with its job, and the job fails
        with the refusal
      - >-
        services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.integration.spec.js#fails
        an unposting job naming the posted system batch, the batch left posted
  - id: ATS-ACC-BAT-016-08
    title: Recovery changes dependent lookup
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-002-07
      - BR-CAP-ACC-BAT-016-06
    exercises:
      - CAP-ACC-BAT-016
      - CAP-ACC-BAT-002
    workflows: []
    preconditions: October has a Posted November dependent.
    steps: 'Look up October’s dependents, recover November, then repeat the lookup.'
    expected: >-
      November appears before recovery and is absent from the posted-dependent
      result afterward.
    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.queries.integration.spec.js#answers
      the posted and downloaded batches depending on those named, through
      others, with their id, name, date and status;
      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
  - id: ATS-ACC-BAT-016-09
    title: Unpost restores ordinary actions
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-004-06
      - BR-CAP-ACC-BAT-016-06
    exercises:
      - CAP-ACC-BAT-016
      - CAP-ACC-BAT-004
    workflows:
      - WF-ACC-BAT-006
    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.
    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/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
  - id: ATS-ACC-BAT-016-10
    title: Recovery permits document reassignment
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-007-05
      - BR-CAP-ACC-BAT-016-06
    exercises:
      - CAP-ACC-BAT-016
      - CAP-ACC-BAT-007
    workflows: []
    preconditions: Morning is Posted with one invoice and Evening is Open in the same unit.
    steps: Unpost Morning and move its invoice to Evening.
    expected: Morning is Open without ledger entries and the invoice names Evening.
    negative: false
    data_needs: >-
      An isolated workspace with the stated business-unit calendar, documents
      and configuration.
    bound_to: []
    provenance: proposed
    source: >-
      react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0538.spec.ts#ACT-ACC-0538;
      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
  - id: ATS-ACC-BAT-016-11
    title: Reposting creates a fresh generation
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-04
      - BR-CAP-ACC-BAT-016-09
    exercises:
      - CAP-ACC-BAT-016
      - CAP-ACC-BAT-013
    workflows: []
    preconditions: Morning contains one invoice and its fiscal period remains Open.
    steps: >-
      Post, recover and post Morning again; inspect all posting history and
      current entries.
    expected: >-
      Two posting generations remain, the first reversed, with only the second
      generation’s entries current.
    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/jobs/submission-identity.integration.spec.js#answers
      a colleague's retry under another key, after the posting finished, with
      the job that posted (DEF-ACT-0514);
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#writes
      one fresh set when the batch is posted again, equal in size to the first
  - id: ATS-ACC-BAT-016-12
    title: Guarded recovery removes only its ledger
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-016-03
      - BR-CAP-ACC-BAT-017-04
    exercises:
      - CAP-ACC-BAT-016
      - CAP-ACC-BAT-017
    workflows: []
    preconditions: Morning and Evening each have a current posting in an Open period.
    steps: Unpost Morning and list both batches’ entries including history.
    expected: Morning has no entries; Evening’s stored entries are unchanged.
    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/posting/unpost-deletes-entries.integration.spec.js#deletes
      the batch’s entries and their lines, and tells how many entries;
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#is
      the only way to delete a ledger row: the application role is refused a
      direct delete
  - id: ATS-ACC-BAT-016-13
    title: Recovery leaves history without ordinary entries
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-016-03
      - BR-CAP-ACC-BAT-018-04
    exercises:
      - CAP-ACC-BAT-016
      - CAP-ACC-BAT-018
    workflows: []
    preconditions: Morning is Posted and has a visible ledger entry.
    steps: Unpost Morning and list its entries with and without history.
    expected: >-
      Both entry lists are empty while posting history retains the retired
      generation.
    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/posting/unpost-deletes-entries.integration.spec.js#deletes
      the batch’s entries and their lines, and tells how many entries;
      services-accounting:modules/batches/tests/integration/services/persistence/subledger-entries.queries.integration.spec.js#lists
      no entry when history is asked for either: nothing is written as a
      reversal
  - id: ATS-ACC-BAT-016-14
    title: Fiscal close blocks ordinary recovery
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-016-08
      - BR-CAP-ACC-BAT-020-11
    exercises:
      - CAP-ACC-BAT-016
      - CAP-ACC-BAT-020
    workflows: []
    preconditions: A posted ordinary batch belongs to a Closed period with a system batch.
    steps: >-
      Attempt ordinary recovery and inspect both the ordinary and system
      accounting.
    expected: Recovery is refused; both postings and their entries stay intact.
    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/close/posting-period-guard.integration.spec.js#refuses
      the batch action `unpost` (`period_not_open`), submitting no job;
      react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0528.spec.ts#ACT-ACC-0528
  - id: ATS-ACC-BAT-016-15
    title: Recovery waits for a competing batch lock
    category: concurrency
    level: api
    proves:
      - BR-CAP-ACC-BAT-016-02
      - BR-CAP-ACC-BAT-016-10
    preconditions: >-
      A Posted batch has a current posting; another database transaction holds
      its row and changes it to Open.
    steps: >-
      Start direct unposting, confirm lock waiting, then commit the competing
      change.
    expected: >-
      Recovery waits and refuses the Open state; its original posting remains
      unreversed.
    negative: true
    data_needs: >-
      Owned records in an isolated workspace with the stated calendar and
      accounting setup.
    bound_to:
      - TST-ACC-BAT-096
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/concurrent-posting.integration.spec.js#makes
      a direct unposting wait for the batch, then refuse it as open, with its
      posting left unreversed
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/concurrent-posting.integration.spec.js#makes
        a direct unposting wait for the batch, then refuse it as open, with its
        posting left unreversed
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-0520,
      0527, 0540).
  - >-
    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-070'
  validation: covered
  permission: 'gap: FND-ACC-BAT-070'
  edge: covered
  failure: covered
  boundary: 'gap: FND-ACC-BAT-070'
  concurrency: covered
  invariant: covered
  interaction: covered
coverage_notes:
  rule: >-
    All recovery starting states, concurrent dependent updates or failed
    dependent reads, recognised-schedule recovery and exact one-hour admission
    require focused proof.
  boundary: >-
    All recovery starting states, concurrent dependent updates or failed
    dependent reads, recognised-schedule recovery and exact one-hour admission
    require focused proof.
  concurrency: >-
    All recovery starting states, concurrent dependent updates or failed
    dependent reads, recognised-schedule recovery and exact one-hour admission
    require focused proof.
rule_coverage:
  - rule: BR-CAP-ACC-BAT-016-01
    scenarios:
      - ATS-ACC-BAT-016-01
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-postings.e2e.spec.js#refuses
      an unposting without the unposting permission, 403, and leaves the batch
      posted
  - rule: BR-CAP-ACC-BAT-016-02
    scenarios:
      - ATS-ACC-BAT-016-01
      - ATS-ACC-BAT-016-15
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-actions.e2e.spec.js#refuses
      unposting a batch that is not posted 409
  - rule: BR-CAP-ACC-BAT-016-03
    scenarios:
      - ATS-ACC-BAT-016-02
      - ATS-ACC-BAT-016-12
      - ATS-ACC-BAT-016-13
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#deletes
      the batch’s entries and their lines, and tells how many entries
  - rule: BR-CAP-ACC-BAT-016-04
    scenarios:
      - ATS-ACC-BAT-016-02
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#keeps
      the posting history: the first posting reversed, the second current
  - rule: BR-CAP-ACC-BAT-016-05
    scenarios:
      - ATS-ACC-BAT-016-02
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/revenue-recognition-schedules.queries.integration.spec.js#reads
      the current schedule by its id, and none once its posting is not the
      current one
  - rule: BR-CAP-ACC-BAT-016-06
    scenarios:
      - ATS-ACC-BAT-016-02
      - ATS-ACC-BAT-016-08
      - ATS-ACC-BAT-016-09
      - ATS-ACC-BAT-016-10
    provenance: proposed
    source: >-
      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
  - rule: BR-CAP-ACC-BAT-016-07
    scenarios:
      - ATS-ACC-BAT-016-03
    provenance: proposed
    source: >-
      services-accounting:modules/batches/services/rules/batch-posting-rules.ts:ensureBatchesCanBeUnposted
  - rule: BR-CAP-ACC-BAT-016-08
    scenarios:
      - ATS-ACC-BAT-016-04
      - ATS-ACC-BAT-016-14
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/close/posting-period-guard.integration.spec.js#refuses
      the batch action `unpost` (`period_not_open`), submitting no job
  - rule: BR-CAP-ACC-BAT-016-09
    scenarios:
      - ATS-ACC-BAT-016-05
      - ATS-ACC-BAT-016-11
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#writes
      one fresh set when the batch is posted again, equal in size to the first
  - rule: BR-CAP-ACC-BAT-016-10
    scenarios:
      - ATS-ACC-BAT-016-06
      - ATS-ACC-BAT-016-15
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-refusal.integration.spec.js#keeps
      the posting, its entries and the batch as they were, and fails the
      unposting step with the refusal
  - rule: BR-CAP-ACC-BAT-016-11
    scenarios:
      - ATS-ACC-BAT-016-07
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/system-batches.e2e.spec.js#answers
      an unposting naming the system batch with its job, and the job fails with
      the refusal
transition_coverage:
  - state_model: STATE-ACC-BAT-001
    transition: 9
    from: posted
    to: open
    gap: FND-ACC-BAT-070
    provenance: unknown
    source: >-
      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
    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: 10
    from: downloaded
    to: open
    gap: FND-ACC-BAT-070
    provenance: unknown
    source: >-
      services-accounting:modules/batches/services/rules/batch-rules.ts:assertBatchCanBeUnposted
    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: 11
    from: posting
    to: open
    gap: FND-ACC-BAT-070
    provenance: unknown
    source: >-
      services-accounting:modules/batches/services/rules/batch-rules.ts:BATCH_STUCK_POSTING_MINUTES
    note: >-
      The existing scenario set is not an exhaustive proof of this transition
      and all its side effects.
  - state_model: STATE-ACC-BAT-003
    transition: 1
    from: pending
    to: running
    gap: FND-ACC-BAT-070
    provenance: unknown
    source: >-
      services-accounting:modules/batches/services/jobs/batch-posting-job-tasks.ts:postBatchesOperation
    note: >-
      The existing scenario set is not an exhaustive proof of this transition
      and all its side effects.
  - state_model: STATE-ACC-BAT-003
    transition: 2
    from: running
    to: succeeded
    gap: FND-ACC-BAT-070
    provenance: unknown
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/rebuilt-posting-edges.integration.spec.js#posts
      January, puts April in error naming the application whose credit's batch
      is not posted, and May in error as April's dependent
    note: >-
      The existing scenario set is not an exhaustive proof of this transition
      and all its side effects.
  - state_model: STATE-ACC-BAT-003
    transition: 3
    from: running
    to: failed
    gap: FND-ACC-BAT-070
    provenance: unknown
    source: >-
      services-accounting:modules/batches/tests/integration/services/jobs/deployed-task-handler.integration.spec.js#fails
      the job on a step the database refuses: refused once, recorded by the
      failure task, the batch open and nothing written
    note: >-
      The existing scenario set is not an exhaustive proof of this transition
      and all its side effects.
  - state_model: STATE-ACC-BAT-003
    transition: 4
    from: pending
    to: failed
    gap: FND-ACC-BAT-070
    provenance: unknown
    source: >-
      services-accounting:modules/batches/services/jobs/batch-posting-jobs.ts:batchPostingWorkflow
    note: >-
      The existing scenario set is not an exhaustive proof of this transition
      and all its side effects.
  - state_model: STATE-ACC-BAT-003
    transition: 5
    from: running
    to: failed
    gap: FND-ACC-BAT-070
    provenance: unknown
    source: >-
      services-accounting:modules/batches/services/jobs/batch-posting-job-tasks.ts:postBatchesOperation;
      FND-ACC-BAT-039
    note: >-
      The existing scenario set is not an exhaustive proof of this transition
      and all its side effects.
  - state_model: STATE-ACC-BAT-004
    transition: 1
    from: current
    to: reversed
    gap: FND-ACC-BAT-070
    provenance: unknown
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/unpost-deletes-entries.integration.spec.js#keeps
      the posting history: the first posting reversed, the second current
    note: >-
      The existing scenario set is not an exhaustive proof of this transition
      and all its side effects.
  - state_model: STATE-ACC-BAT-005
    transition: 3
    from: open
    to: void
    gap: FND-ACC-BAT-070
    provenance: unknown
    source: >-
      services-accounting:modules/batches/services/persistence/revenue-recognition-schedules.ts:voidUnrecognizedSchedules
    note: >-
      The existing scenario set is not an exhaustive proof of this transition
      and all its side effects.
permission_coverage:
  - key: accounting.batch-postings.unpost
    surface: api
    scenarios:
      - ATS-ACC-BAT-016-01
    gap: FND-ACC-BAT-070
    provenance: unknown
    source: FND-ACC-BAT-070
    note: >-
      An aggregate persona check does not establish exhaustive allow and deny
      proof for every named surface.
executable_coverage:
  bound_scenarios: 8
  unbound_scenarios:
    - ATS-ACC-BAT-016-08
    - ATS-ACC-BAT-016-09
    - ATS-ACC-BAT-016-10
    - ATS-ACC-BAT-016-11
    - ATS-ACC-BAT-016-12
    - ATS-ACC-BAT-016-13
    - ATS-ACC-BAT-016-14
  gap: FND-ACC-BAT-070
---

# Unpost a batch for correction and replacement posting: 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-016-01` | `ATS-ACC-BAT-016-01` |
| `BR-CAP-ACC-BAT-016-02` | `ATS-ACC-BAT-016-01`, `ATS-ACC-BAT-016-15` |
| `BR-CAP-ACC-BAT-016-03` | `ATS-ACC-BAT-016-02`, `ATS-ACC-BAT-016-12`, `ATS-ACC-BAT-016-13` |
| `BR-CAP-ACC-BAT-016-04` | `ATS-ACC-BAT-016-02` |
| `BR-CAP-ACC-BAT-016-05` | `ATS-ACC-BAT-016-02` |
| `BR-CAP-ACC-BAT-016-06` | `ATS-ACC-BAT-016-02`, `ATS-ACC-BAT-016-08`, `ATS-ACC-BAT-016-09`, `ATS-ACC-BAT-016-10` |
| `BR-CAP-ACC-BAT-016-07` | `ATS-ACC-BAT-016-03` |
| `BR-CAP-ACC-BAT-016-08` | `ATS-ACC-BAT-016-04`, `ATS-ACC-BAT-016-14` |
| `BR-CAP-ACC-BAT-016-09` | `ATS-ACC-BAT-016-05`, `ATS-ACC-BAT-016-11` |
| `BR-CAP-ACC-BAT-016-10` | `ATS-ACC-BAT-016-06`, `ATS-ACC-BAT-016-15` |
| `BR-CAP-ACC-BAT-016-11` | `ATS-ACC-BAT-016-07` |

## Interactions With Related Capabilities

Recovery changes dependent lookup. Unpost restores ordinary actions. Recovery permits document reassignment. Reposting creates a fresh generation. Guarded recovery removes only its ledger. Recovery leaves history without ordinary entries. Fiscal close blocks ordinary recovery. 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.
