---
id: ATS-ACC-BAT-011
scope: CAP-ACC-BAT-011
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-011-01
    title: Assignment settings cap the ordered list
    level: api
    proves:
      - BR-CAP-ACC-BAT-011-01
    preconditions: The unit has recurring configurations available for assignment.
    steps: Save one hundred rules and then one hundred one.
    expected: >-
      The supported count succeeds; the oversized set returns 400 and preserves
      the prior rules.
    negative: true
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-056
      - TST-ACC-BAT-080
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
      400 to 101 rules
    category: boundary
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#accepts
        100 rules, the most a unit’s settings hold
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
        400 to 101 rules
      - >-
        services-accounting:modules/batches/tests/integration/services/persistence/batch-assignment-settings.integration.spec.js#refuses
        a 101st rule, by the database’s rule, leaving the previous rules
  - id: ATS-ACC-BAT-011-02
    title: Replacement is atomic
    level: api
    proves:
      - BR-CAP-ACC-BAT-011-02
    preconditions: Saved settings contain three rules.
    steps: >-
      Replace them with two reordered rules, then force a database refusal
      during replacement.
    expected: >-
      The successful save leaves exactly two numbered rules; the failed save
      preserves the entire previous configuration.
    negative: true
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to: []
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batch-assignment-settings.integration.spec.js#keeps
      the previous settings and rules after the database refused a rule the save
      had already replaced them with
    category: invariant
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#replaces
        the rules whole: the two sent, renumbered in their new order
      - >-
        services-accounting:modules/batches/tests/integration/services/persistence/batch-assignment-settings.integration.spec.js#removes
        the rules the shorter list no longer holds
      - >-
        services-accounting:modules/batches/tests/integration/services/persistence/batch-assignment-settings.integration.spec.js#keeps
        the previous settings and rules after the database refused a rule the
        save had already replaced them with
    note: >-
      The available assertions do not execute this complete scenario; executable
      coverage remains a gap.
  - id: ATS-ACC-BAT-011-03
    title: Settings versions govern subsequent saves
    level: api
    proves:
      - BR-CAP-ACC-BAT-011-03
    preconditions: The unit has no saved settings.
    steps: >-
      Read, create, then save with no version, an old version and the current
      version.
    expected: >-
      Read returns 404; creation starts version one; missing and stale versions
      return 400 and 409; the current version advances.
    negative: true
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-056
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
      409 StaleObject to a save at the version first read
    category: concurrency
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
        404 to a read of its settings
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#creates
        the settings and answers the rules numbered from 1 in the order sent,
        every empty criterion null
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
        400 to a save without sys_version
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
        409 StaleObject to a save at the version first read
  - id: ATS-ACC-BAT-011-04
    title: Rule references stay inside the unit
    level: api
    proves:
      - BR-CAP-ACC-BAT-011-04
      - INV-DOM-ACC-BAT-001-10
    preconditions: 'Two units each have recurring, merchant and bank configuration.'
    steps: >-
      Save the first unit’s default and rules using the second unit’s
      references.
    expected: Each request identifies the invalid reference without creating settings.
    negative: true
    data_needs: Provide two units.
    bound_to:
      - TST-ACC-BAT-056
      - TST-ACC-BAT-080
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
      400 to another unit’s recurring batch in a rule
    category: validation
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
        400 to another unit’s recurring batch as the default
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
        400 to another unit’s recurring batch in a rule
      - >-
        services-accounting:modules/batches/tests/integration/services/persistence/batch-assignment-settings.integration.spec.js#refuses
        a rule naming another unit’s merchant account, naming the rule
      - >-
        services-accounting:modules/batches/tests/integration/services/persistence/batch-assignment-settings.integration.spec.js#refuses
        a rule naming another unit’s bank account, naming the rule
  - id: ATS-ACC-BAT-011-05
    title: Criteria reject incompatible or unknown fields
    level: api
    proves:
      - BR-CAP-ACC-BAT-011-05
      - BR-CAP-ACC-BAT-011-06
    preconditions: The unit already has settings.
    steps: Submit both account kinds in one rule and an unsupported criterion.
    expected: Validation refuses both requests without replacing the prior rules.
    negative: true
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-056
      - TST-ACC-BAT-066
      - TST-ACC-BAT-126
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
      400 naming bank_account_id to a rule naming both a merchant and a bank
      account
    category: validation
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
        400 naming bank_account_id to a rule naming both a merchant and a bank
        account
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
        400 to a transaction type the vocabulary does not have
      - >-
        services-accounting:modules/batches/tests/integration/db/batches.table.integration.spec.js#refuses
        a rule naming both a merchant and a bank account
      - >-
        services-accounting:modules/batches/tests/unit/rules/batch-assignment-rules.spec.js#treats
        an empty criterion as any value
  - id: ATS-ACC-BAT-011-06
    title: First matching rule wins
    level: unit
    proves:
      - BR-CAP-ACC-BAT-011-07
      - BR-CAP-ACC-BAT-011-08
    preconditions: Several saved rules can match the submitted transaction.
    steps: Evaluate matching facts and facts that miss every rule.
    expected: >-
      The earliest match selects its configuration; unmatched facts use the
      default.
    negative: false
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-126
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/unit/rules/batch-assignment-rules.spec.js#answers
      the first matching rule by position, whatever order the rules are listed
      in
    category: rule
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/unit/rules/batch-assignment-rules.spec.js#answers
        the first matching rule by position, whatever order the rules are listed
        in
      - >-
        services-accounting:modules/batches/tests/unit/rules/batch-assignment-rules.spec.js#requires
        every stated criterion to match
      - >-
        services-accounting:modules/batches/tests/unit/rules/batch-assignment-rules.spec.js#matches
        a bank-account rule only for the same bank account
      - >-
        services-accounting:modules/batches/tests/unit/rules/batch-assignment-rules.spec.js#does
        not match a stated payment type when the transaction has none
      - >-
        services-accounting:modules/batches/tests/unit/rules/batch-assignment-rules.spec.js#answers
        the default, with no rule position, when there are no rules
  - id: ATS-ACC-BAT-011-07
    title: Document intake uses assignment when no batch is supplied
    level: browser
    proves:
      - BR-CAP-ACC-BAT-011-09
    preconditions: >-
      Invoice and check criteria select recurring configurations and a default
      exists.
    steps: >-
      Issue an invoice and check without explicit batches, then delete settings
      and submit another payment.
    expected: >-
      The first documents use the selected current batches; the last request
      fails because a batch is required.
    negative: true
    data_needs: Provide recurring batches with open batches.
    bound_to:
      - TST-ACC-BAT-004
      - TST-ACC-BAT-074
    provenance: test
    source: >-
      react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0510.spec.ts#ACT-ACC-0510
    category: interaction
    test_evidence:
      - >-
        react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0510.spec.ts#ACT-ACC-0510
      - >-
        services-accounting:modules/batches/tests/integration/services/close/system-batch-guard.integration.spec.js#refuses
        the system batch as a default batch (BA-12)
  - id: ATS-ACC-BAT-011-08
    title: Evaluation reports the chosen position
    level: api
    proves:
      - BR-CAP-ACC-BAT-011-10
    preconditions: One unit has settings and another has none.
    steps: 'Evaluate facts for both, then omit transaction type.'
    expected: >-
      The configured unit returns its selection and winning position, with no
      position for the default; missing settings return 404 and missing type
      returns 400.
    negative: true
    data_needs: Provide no fixtures beyond the stated setup.
    bound_to:
      - TST-ACC-BAT-056
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
      the first rule by position when two rules match
    category: rule
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
        the first rule by position when two rules match
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
        the default with no position when no rule matches
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
        404 to an evaluation
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
        400 to facts without a transaction type
  - id: ATS-ACC-BAT-011-09
    title: Readers cannot replace or delete settings
    level: api
    proves:
      - BR-CAP-ACC-BAT-011-11
    preconditions: A reader and administrator share saved settings.
    steps: >-
      Read, evaluate, save and delete as the reader, then delete settings and
      the default recurring configuration as administrator.
    expected: >-
      Reader reads succeed and writes return 403; administrator deletion removes
      rules and releases the referenced configuration.
    negative: true
    data_needs: Provide security fixtures.
    bound_to:
      - TST-ACC-BAT-059
      - TST-ACC-BAT-056
    provenance: test
    source: >-
      services-accounting:modules/batches/tests/e2e/batches-security.e2e.spec.js#is
      refused the save 403 permission_missing
    category: permission
    test_evidence:
      - >-
        services-accounting:modules/batches/tests/e2e/batches-security.e2e.spec.js#reads
        a unit’s batch assignment settings
      - >-
        services-accounting:modules/batches/tests/e2e/batches-security.e2e.spec.js#is
        refused the save 403 permission_missing
      - >-
        services-accounting:modules/batches/tests/e2e/batches-security.e2e.spec.js#is
        refused the delete 403 permission_missing
      - >-
        services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#frees
        the recurring batches the settings named: the default deletes now
  - id: ATS-ACC-BAT-011-10
    title: Default selection respects document and order precedence
    level: unit
    proves:
      - BR-CAP-ACC-BAT-011-12
    preconditions: One document is pro forma and another references an Open order batch.
    steps: 'Resolve each default, close the order batch and resolve again.'
    expected: >-
      Pro forma has no batch; the Open order batch wins before assignment;
      closing it restores assignment selection.
    negative: false
    data_needs: Provide fixtures appropriate to the stated accounting context.
    bound_to: []
    provenance: proposed
    source: >-
      services-accounting:modules/batches/services/rules/batch-rules.ts:defaultBatchOf
    category: edge
    test_evidence: []
    note: >-
      The available assertions do not execute this complete scenario; executable
      coverage remains a gap.
  - id: ATS-ACC-BAT-011-11
    title: Routing selection must pass intake checks
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-007-10
      - BR-CAP-ACC-BAT-011-09
    exercises:
      - CAP-ACC-BAT-011
      - CAP-ACC-BAT-007
    workflows:
      - WF-ACC-BAT-010
    preconditions: Routing selects Daily and its active batch is Closed.
    steps: >-
      Evaluate invoice facts and then issue an invoice without an explicit
      batch.
    expected: >-
      Evaluation identifies Daily; issuance refuses the Closed intake and saves
      no issued invoice.
    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/system-batch-guard.integration.spec.js#refuses
      the system batch as a default batch (BA-12);
      react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0510.spec.ts#ACT-ACC-0510
  - id: ATS-ACC-BAT-011-12
    title: Routing references prevent stream removal
    category: interaction
    level: api
    proves:
      - BR-CAP-ACC-BAT-009-09
      - BR-CAP-ACC-BAT-011-11
    exercises:
      - CAP-ACC-BAT-011
      - CAP-ACC-BAT-009
    workflows: []
    preconditions: Routing names Daily as its default and Cards in its first rule.
    steps: >-
      Try deleting both streams, remove routing and repeat deletion with unused
      intake.
    expected: >-
      The referenced deletes return 409; after routing removal the unused
      streams can be deleted.
    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/recurring-batches.e2e.spec.js#answers
      409 naming the settings and how they name it;
      services-accounting:modules/batches/tests/e2e/batches-security.e2e.spec.js#is
      refused the save 403 permission_missing
  - id: ATS-ACC-BAT-011-13
    title: Criteria vocabulary rejects repeated values
    category: validation
    level: api
    proves:
      - BR-CAP-ACC-BAT-011-06
    preconditions: Routing already contains one saved rule.
    steps: >-
      Replace it with criteria containing a repeated payment type and then an
      unknown card type.
    expected: >-
      Both saves return validation refusals and the previous routing list
      remains unchanged.
    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/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
      400 to a transaction type the vocabulary does not have
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-0510.spec.ts.
  - >-
    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: not-applicable
  validation: covered
  permission: 'gap: FND-ACC-BAT-065'
  edge: covered
  failure: 'gap: FND-ACC-BAT-065'
  boundary: covered
  concurrency: covered
  invariant: covered
  interaction: covered
