---
id: ATS-ACC-BAT-013
scope: CAP-ACC-BAT-013
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-013-01
    title: Submission validates access and existence
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-01
      - BR-CAP-ACC-BAT-013-02
    preconditions: A reader lacks posting access and staff can post.
    steps: >-
      Submit as the reader, then submit an empty selection and a selection
      including an unknown reference as staff.
    expected: >-
      Permission and empty-selection failures return 403 and 400; an unknown
      reference prevents job creation.
    negative: true
    data_needs: Provide security fixtures.
    bound_to:
      - TST-ACC-BAT-057
      - TST-ACC-BAT-076
      - TST-ACC-BAT-008
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-postings.e2e.spec.js#refuses
      a posting without the posting permission, 403
    category: permission
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/e2e/batch-postings.e2e.spec.js#refuses
        a posting without the posting permission, 403
      - >-
        services-accounting:modules/batches/tests/e2e/batch-postings.e2e.spec.js#refuses
        a posting that names no batch, 400
      - >-
        services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#refuses
        a posting that names one batch it has and one it does not, naming the
        missing one (DEF-ACT-0506)
      - >-
        react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0518.spec.ts#ACT-ACC-0518
  - id: ATS-ACC-BAT-013-02
    title: The console watches asynchronous posting
    level: browser
    proves:
      - BR-CAP-ACC-BAT-013-03
      - BR-CAP-ACC-BAT-013-14
    preconditions: A Closed batch contains invoices and payments.
    steps: Submit Post and follow the progress panel.
    expected: >-
      The request returns a job; its two visible stages complete and the batch
      becomes Posted.
    negative: false
    data_needs: Provide the acceptance workspace.
    bound_to:
      - TST-ACC-BAT-057
      - TST-ACC-BAT-075
      - TST-ACC-BAT-077
      - TST-ACC-BAT-007
    provenance: test
    source: >-
      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
    category: transition
    test_evidence:
      - >-
        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
      - >-
        services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-job.integration.spec.js#posts
        its batch, and its root and steps say it succeeded
      - >-
        services-accounting:modules/batches/tests/integration/services/jobs/deployed-task-handler.integration.spec.js#posts
        the batch through the deployed task function, state by state, and the
        job succeeds with both steps completed
      - >-
        react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0517.spec.ts#ACT-ACC-0517
  - id: ATS-ACC-BAT-013-03
    title: Repeated requests reuse a submission
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-04
      - INV-DOM-ACC-BAT-003-02
    preconditions: The batch is eligible for posting.
    steps: >-
      Repeat keyed and differently keyed requests while running and after
      completion, then unpost and post again.
    expected: >-
      Equivalent posting requests return the first job; unposting and the next
      posting create two additional jobs.
    negative: false
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-078
      - TST-ACC-BAT-076
      - TST-ACC-BAT-125
    provenance: test
    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)
    category: invariant
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/jobs/submission-identity.integration.spec.js#answers
        a retry that carries the same request key with the first job, and writes
        nothing again
      - >-
        services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#answers
        the job still posting the same batch with it, under another idempotency
        key (DEF-ACT-0514)
      - >-
        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/jobs/submission-identity.integration.spec.js#makes
        post, unpost and post of one batch three jobs, and leaves the batch
        posted again under a new posting
      - >-
        services-accounting:modules/batches/tests/unit/jobs/submission-identity.spec.js#is
        the same for the same request, whatever the order of its batches
  - id: ATS-ACC-BAT-013-04
    title: Action eligibility differs from engine eligibility
    level: unit
    proves:
      - BR-CAP-ACC-BAT-013-05
    preconditions: 'Batches represent Open, Closed, Error, Archived, Posted and Posting.'
    steps: >-
      Request posting through the action and engine, including successful and
      failed Error retries.
    expected: >-
      Each entry point enforces its own status set, and retry replaces the
      previous error details.
    negative: true
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to: []
    provenance: proposed
    source: FND-ACC-BAT-027
    category: edge
    test_evidence: []
    note: >-
      The available assertions do not execute this complete scenario; executable
      coverage remains a gap.
  - id: ATS-ACC-BAT-013-05
    title: Period guards apply before and during work
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-06
    preconditions: A September batch remains after its period closes.
    steps: Invoke Post and submit a job directly.
    expected: >-
      The action refuses before creating a job; the submitted job fails its
      period check and preserves the Open batch.
    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#fails
      the job with the refusal naming the period and its state
    category: validation
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/close/posting-period-guard.integration.spec.js#refuses
        the batch action `post` (`period_not_open`), submitting no job
      - >-
        services-accounting:modules/batches/tests/integration/services/close/posting-period-guard.integration.spec.js#fails
        the job with the refusal naming the period and its state
      - >-
        services-accounting:modules/batches/tests/integration/services/close/posting-period-guard.integration.spec.js#holds
        the period row FOR SHARE for the rest of the caller's transaction
      - >-
        react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0520.spec.ts#ACT-ACC-0520
  - id: ATS-ACC-BAT-013-06
    title: Locks and system types prevent posting
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-07
      - BR-CAP-ACC-BAT-013-08
    preconditions: Selections include a locked ordinary batch and a deferred-revenue batch.
    steps: 'Submit through actions and jobs, then unlock the ordinary batch and retry.'
    expected: >-
      The lock blocks ordinary attempts; the system job fails; the unlocked
      ordinary batch can post.
    negative: true
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-076
      - TST-ACC-BAT-063
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#is
      not posted by a job: the check step fails with the lock, and the batch
      stays open (DEF-ACT-0503)
    category: rule
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#is
        not posted by the action, and stays open (DEF-ACT-0503)
      - >-
        services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#is
        not posted by a job: the check step fails with the lock, and the batch
        stays open (DEF-ACT-0503)
      - >-
        services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#is
        posted once its lock is released (DEF-ACT-0503, DEF-ACT-0504)
      - >-
        services-accounting:modules/batches/tests/e2e/system-batches.e2e.spec.js#answers
        a posting naming the system batch with its job, and the job fails with
        the refusal
  - id: ATS-ACC-BAT-013-07
    title: Write failure preserves atomicity
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-09
      - INV-DOM-ACC-BAT-003-03
    preconditions: The database rejects the write stage once.
    steps: Run posting through the deployed task handler.
    expected: >-
      The failure stage records the error while leaving the batch Open without
      posting, entries or schedules.
    negative: true
    data_needs: Provide a refusing trigger in the test database.
    bound_to:
      - TST-ACC-BAT-077
    provenance: test
    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
    category: failure
    test_evidence:
      - >-
        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
  - id: ATS-ACC-BAT-013-08
    title: Failure follows dependencies without blocking unrelated batches
    level: browser
    proves:
      - BR-CAP-ACC-BAT-013-10
    preconditions: >-
      January can post; April refers to an unposted credit and May depends on
      April.
    steps: Post all three in one request.
    expected: >-
      January posts; April reports its application problem and May its
      dependency; neither failed batch writes ledger records.
    negative: true
    data_needs: Provide rebuilt documents fixtures.
    bound_to:
      - TST-ACC-BAT-107
      - TST-ACC-BAT-011
    provenance: test
    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
    category: failure
    test_evidence:
      - >-
        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
      - >-
        react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0521.spec.ts#ACT-ACC-0521
  - id: ATS-ACC-BAT-013-09
    title: Posting records time and statistics
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-11
    preconditions: >-
      The batch contains invoices, memos, a write-off and payments, including a
      voided payment.
    steps: Post and reread it.
    expected: >-
      Posting time and job are stored with per-kind base totals; the voided
      payment and reversal do not contribute.
    negative: false
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-105
      - TST-ACC-BAT-076
      - TST-ACC-BAT-135
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/rebuilt-documents.integration.spec.js#records
      the batch's statistics: the documents counted by kind and their base
      totals
    category: rule
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/rebuilt-documents.integration.spec.js#records
        the batch's statistics: the documents counted by kind and their base
        totals
      - >-
        services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#answers
        the posting job that posted it, and the time it was posted
        (DEF-ACT-0511)
      - >-
        services-accounting:modules/batches/tests/unit/rules/voided-documents-posting.spec.js#counts
        the live payments alone and drops the voided one with its reversal
  - id: ATS-ACC-BAT-013-10
    title: Empty and voided-only batches differ
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-12
    preconditions: >-
      An empty batch accompanies a populated batch and another batch contains
      only a voided payment.
    steps: Submit posting with ordinary options and with empty-deletion disabled.
    expected: >-
      The empty batch is deleted in either case; the voided-only batch posts
      without entries or errors.
    negative: false
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-107
      - TST-ACC-BAT-114
      - TST-ACC-BAT-008
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/rebuilt-posting-edges.integration.spec.js#posts
      February with its one entry, and June is gone (RS-1116)
    category: edge
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/rebuilt-posting-edges.integration.spec.js#posts
        February with its one entry, and June is gone (RS-1116)
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/voided-only-batch.integration.spec.js#posts
        the batch with no error
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/voided-only-batch.integration.spec.js#writes
        no entry for it
      - >-
        react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0518.spec.ts#ACT-ACC-0518
  - id: ATS-ACC-BAT-013-11
    title: Concurrent requests serialize posting
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-13
      - INV-DOM-ACC-BAT-003-01
    preconditions: >-
      A postable batch is held by a second database transaction that changes its
      status to Posted.
    steps: >-
      Start direct posting, observe it waiting on the row lock, commit the
      competing status change and inspect the outcome.
    expected: >-
      Posting waits and then refuses the Posted batch without writing a posting
      or entry.
    negative: true
    data_needs: Provide two browser sessions.
    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 posting wait for the batch, then refuse it as posted, with no
      posting and no entry written
    note: >-
      Independent full browser postings remain additional evidence; the
      controlled service test is the binding for this specific lock assertion.
    category: concurrency
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/posting/concurrent-posting.integration.spec.js#makes
        a direct posting wait for the batch, then refuse it as posted, with no
        posting and no entry written
  - id: ATS-ACC-BAT-013-12
    title: Descriptions do not control production behavior
    level: browser
    proves:
      - BR-CAP-ACC-BAT-013-15
    preconditions: The description contains the old SetAsError test marker.
    steps: Post the batch.
    expected: The text does not force an error.
    negative: false
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-076
      - TST-ACC-BAT-024
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#posts
      a batch whose description is a 1.0 test directive, as any other
      (DEF-ACT-0512)
    category: rule
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#posts
        a batch whose description is a 1.0 test directive, as any other
        (DEF-ACT-0512)
      - >-
        react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0537.spec.ts#ACT-ACC-0537
  - id: ATS-ACC-BAT-013-13
    title: Job actions differ from workflow retries
    level: unit
    proves:
      - BR-CAP-ACC-BAT-013-16
    preconditions: Posting and unposting job kinds are registered.
    steps: Inspect user controls and task retry configuration.
    expected: >-
      User retry and cancellation are disabled while workflow task retries
      remain configured.
    negative: false
    data_needs: Provide fixtures appropriate to the stated accounting context.
    bound_to: []
    provenance: proposed
    source: >-
      services-accounting:modules/batches/services/jobs/batch-posting-jobs.ts:ensureBatchPostingJobTypesRegistered
    category: rule
    test_evidence: []
  - id: ATS-ACC-BAT-013-14
    title: Recorded posting is distinguishable from live intake
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-002-03
      - BR-CAP-ACC-BAT-013-11
    exercises:
      - CAP-ACC-BAT-013
      - CAP-ACC-BAT-002
    workflows: []
    preconditions: One batch holds an issued invoice and an unvoided payment.
    steps: >-
      Read its live totals, post it, then read its recorded statistics and
      current totals.
    expected: >-
      The same reference is Posted with recorded posting time; live totals and
      recorded statistics can be inspected separately.
    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/batch-totals.queries.integration.spec.js#counts
      exactly the real transactions of every kind and sums their amounts;
      services-accounting:modules/batches/tests/integration/services/posting/rebuilt-documents.integration.spec.js#records
      the batch's statistics: the documents counted by kind and their base
      totals
  - id: ATS-ACC-BAT-013-15
    title: Post produces a protected completed batch
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-004-01
      - BR-CAP-ACC-BAT-013-03
    exercises:
      - CAP-ACC-BAT-013
      - CAP-ACC-BAT-004
    workflows:
      - WF-ACC-BAT-005
    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.
    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/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
  - id: ATS-ACC-BAT-013-16
    title: Scheduled close submits accounting after retirement
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-005-03
      - BR-CAP-ACC-BAT-013-03
    exercises:
      - CAP-ACC-BAT-013
      - CAP-ACC-BAT-005
    workflows:
      - WF-ACC-BAT-002
    preconditions: Morning is Open with an invoice and a due close.
    steps: Deliver the occurrence and inspect its outcome and the submitted job.
    expected: >-
      Morning closes and the run identifies one posting request for the retired
      collection.
    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#submits
      one posting job of the closed batch, in its unit, for the tenant’s
      customer (D13);
      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
  - id: ATS-ACC-BAT-013-17
    title: Posting prevents ordinary deletion
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-006-02
      - BR-CAP-ACC-BAT-013-03
    exercises:
      - CAP-ACC-BAT-013
      - CAP-ACC-BAT-006
    workflows: []
    preconditions: Morning contains one eligible invoice.
    steps: 'Post Morning, then attempt deletion and reread its posting and entry.'
    expected: Deletion returns 409 and the Posted batch and its current entry remain.
    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#refuses
      deleting a posted 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
  - id: ATS-ACC-BAT-013-18
    title: Posting freezes document placement
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-007-04
      - BR-CAP-ACC-BAT-013-03
    exercises:
      - CAP-ACC-BAT-013
      - CAP-ACC-BAT-007
    workflows: []
    preconditions: A draft invoice and two Open batches exist in one unit.
    steps: 'Issue into Morning, post Morning, then try to move the invoice to Evening.'
    expected: The move is refused and the invoice and its entry still identify Morning.
    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/posting/rebuilt-documents.integration.spec.js#refuses,
      in the database, moving a document out of a posted batch (RHA05);
      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
  - id: ATS-ACC-BAT-013-19
    title: Posting resolves waiting attention
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-008-04
      - BR-CAP-ACC-BAT-013-03
    exercises:
      - CAP-ACC-BAT-013
      - CAP-ACC-BAT-008
    workflows: []
    preconditions: >-
      Attention publication is enabled and Morning is Closed with one eligible
      invoice.
    steps: 'Inspect the waiting item, post Morning and inspect the item again.'
    expected: Morning is Posted and its waiting item is resolved.
    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/batch-attention-items.integration.spec.js#resolves
      a reopened batch reopened, and its next close opens the second generation;
      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
  - id: ATS-ACC-BAT-013-20
    title: Reactivation and rolling have distinct posting effects
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-009-06
      - BR-CAP-ACC-BAT-013-03
    exercises:
      - CAP-ACC-BAT-013
      - CAP-ACC-BAT-009
    workflows:
      - WF-ACC-BAT-003
    preconditions: Two inactive streams each retain a populated Open predecessor.
    steps: >-
      Reactivate the first and roll the second after activation using separate
      fixtures.
    expected: >-
      Reactivation can retire intake without a posting request; the subsequent
      roll records the predecessor’s posting request or refusal.
    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/roll/batch-roller.integration.spec.js#saves
      a recurring batch whose first batch is refused, with the refusal and no
      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
  - id: ATS-ACC-BAT-013-21
    title: Readiness does not reserve eligibility
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-012-06
      - BR-CAP-ACC-BAT-013-06
    exercises:
      - CAP-ACC-BAT-013
      - CAP-ACC-BAT-012
    workflows: []
    preconditions: Morning has a valid invoice in an Open period.
    steps: >-
      Preview Morning, close its fiscal period using a controlled fixture and
      request posting.
    expected: >-
      The earlier preview is eligible; the later action refuses the changed
      fiscal state without creating a job.
    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/services/engine/preview-batches.ts:periodProblemOf;
      services-accounting:modules/batches/services/persistence/posting-periods.ts:lockPostingPeriodForDate;
      services-accounting:modules/batches/services/actions/batch-actions.ts:postBatch;
      services-accounting:modules/batches/services/engine/engine-scope.ts:lockBatchesForPosting
  - id: ATS-ACC-BAT-013-22
    title: Account refusal leaves no partial ledger
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-10
      - BR-CAP-ACC-BAT-014-03
    exercises:
      - CAP-ACC-BAT-013
      - CAP-ACC-BAT-014
    workflows:
      - WF-ACC-BAT-005
    preconditions: >-
      Morning holds an issued invoice whose product and unit have no revenue
      account.
    steps: >-
      Submit posting and inspect the batch, entries and the line’s resolution
      error.
    expected: >-
      Morning is Error with an identifying account reason and no current
      entries.
    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/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;
      services-accounting:modules/batches/tests/integration/services/posting/gl-resolution-at-posting.integration.spec.js#fails
      the batch’s validation with an error naming the invoice, the missing
      accounts receivable account, the product’s setup and the unit’s default
  - id: ATS-ACC-BAT-013-23
    title: Dependency failure differs from whole-job failure
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-10
      - BR-CAP-ACC-BAT-015-10
    exercises:
      - CAP-ACC-BAT-013
      - CAP-ACC-BAT-015
    workflows:
      - WF-ACC-BAT-005
    preconditions: >-
      January is valid, April depends on an unposted credit and May depends on
      April.
    steps: 'Submit all three and inspect job, batch states and entries.'
    expected: >-
      January is Posted; April and May are Error without entries, with their
      respective reasons.
    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/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;
      services-accounting:modules/batches/tests/integration/services/posting/rebuilt-documents.integration.spec.js#refuses
      November alone while October is open: November in error, naming the memo's
      invoice and October's status
  - id: ATS-ACC-BAT-013-24
    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-013
      - CAP-ACC-BAT-016
    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-013-25
    title: Successful posting owns a revenue plan
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-03
      - BR-CAP-ACC-BAT-019-01
    exercises:
      - CAP-ACC-BAT-013
      - CAP-ACC-BAT-019
    workflows:
      - WF-ACC-BAT-005
    preconditions: Morning contains one deferred invoice line.
    steps: >-
      Post Morning and inspect the invoice line’s revenue view and posting
      history.
    expected: >-
      The current plan identifies the completed posting and its scheduled amount
      can be inspected.
    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/batch-postings.e2e.spec.js#posts
      a batch as a durable job: the answer is the job, and the job posts the
      batch;
      services-accounting:modules/batches/tests/integration/services/posting/rebuilt-deferral.integration.spec.js#writes
      H a schedule of three monthly entries on the firsts of October, November
      and December, summing to 300.00
  - id: ATS-ACC-BAT-013-26
    title: Submission checks request limits before job creation
    category: boundary
    level: api
    proves:
      - BR-CAP-ACC-BAT-013-02
    preconditions: One hundred postable collections belong to an isolated unit.
    steps: >-
      Submit one and one hundred references, then zero and one hundred one,
      using owned request identities.
    expected: >-
      Supported submissions return jobs; unsupported sizes return 400 without an
      additional job.
    negative: true
    data_needs: >-
      Owned records in an isolated workspace with the stated calendar and
      accounting setup.
    bound_to: []
    provenance: proposed
    source: >-
      services-accounting:modules/batches/services/jobs/batch-posting-jobs.ts:createBatchJob;
      services-accounting:modules/batches/services/rules/batch-posting-rules.ts:ensureBatchesCanBePosted
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-0517,
      0518, 0519, 0520, 0521, 0537).
  - >-
    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-067'
  validation: covered
  permission: 'gap: FND-ACC-BAT-067'
  edge: covered
  failure: covered
  boundary: covered
  concurrency: covered
  invariant: covered
  interaction: covered
