Skip to content

ATS-ACC-TRX-019Maintain customer-specific collection choices: Capability Test Specification

Markdown

ATS-ACC-TRX-019

Maintain customer-specific collection choices: Capability Test Specification

Markdown
  • DocumentProposed

Planning

Proves capability
CAP-ACC-TRX-019

Design

Executed by
TST-ACC-TRX-006, TST-ACC-TRX-088

KindAcceptance test setProduct areaAccountingModuleTransactionsRevision2

Read atservices-accounting f47cb263

Coverage

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

Test Scenarios

9 scenarios proving CAP-ACC-TRX-019; 7 bound to an existing test.

01 Terms defaults and uniqueness remain workspace-scopedboundaryapitest
Proves
BR-CAP-ACC-TRX-019-01 INV-DOM-ACC-TRX-005-01
Preconditions
One party lacks local terms and another workspace has the same party identity.
Steps
[ { "do": "Read defaults and attempt duplicate local creation.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it answers the defaults, saying so, before Acme has a record" } ]
Expected
Marked defaults remain isolated and a second saved record is rejected.
Data
Two workspaces sharing a party reference.
Bound to
services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it answers the defaults, saying so, before Acme has a record
services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it answers the other tenant the defaults for Acme, not this tenant’s record
Source
services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it answers the defaults, saying so, before Acme has a record
02 Whole-record terms replacement resets omissionsconcurrencyapitest
Proves
BR-CAP-ACC-TRX-019-02 INV-DOM-ACC-TRX-005-02
Preconditions
No saved customer override exists.
Steps
[ { "do": "Create, duplicate-create, stale-replace and validly replace with omissions.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses a replacement at a stale version, writing nothing" } ]
Expected
Creation starts at version one, invalid writes fail and valid replacement advances while resetting absent settings.
Data
Active payment-term definitions.
Bound to
services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses a create over the existing record (no version sent), writing nothing
services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it replaces the record whole: the settings left out take their defaults, the version moves to 2, the id stays
Source
services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses a replacement at a stale version, writing nothing
03 Invalid collection configuration is rejectedvalidationapinegativetest
Proves
BR-CAP-ACC-TRX-019-03
Preconditions
Inactive and foreign terms are available.
Steps
[ { "do": "Use each as default and submit an unknown collection standing.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses inactive terms, naming the field" } ]
Expected
Each attempted save refuses the invalid configuration.
Data
Payment terms across workspace boundaries.
Bound to
services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses another tenant’s terms: the other tenant’s net 30 is not this one’s when this one has none
services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses a collection status and a remitting agreement outside their vocabularies
Source
services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses inactive terms, naming the field
04 Versioned removal restores defaultstransitionapitest
Proves
BR-CAP-ACC-TRX-019-04
Preconditions
The party has saved customer terms.
Steps
[ { "do": "Delete with an obsolete and then current version and read again.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses a delete at a stale version, keeping the record" } ]
Expected
Obsolete removal preserves the record and valid removal restores defaults.
Data
A saved customer override.
Bound to
Source
services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses a delete at a stale version, keeping the record
05 Referenced payment terms cannot be removedinvariantunitnegativetest
Proves
BR-CAP-ACC-TRX-019-05 INV-DOM-ACC-TRX-005-04
Preconditions
A customer uses a term definition as default.
Steps
[ { "do": "Delete that definition.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it keeps terms a party names from being deleted (409, the key)" } ]
Expected
Dependency conflict prevents removal.
Data
A referenced default term.
Bound to
Source
services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it keeps terms a party names from being deleted (409, the key)
06 Manage authority does not follow read accesspermissionapinegativetest
Proves
BR-CAP-ACC-TRX-019-06
Preconditions
Reader and outsider identities exist.
Steps
[ { "do": "Read as both, then write and remove as reader.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it refuses the write and the delete without accounting.customer-terms.manage (403), the reader’s key not enough" } ]
Expected
Only the reader inspects, and its mutations are denied.
Data
Separate permission personas.
Bound to
services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it reads with accounting.customer-terms.read alone and refuses a principal without it (403)
services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it refuses the write and the delete without accounting.customer-terms.manage (403), the reader’s key not enough
Source
services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it refuses the write and the delete without accounting.customer-terms.manage (403), the reader’s key not enough
07 Customer-term protection blocks mutationsfailureapinegativetest
Proves
BR-CAP-ACC-TRX-019-08
Preconditions
Saved terms have full update and delete protection.
Steps
[ { "do": "Attempt replacement and removal.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses a replacement (409)" } ]
Expected
Both failures retain the saved terms.
Data
A fully locked terms record.
Bound to
Source
services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses a replacement (409)
08 Saved collection choices reach billing through the service boundaryinteractionapiproposed
Proves
BR-CAP-ACC-TRX-019-01 BR-CAP-ACC-TRX-019-02 BR-CAP-ACC-TRX-019-06 BR-CAP-ACC-TRX-001-05 BR-CAP-ACC-TRX-017-02 BR-CAP-ACC-TRX-020-01
Preconditions
An isolated workspace has eligible customers, products, matching accounts, an open period and two open batches. Each branch owns separate financial records.
Steps
[ { "do": "Save forty-five-day customer terms, retrieve them through Commerce’s billing function, create a bill without explicit terms and inspect its current financial standing. Create another bill with an explicit due date.", "provenance": "proposed", "source": "services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it answers the defaults, saying so, before Acme has a record; services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses a replacement at a stale version, writing nothing; services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it refuses the write and the delete without accounting.customer-terms.manage (403), the reader’s key not enough; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-019-record-a-customer-s-collection-terms.md#BR-CAP-ACC-TRX-019-01; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-019-record-a-customer-s-collection-terms.md#BR-CAP-ACC-TRX-019-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-019-record-a-customer-s-collection-terms.md#BR-CAP-ACC-TRX-019-06; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-001-bill-a-customer-with-an-invoice.md#BR-CAP-ACC-TRX-001-05; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-017-know-where-a-customer-stands.md#BR-CAP-ACC-TRX-017-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-020-let-commerce-and-the-processor-work-with-accounting-safely.md#BR-CAP-ACC-TRX-020-01" } ]
Expected
The first bill uses the saved default and the second retains the explicit date; standing classifies each debt from its resolved deadline; the service read remains separately authorized.
Data
Separate command keys, two customers, invoice lines, receipts and credit; controlled processor outcomes and a fixed calendar where the branch requires them.
Source
services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it answers the defaults, saying so, before Acme has a record; services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it refuses a replacement at a stale version, writing nothing; services-accounting:modules/transactions/tests/e2e/customer-terms.e2e.spec.js#it refuses the write and the delete without accounting.customer-terms.manage (403), the reader’s key not enough; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-019-record-a-customer-s-collection-terms.md#BR-CAP-ACC-TRX-019-01; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-019-record-a-customer-s-collection-terms.md#BR-CAP-ACC-TRX-019-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-019-record-a-customer-s-collection-terms.md#BR-CAP-ACC-TRX-019-06; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-001-bill-a-customer-with-an-invoice.md#BR-CAP-ACC-TRX-001-05; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-017-know-where-a-customer-stands.md#BR-CAP-ACC-TRX-017-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-020-let-commerce-and-the-processor-work-with-accounting-safely.md#BR-CAP-ACC-TRX-020-01
09 Collection choices handle empty and maximum allow-listsboundaryapinegativeproposed
Proves
BR-CAP-ACC-TRX-019-03 INV-DOM-ACC-TRX-005-03
Preconditions
The customer has no saved override and fifty-one distinct supported collection options are available.
Steps
[ { "do": "Save an empty allow-list, replace it with fifty unique options, then attempt fifty-one options and a duplicate option.", "provenance": "proposed", "source": "services-accounting:modules/transactions/services/persistence/customer-terms.ts; services-accounting:modules/transactions/db/customer-terms.table.ts; services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it stores an empty allow-list as no allow-list; services-accounting:modules/transactions/aws/api/customer-terms.schemas.ts" } ]
Expected
Empty selection becomes unrestricted; fifty unique options are retained; excessive and duplicate selections are refused without replacing the last valid record.
Data
Branch-owned records in one configured workspace, valid accounting context and controlled requests at the stated boundary.
Source
services-accounting:modules/transactions/services/persistence/customer-terms.ts; services-accounting:modules/transactions/db/customer-terms.table.ts; services-accounting:modules/transactions/tests/integration/services/persistence/customer-terms.integration.spec.js#it stores an empty allow-list as no allow-list; services-accounting:modules/transactions/aws/api/customer-terms.schemas.ts

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