coverage_notes:
  transition: >-
    This capability has no independent lifecycle transition; state changes
    belong to the related lifecycle, posting or fiscal capability.
  failure: >-
    Concurrent replacements, rollback during rule writes, vocabulary duplication
    and missing companion facts need focused proof; native order precedence
    remains a known binding gap.
rule_coverage:
  - rule: BR-CAP-ACC-BAT-011-01
    scenarios:
      - ATS-ACC-BAT-011-01
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
      400 to 101 rules
  - rule: BR-CAP-ACC-BAT-011-02
    scenarios:
      - ATS-ACC-BAT-011-02
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/integration/services/persistence/batch-assignment-settings.integration.spec.js#keeps
      the previous settings and rules after the database refused a rule the save
      had already replaced them with
  - rule: BR-CAP-ACC-BAT-011-03
    scenarios:
      - ATS-ACC-BAT-011-03
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
      409 StaleObject to a save at the version first read
  - rule: BR-CAP-ACC-BAT-011-04
    scenarios:
      - ATS-ACC-BAT-011-04
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
      400 to another unit’s recurring batch in a rule
  - rule: BR-CAP-ACC-BAT-011-05
    scenarios:
      - ATS-ACC-BAT-011-05
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
      400 naming bank_account_id to a rule naming both a merchant and a bank
      account
  - rule: BR-CAP-ACC-BAT-011-06
    scenarios:
      - ATS-ACC-BAT-011-05
      - ATS-ACC-BAT-011-13
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
      400 to a transaction type the vocabulary does not have
  - rule: BR-CAP-ACC-BAT-011-07
    scenarios:
      - ATS-ACC-BAT-011-06
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/unit/rules/batch-assignment-rules.spec.js#answers
      the first matching rule by position, whatever order the rules are listed
      in
  - rule: BR-CAP-ACC-BAT-011-08
    scenarios:
      - ATS-ACC-BAT-011-06
    provenance: proposed
    source: >-
      services-accounting:modules/batches/services/rules/batch-assignment-rules.ts
      (assignment contract in file header)
  - rule: BR-CAP-ACC-BAT-011-09
    scenarios:
      - ATS-ACC-BAT-011-07
      - ATS-ACC-BAT-011-11
    provenance: proposed
    source: >-
      react-console:acceptance/accounting/playwright/journeys/batches-posting/ACT-ACC-0510.spec.ts#ACT-ACC-0510
  - rule: BR-CAP-ACC-BAT-011-10
    scenarios:
      - ATS-ACC-BAT-011-08
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/batch-assignment-settings.e2e.spec.js#answers
      the first rule by position when two rules match
  - rule: BR-CAP-ACC-BAT-011-11
    scenarios:
      - ATS-ACC-BAT-011-09
      - ATS-ACC-BAT-011-12
    provenance: proposed
    source: >-
      services-accounting:modules/batches/tests/e2e/batches-security.e2e.spec.js#is
      refused the save 403 permission_missing
  - rule: BR-CAP-ACC-BAT-011-12
    scenarios:
      - ATS-ACC-BAT-011-10
    provenance: proposed
    source: >-
      services-accounting:modules/batches/services/rules/batch-rules.ts:defaultBatchOf