coverage_notes:
  boundary: >-
    All named-action and engine starting states, start failure leaving Pending,
    settlement failure after commit, request-unit mismatch and exact selection
    limits remain unproved.
rule_coverage:
  - rule: BR-CAP-ACC-BAT-013-01
    scenarios:
      - ATS-ACC-BAT-013-01
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-postings.e2e.spec.js#refuses
      a posting without the posting permission, 403
  - rule: BR-CAP-ACC-BAT-013-02
    scenarios:
      - ATS-ACC-BAT-013-01
      - ATS-ACC-BAT-013-26
    provenance: proposed
    source: >-
      services-accounting:modules/batches/services/jobs/batch-posting-jobs.ts:createBatchJob;
      services-accounting:modules/batches/services/rules/batch-posting-rules.ts:ensureBatchesCanBePosted
  - rule: BR-CAP-ACC-BAT-013-03
    scenarios:
      - ATS-ACC-BAT-013-02
      - ATS-ACC-BAT-013-15
      - ATS-ACC-BAT-013-16
      - ATS-ACC-BAT-013-17
      - ATS-ACC-BAT-013-18
      - ATS-ACC-BAT-013-19
      - ATS-ACC-BAT-013-20
      - ATS-ACC-BAT-013-25
    provenance: proposed
    source: >-
      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
  - rule: BR-CAP-ACC-BAT-013-04
    scenarios:
      - ATS-ACC-BAT-013-03
      - ATS-ACC-BAT-013-24
    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)
  - rule: BR-CAP-ACC-BAT-013-05
    scenarios:
      - ATS-ACC-BAT-013-04
    provenance: proposed
    source: >-
      services-accounting:modules/batches/services/rules/batch-rules.ts:assertBatchCanBePosted;
      services-accounting:modules/batches/services/rules/batch-posting-rules.ts:ensureBatchesCanBePosted
  - rule: BR-CAP-ACC-BAT-013-06
    scenarios:
      - ATS-ACC-BAT-013-05
      - ATS-ACC-BAT-013-21
    provenance: proposed
    source: >-
      services-accounting:modules/batches/services/actions/batch-actions.ts:postBatch;
      services-accounting:modules/batches/services/engine/engine-scope.ts:lockBatchesForPosting
  - rule: BR-CAP-ACC-BAT-013-07
    scenarios:
      - ATS-ACC-BAT-013-06
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#is
      not posted by a job: the check step fails with the lock, and the batch
      stays open (DEF-ACT-0503)
  - rule: BR-CAP-ACC-BAT-013-08
    scenarios:
      - ATS-ACC-BAT-013-06
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/system-batches.e2e.spec.js#answers
      a posting naming the system batch with its job, and the job fails with the
      refusal
  - rule: BR-CAP-ACC-BAT-013-09
    scenarios:
      - ATS-ACC-BAT-013-07
    provenance: proposed
    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
  - rule: BR-CAP-ACC-BAT-013-10
    scenarios:
      - ATS-ACC-BAT-013-08
      - ATS-ACC-BAT-013-22
      - ATS-ACC-BAT-013-23
    provenance: proposed
    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
  - rule: BR-CAP-ACC-BAT-013-11
    scenarios:
      - ATS-ACC-BAT-013-09
      - ATS-ACC-BAT-013-14
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/rebuilt-documents.integration.spec.js#records
      the batch's statistics: the documents counted by kind and their base
      totals
  - rule: BR-CAP-ACC-BAT-013-12
    scenarios:
      - ATS-ACC-BAT-013-10
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/rebuilt-posting-edges.integration.spec.js#posts
      February with its one entry, and June is gone (RS-1116)
  - rule: BR-CAP-ACC-BAT-013-13
    scenarios:
      - ATS-ACC-BAT-013-11
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/concurrent-posting.integration.spec.js#makes
      a direct posting wait for the batch, then refuse it as posted, with no
      posting and no entry written
  - rule: BR-CAP-ACC-BAT-013-15
    scenarios:
      - ATS-ACC-BAT-013-12
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/jobs/batch-posting-record.integration.spec.js#posts
      a batch whose description is a 1.0 test directive, as any other
      (DEF-ACT-0512)
  - rule: BR-CAP-ACC-BAT-013-16
    scenarios:
      - ATS-ACC-BAT-013-13
    provenance: proposed
    source: >-
      services-accounting:modules/batches/services/jobs/batch-posting-jobs.ts:ensureBatchPostingJobTypesRegistered
