---
id: CAP-ACC-BAT-012
title: Inspect posting readiness before submission
feature: FEAT-ACC-BAT-03
product_area: accounting
module: batches
revision: 1
status: draft
product_intent: proposed
implementation_evidence: observed
supersedes:
- inventory CAP-ACC-BAT-009
- inventory RUL-ACC-BAT-026
source_sha:
  services-accounting: f47cb263875bbc0c5640fba7dae6785ec32695f8
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
intent_sources: []
purpose: Staff inspect the problems preview can detect before asking for a posting.
outcomes:
- Readers receive generation problems while recognizing that execution applies additional safeguards.
concepts:
- CON-ACC-BAT-003
actors:
- ACT-ACC-012
- ACT-ACC-007
surfaces:
- console
- api
permissions:
- key: accounting.batch-postings.preview
  where_checked: api
  scope: tenant
rules:
- id: BR-CAP-ACC-BAT-012-01
  proved_by: [ATS-ACC-BAT-012-01, TST-ACC-BAT-057, TST-ACC-BAT-124]
  statement: Preview requires its own read permission, available to readers and auditors.
  kind: permission
  enforced_at:
  - api
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/e2e/batch-postings.e2e.spec.js#refuses a preview without the
    preview permission, 403
  origin: none
- id: BR-CAP-ACC-BAT-012-02
  proved_by: [ATS-ACC-BAT-012-01, ATS-ACC-BAT-012-06, TST-ACC-BAT-057, TST-ACC-BAT-124]
  statement: A preview request must identify between one and one hundred batches.
  kind: validation
  enforced_at:
  - api
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/e2e/batch-postings.e2e.spec.js#refuses a preview that names
    no batch, 400
  origin: none
- id: BR-CAP-ACC-BAT-012-03
  proved_by: [ATS-ACC-BAT-012-02, ATS-ACC-BAT-012-05, ATS-ACC-BAT-014-08]
  statement: Preview identifies missing, already posted, system and non-open-period batches plus generation failures
    such as missing accounts, stored rates or document dependencies, without applying every state and lock guard.
  kind: validation
  enforced_at:
  - service
  must_prove: true
  provenance: observed
  source: services-accounting:modules/batches/services/engine/preview-batches.ts:previewBatchPostings
  origin: none
- id: BR-CAP-ACC-BAT-012-04
  proved_by: [ATS-ACC-BAT-012-02]
  statement: Posted and Downloaded batches receive the already-posted explanation ahead of any other preview explanation.
  kind: validation
  enforced_at:
  - service
  must_prove: true
  provenance: test
  source: services-accounting:modules/batches/tests/unit/rules/batch-posting-preview-rules.spec.js#says already
    posted, whatever other reason it has, for a posted batch
  origin: none
- id: BR-CAP-ACC-BAT-012-05
  proved_by: []
  statement: Preview gathers invoice products and identifies those without financial configuration.
  kind: calculation
  enforced_at:
  - service
  must_prove: false
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/posting/rebuilt-documents.integration.spec.js#names
    the products of its invoices, and the late fee as the product without a financial configuration
  origin: none
- id: BR-CAP-ACC-BAT-012-06
  proved_by: [ATS-ACC-BAT-012-03, ATS-ACC-BAT-012-04, ATS-ACC-BAT-013-21]
  statement: Preview mutates no batch or ledger record but holds shared fiscal-period locks until its read transaction
    finishes.
  kind: invariant
  enforced_at:
  - service
  must_prove: true
  provenance: observed
  source: services-accounting:modules/batches/services/engine/preview-batches.ts:periodProblemOf; services-accounting:modules/batches/services/persistence/posting-periods.ts:lockPostingPeriodForDate
  origin: none
- id: BR-CAP-ACC-BAT-012-07
  proved_by: []
  statement: An otherwise eligible Error batch appears in the posting candidates with its previous error messages.
  kind: validation
  enforced_at:
  - service
  must_prove: false
  provenance: test
  source: services-accounting:modules/batches/tests/unit/rules/batch-repost-rules.spec.js#lists it to post with
    its previous errors, not as ineligible
  origin: none
scenarios:
- id: SC-CAP-ACC-BAT-012-01
  given: An invoice needs revenue accounting missing from both product and unit.
  when: Staff request a posting preview.
  then: The result reports the same missing-account cause as posting generation.
  provenance: test
  source: services-accounting:modules/batches/tests/integration/services/posting/gl-resolution-at-posting.integration.spec.js#names
    the same reason in the preview
- id: SC-CAP-ACC-BAT-012-02
  given: Preview finds no blocking issue for the receivables batch.
  when: Staff open its page.
  then: The documented readiness message reports that the preview found no blocker.
  provenance: documented
  source: services-accounting:docs/milestones/walkthroughs/ACCT-M3-handoff.md#Start here (step 2)
edge_cases: []
constraints:
- The posting task function supplies preview using the generation logic.
depends_on: []
related:
- CAP-ACC-BAT-013
- CAP-ACC-BAT-014
journeys:
- JNY-ACC-BAT-001
- JNY-ACC-BAT-004
open_questions: []
evidence:
- 'Pinned services-accounting (f47cb263), examined sources: aws/api/batch-postings.routes.ts (previewBatchPostings),
  services/preview/batch-posting-preview.ts, services/engine/preview-batches.ts, services/rules/batch-posting-rules.ts;
  tests e2e/batch-postings.e2e.spec.js, unit/rules/batch-posting-preview-rules.spec.js, unit/rules/batch-repost-rules.spec.js,
  unit/jobs/submission-execution-split.spec.js, integration/services/posting/gl-resolution-at-posting.integration.spec.js,
  rebuilt-documents.integration.spec.js, foreign-currency-invoice.integration.spec.js.'
- 'Pinned react-console (baf6dae3), examined sources: components/accounting/batches/batch-validation-card.tsx, batch-posting-readiness.tsx;
  journeys ACT-ACC-0521, 0546.'
controls: [TC-IAM-001, TC-IAM-002, TC-IAM-004, TC-IAM-005, TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-006, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-DAT-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-PI-001, TC-PI-003]
exercised_by: [FAS-ACC-BAT-03-01, FAS-ACC-BAT-03-02, FAS-ACC-BAT-03-04]
suites: [TST-ACC-BAT-057, TST-ACC-BAT-124]
---

# Inspect posting readiness before submission

## Purpose

Staff inspect the problems preview can detect before asking for a posting.

## How It Works

Staff request validation from the batch page before posting. The task function runs the posting generation logic as a preview. It returns the batches and configuration problems found by the checks it performs. The console presents those explanations alongside readiness information. Preview creates no accounting records, although its fiscal-period read can hold a shared lock. Passing preview still leaves status and lock checks for the posting itself.

## Relationships

- Related outcome: Run and monitor a batch posting job, which addresses the connected batch work.
- Related outcome: Resolve posting accounts and retain their snapshots, which addresses the connected batch work.