transition_coverage: []
permission_coverage:
  - key: accounting.batch-assignment-settings.read
    surface: api
    scenarios:
      - ATS-ACC-BAT-011-09
    gap: FND-ACC-BAT-065
    provenance: unknown
    source: FND-ACC-BAT-065
    note: >-
      An aggregate persona check does not establish exhaustive allow and deny
      proof for every named surface.
  - key: accounting.batch-assignment-settings.update
    surface: api
    scenarios:
      - ATS-ACC-BAT-011-09
    gap: FND-ACC-BAT-065
    provenance: unknown
    source: FND-ACC-BAT-065
    note: >-
      An aggregate persona check does not establish exhaustive allow and deny
      proof for every named surface.
  - key: accounting.batch-assignment-settings.delete
    surface: api
    scenarios:
      - ATS-ACC-BAT-011-09
    gap: FND-ACC-BAT-065
    provenance: unknown
    source: FND-ACC-BAT-065
    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-011-02
    - ATS-ACC-BAT-011-10
    - ATS-ACC-BAT-011-11
    - ATS-ACC-BAT-011-12
    - ATS-ACC-BAT-011-13
  gap: FND-ACC-BAT-065
---

# Assign new documents to the appropriate batch stream: 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-011-01` | `ATS-ACC-BAT-011-01` |
| `BR-CAP-ACC-BAT-011-02` | `ATS-ACC-BAT-011-02` |
| `BR-CAP-ACC-BAT-011-03` | `ATS-ACC-BAT-011-03` |
| `BR-CAP-ACC-BAT-011-04` | `ATS-ACC-BAT-011-04` |
| `BR-CAP-ACC-BAT-011-05` | `ATS-ACC-BAT-011-05` |
| `BR-CAP-ACC-BAT-011-06` | `ATS-ACC-BAT-011-05`, `ATS-ACC-BAT-011-13` |
| `BR-CAP-ACC-BAT-011-07` | `ATS-ACC-BAT-011-06` |
| `BR-CAP-ACC-BAT-011-08` | `ATS-ACC-BAT-011-06` |
| `BR-CAP-ACC-BAT-011-09` | `ATS-ACC-BAT-011-07`, `ATS-ACC-BAT-011-11` |
| `BR-CAP-ACC-BAT-011-10` | `ATS-ACC-BAT-011-08` |
| `BR-CAP-ACC-BAT-011-11` | `ATS-ACC-BAT-011-09`, `ATS-ACC-BAT-011-12` |
| `BR-CAP-ACC-BAT-011-12` | `ATS-ACC-BAT-011-10` |

## Interactions With Related Capabilities

Routing selection must pass intake checks. Routing references prevent stream removal. 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.