transition_coverage:
  - state_model: STATE-ACC-BAT-001
    transition: 2
    from: open
    to: posting
    gap: FND-ACC-BAT-067
    provenance: unknown
    source: >-
      services-accounting:modules/batches/services/engine/post-batches.ts:postBatches
    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: 3
    from: closed
    to: posting
    gap: FND-ACC-BAT-067
    provenance: unknown
    source: >-
      services-accounting:modules/batches/services/engine/post-batches.ts:postBatches
    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: 4
    from: error
    to: posting
    gap: FND-ACC-BAT-067
    provenance: unknown
    source: >-
      services-accounting:modules/batches/tests/unit/rules/batch-repost-rules.spec.js#admits
      an open, a closed and an errored batch
    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: 5
    from: verified
    to: posting
    gap: FND-ACC-BAT-067
    provenance: unknown
    source: >-
      services-accounting:modules/batches/services/rules/batch-posting-rules.ts:ensureBatchesCanBePosted
    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: 6
    from: posting
    to: posted
    gap: FND-ACC-BAT-067
    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-001
    transition: 7
    from: posting
    to: error
    gap: FND-ACC-BAT-067
    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-001
    transition: 8
    from: posting
    to: deleted
    gap: FND-ACC-BAT-067
    provenance: unknown
    source: >-
      services-accounting:modules/batches/tests/integration/services/posting/rebuilt-posting-edges.integration.spec.js#posts
      February with its one entry, and June is gone (RS-1116)
    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-067
    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-067
    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-067
    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-067
    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-067
    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.
permission_coverage:
  - key: accounting.batch-postings.post
    surface: api
    scenarios:
      - ATS-ACC-BAT-013-01
    gap: FND-ACC-BAT-067
    provenance: unknown
    source: FND-ACC-BAT-067
    note: >-
      An aggregate persona check does not establish exhaustive allow and deny
      proof for every named surface.
executable_coverage:
  bound_scenarios: 11
  unbound_scenarios:
    - ATS-ACC-BAT-013-04
    - ATS-ACC-BAT-013-13
    - ATS-ACC-BAT-013-14
    - ATS-ACC-BAT-013-15
    - ATS-ACC-BAT-013-16
    - ATS-ACC-BAT-013-17
    - ATS-ACC-BAT-013-18
    - ATS-ACC-BAT-013-19
    - ATS-ACC-BAT-013-20
    - ATS-ACC-BAT-013-21
    - ATS-ACC-BAT-013-22
    - ATS-ACC-BAT-013-23
    - ATS-ACC-BAT-013-24
    - ATS-ACC-BAT-013-25
    - ATS-ACC-BAT-013-26
  gap: FND-ACC-BAT-067
---

# Run and monitor a batch posting job: 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-013-01` | `ATS-ACC-BAT-013-01` |
| `BR-CAP-ACC-BAT-013-02` | `ATS-ACC-BAT-013-01`, `ATS-ACC-BAT-013-26` |
| `BR-CAP-ACC-BAT-013-03` | `ATS-ACC-BAT-013-02`, `ATS-ACC-BAT-013-15`, `ATS-ACC-BAT-013-16`, `ATS-ACC-BAT-013-17`, `ATS-ACC-BAT-013-18`, `ATS-ACC-BAT-013-19`, `ATS-ACC-BAT-013-20`, `ATS-ACC-BAT-013-25` |
| `BR-CAP-ACC-BAT-013-04` | `ATS-ACC-BAT-013-03`, `ATS-ACC-BAT-013-24` |
| `BR-CAP-ACC-BAT-013-05` | `ATS-ACC-BAT-013-04` |
| `BR-CAP-ACC-BAT-013-06` | `ATS-ACC-BAT-013-05`, `ATS-ACC-BAT-013-21` |
| `BR-CAP-ACC-BAT-013-07` | `ATS-ACC-BAT-013-06` |
| `BR-CAP-ACC-BAT-013-08` | `ATS-ACC-BAT-013-06` |
| `BR-CAP-ACC-BAT-013-09` | `ATS-ACC-BAT-013-07` |
| `BR-CAP-ACC-BAT-013-10` | `ATS-ACC-BAT-013-08`, `ATS-ACC-BAT-013-22`, `ATS-ACC-BAT-013-23` |
| `BR-CAP-ACC-BAT-013-11` | `ATS-ACC-BAT-013-09`, `ATS-ACC-BAT-013-14` |
| `BR-CAP-ACC-BAT-013-12` | `ATS-ACC-BAT-013-10` |
| `BR-CAP-ACC-BAT-013-13` | `ATS-ACC-BAT-013-11` |
| `BR-CAP-ACC-BAT-013-15` | `ATS-ACC-BAT-013-12` |
| `BR-CAP-ACC-BAT-013-16` | `ATS-ACC-BAT-013-13` |

## Interactions With Related Capabilities

Recorded posting is distinguishable from live intake. Post produces a protected completed batch. Scheduled close submits accounting after retirement. Posting prevents ordinary deletion. Posting freezes document placement. Posting resolves waiting attention. Reactivation and rolling have distinct posting effects. Readiness does not reserve eligibility. Account refusal leaves no partial ledger. Dependency failure differs from whole-job failure. Reposting creates a fresh generation. Successful posting owns a revenue plan. 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.
