Skip to content

ATS-ACC-TRX-020Coordinate financial commands across applications: Capability Test Specification

Markdown

ATS-ACC-TRX-020

Coordinate financial commands across applications: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaAccountingModuleTransactionsRevision2

Read atservices-accounting f47cb263react-console baf6dae3

Coverage

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

Test Scenarios

9 scenarios proving CAP-ACC-TRX-020; 8 bound to an existing test.

01 Service functions restrict callers and operationspermissionapitest
Proves
BR-CAP-ACC-TRX-020-01
Preconditions
Commerce is registered and another principal is unknown.
Steps
[ { "do": "Bill, request unlisted billing work, use the unknown caller and invoke reversal service.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/e2e/service-functions.e2e.spec.js#it refuses a principal the registry does not know (403) and an event that is not a package (400)" } ]
Expected
Billing and reversal work succeed within their functions; unlisted operation and unknown identity fail.
Data
Platform service identities.
Bound to
services-accounting:modules/transactions/tests/e2e/service-functions.e2e.spec.js#it deletes a draft through its delete route, and refuses a route it does not list with 404
services-accounting:modules/transactions/tests/e2e/service-functions.e2e.spec.js#it refuses a principal the registry does not know (403) and an event that is not a package (400)
services-accounting:modules/transactions/tests/e2e/service-functions.e2e.spec.js#it serves the preview and the reversal, and nothing else
Source
services-accounting:modules/transactions/tests/e2e/service-functions.e2e.spec.js#it refuses a principal the registry does not know (403) and an event that is not a package (400)
02 Service attribution retains optional originating personinvariantapitest
Proves
BR-CAP-ACC-TRX-020-02 INV-DOM-ACC-TRX-006-13
Preconditions
Commerce invokes work with and without a person context.
Steps
[ { "do": "Create a document in each mode.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/service-calls/service-caller.integration.spec.js#it records the service principal as the actor of what it creates" } ]
Expected
The service remains actor and only supplied person context is retained.
Data
An authenticated service principal.
Bound to
services-accounting:modules/transactions/tests/integration/services/service-calls/service-caller.integration.spec.js#it sets app.source to service and app.originating_user_id to the person it acts for, on its transaction
Source
services-accounting:modules/transactions/tests/integration/services/service-calls/service-caller.integration.spec.js#it records the service principal as the actor of what it creates
03 Retry identity preserves one financial executionedgeapitest
Proves
BR-CAP-ACC-TRX-020-03 INV-DOM-ACC-TRX-006-04
Preconditions
Eligible and closed batches exist.
Steps
[ { "do": "Create and issue, replay, alter keyed content and retry a previously refused batch request.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it refuses the second request 409 idempotency_key_reused" } ]
Expected
Replays retain one invoice and fact set, altered reuse fails and corrected refused work can proceed.
Data
Open and closed transaction batches.
Bound to
Source
services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it refuses the second request 409 idempotency_key_reused
04 Another actor cannot reuse a held keyboundaryapinegativetest
Proves
BR-CAP-ACC-TRX-020-04 INV-DOM-ACC-TRX-006-05
Preconditions
Two staff act within one workspace.
Steps
[ { "do": "Submit the second actor’s command under the first actor’s key.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it refuses the second person 409 idempotency_key_in_use, never an unhandled error (DEF-ACT-0800)" } ]
Expected
Refusal identifies reuse while retaining only the first actor’s document.
Data
Two independently attributed callers.
Bound to
services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it refuses the second person 409 idempotency_key_in_use, never an unhandled error (DEF-ACT-0800)
services-accounting:modules/transactions/tests/integration/services/payments/receive-offline.integration.spec.js#it refuses another principal’s use of the key (idempotency_key_in_use, 409, naming the key), never an unhandled error (DEF-ACT-0800)
Source
services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it refuses the second person 409 idempotency_key_in_use, never an unhandled error (DEF-ACT-0800)
05 Concurrent requests do not duplicate billingconcurrencyapitest
Proves
BR-CAP-ACC-TRX-020-05 INV-DOM-ACC-TRX-006-06
Preconditions
Two callers can submit identical work concurrently.
Steps
[ { "do": "Race draft creation and invoice issue.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it issues the invoice once and refuses the other issue invoice_not_draft" } ]
Expected
One draft and one issue produce only their intended event and receivable effects.
Data
Parallel command clients.
Bound to
services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it issues the invoice once and refuses the other issue invoice_not_draft
Source
services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it issues the invoice once and refuses the other issue invoice_not_draft
06 Known-time history matches current and former balancesinvariantapitest
Proves
BR-CAP-ACC-TRX-020-06 INV-DOM-ACC-TRX-006-02
Preconditions
Invoices carry credits, abandonment and its reversal.
Steps
[ { "do": "Read today, earlier dates and a cutoff before a later credit.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/invoices/as-of.integration.spec.js#it answers, as of today and known now, exactly the live balance of every open invoice (FC-07)" } ]
Expected
Current values reconcile to live debt and earlier reads omit later-known effects.
Data
A receivable history population.
Bound to
services-accounting:modules/transactions/tests/integration/services/invoices/as-of.integration.spec.js#it answers, as of today and known now, exactly the live balance of every open invoice (FC-07)
services-accounting:modules/transactions/tests/integration/services/invoices/as-of.integration.spec.js#it does not see the credit recorded after the instant it is known at
services-accounting:modules/transactions/tests/integration/services/invoices/as-of.integration.spec.js#it sees, between the write-off and its reversal, both the credit and the write-off
Source
services-accounting:modules/transactions/tests/integration/services/invoices/as-of.integration.spec.js#it answers, as of today and known now, exactly the live balance of every open invoice (FC-07)
07 Configured change delivery retries incomplete acknowledgmentfailureapitest
Proves
BR-CAP-ACC-TRX-020-07
Preconditions
A receiver accepts, rejects or omits an event result.
Steps
[ { "do": "Write receivable entries and deliver their changes repeatedly.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/change-events/commerce-financial-facts-consumer.integration.spec.js#it returns that event’s message to the queue, never reading silence as success" } ]
Expected
Transactional capture retains each entry; rejected or silent results retry until acknowledged.
Data
A receiver test double.
Bound to
services-accounting:modules/transactions/tests/integration/services/change-events/receivable-event-capture.integration.spec.js#it records one INSERT change event per receivable fact, in the writing transaction, naming the fact’s id
services-accounting:modules/transactions/tests/integration/services/change-events/commerce-financial-facts-consumer.integration.spec.js#it acknowledges the same messages when the queue delivers them again and the receiver takes them
Source
services-accounting:modules/transactions/tests/integration/services/change-events/commerce-financial-facts-consumer.integration.spec.js#it returns that event’s message to the queue, never reading silence as success
08 Processor events are applied once by authorized routinginteractionapitest
Proves
BR-CAP-ACC-TRX-020-08 INV-DOM-ACC-TRX-006-12
Preconditions
Clearing, refund, dispute and unknown-payment events exist with an unauthorized caller.
Steps
[ { "do": "Deliver twice and retry under the other caller.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/integrations/integration-events.integration.spec.js#it records every event it handles or ignores by id in the handling transaction, and a replay is ignored by the row, not by a lookup" } ]
Expected
Known outcomes apply once, unrelated events are ignored and unauthorized delivery fails.
Data
Platform gateway event fixtures.
Bound to
services-accounting:modules/transactions/tests/integration/services/integrations/integration-events.integration.spec.js#it records every event it handles or ignores by id in the handling transaction, and a replay is ignored by the row, not by a lookup
services-accounting:modules/transactions/tests/integration/services/integrations/integration-events.integration.spec.js#it ignores an event with no tenant, one of a tenant not known here, one about a payment that is not ours, and the payout kinds
services-accounting:modules/transactions/tests/e2e/service-functions.e2e.spec.js#it refuses a principal that is not Platform, and a delivery that is not one
Source
services-accounting:modules/transactions/tests/integration/services/integrations/integration-events.integration.spec.js#it records every event it handles or ignores by id in the handling transaction, and a replay is ignored by the row, not by a lookup
09 Cross-application effects remain traceable through recovery and historyinteractionapiproposed
Proves
BR-CAP-ACC-TRX-020-01 BR-CAP-ACC-TRX-020-02 BR-CAP-ACC-TRX-020-03 BR-CAP-ACC-TRX-020-05 BR-CAP-ACC-TRX-020-06 BR-CAP-ACC-TRX-020-08 BR-CAP-ACC-TRX-001-07 BR-CAP-ACC-TRX-001-12 BR-CAP-ACC-TRX-007-03 BR-CAP-ACC-TRX-007-06 BR-CAP-ACC-TRX-009-04 BR-CAP-ACC-TRX-009-10 BR-CAP-ACC-TRX-012-08 BR-CAP-ACC-TRX-012-09 BR-CAP-ACC-TRX-013-03 BR-CAP-ACC-TRX-014-05 BR-CAP-ACC-TRX-014-07 BR-CAP-ACC-TRX-016-06 BR-CAP-ACC-TRX-016-08 BR-CAP-ACC-TRX-018-02 BR-CAP-ACC-TRX-018-05 BR-CAP-ACC-TRX-008-04
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": "Commerce issues an 80.00 bill and settles it through a card attempt with a lost answer. Recover by lookup, inspect transaction actions, cancel 20.00 through the reversal function and deliver refund confirmation twice. Capture aging after the work. Reallocate an eligible receipt remainder and inspect the opposing and replacement entries.", "provenance": "proposed", "source": "services-accounting:modules/transactions/tests/e2e/service-functions.e2e.spec.js#it refuses a principal the registry does not know (403) and an event that is not a package (400); services-accounting:modules/transactions/tests/integration/services/service-calls/service-caller.integration.spec.js#it records the service principal as the actor of what it creates; services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it refuses the second request 409 idempotency_key_reused; services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it issues the invoice once and refuses the other issue invoice_not_draft; services-accounting:modules/transactions/tests/integration/services/invoices/as-of.integration.spec.js#it answers, as of today and known now, exactly the live balance of every open invoice (FC-07); services-accounting:modules/transactions/tests/integration/services/integrations/integration-events.integration.spec.js#it records every event it handles or ignores by id in the handling transaction, and a replay is ignored by the row, not by a lookup; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-001-create-and-issue-an-invoice.md#WF-ACC-TRX-001; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-006-take-a-card-or-bank-payment-through-the-processor.md#WF-ACC-TRX-006; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-013-apply-payment-events-from-the-integration-platform.md#WF-ACC-TRX-013; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-014-share-receivable-facts-with-commerce.md#WF-ACC-TRX-014; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-018-purge-a-workspace-s-transactions.md#WF-ACC-TRX-018; 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; 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-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-03; 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-05; 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-06; 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-08; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-001-bill-a-customer-with-an-invoice.md#BR-CAP-ACC-TRX-001-07; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-001-bill-a-customer-with-an-invoice.md#BR-CAP-ACC-TRX-001-12; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-10; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-08; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-09; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-05; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-07; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-016-find-transactions-and-see-what-can-be-done-next.md#BR-CAP-ACC-TRX-016-06; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-016-find-transactions-and-see-what-can-be-done-next.md#BR-CAP-ACC-TRX-016-08; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-018-report-receivables-at-a-past-month-end.md#BR-CAP-ACC-TRX-018-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-018-report-receivables-at-a-past-month-end.md#BR-CAP-ACC-TRX-018-05; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-04" } ]
Expected
One bill and receipt account for the purchase; cancellation retains the reduction and return; duplicate confirmation adds no effect; transaction history and aging reflect their own financial dates and cutoff.
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/service-functions.e2e.spec.js#it refuses a principal the registry does not know (403) and an event that is not a package (400); services-accounting:modules/transactions/tests/integration/services/service-calls/service-caller.integration.spec.js#it records the service principal as the actor of what it creates; services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it refuses the second request 409 idempotency_key_reused; services-accounting:modules/transactions/tests/integration/services/invoices/idempotency.integration.spec.js#it issues the invoice once and refuses the other issue invoice_not_draft; services-accounting:modules/transactions/tests/integration/services/invoices/as-of.integration.spec.js#it answers, as of today and known now, exactly the live balance of every open invoice (FC-07); services-accounting:modules/transactions/tests/integration/services/integrations/integration-events.integration.spec.js#it records every event it handles or ignores by id in the handling transaction, and a replay is ignored by the row, not by a lookup; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-001-create-and-issue-an-invoice.md#WF-ACC-TRX-001; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-006-take-a-card-or-bank-payment-through-the-processor.md#WF-ACC-TRX-006; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-013-apply-payment-events-from-the-integration-platform.md#WF-ACC-TRX-013; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-014-share-receivable-facts-with-commerce.md#WF-ACC-TRX-014; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-018-purge-a-workspace-s-transactions.md#WF-ACC-TRX-018; 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; 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-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-03; 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-05; 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-06; 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-08; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-001-bill-a-customer-with-an-invoice.md#BR-CAP-ACC-TRX-001-07; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-001-bill-a-customer-with-an-invoice.md#BR-CAP-ACC-TRX-001-12; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-007-take-card-and-bank-payments-through-the-processor.md#BR-CAP-ACC-TRX-007-06; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-04; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-10; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-08; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-09; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-03; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-05; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-014-reverse-billing-in-one-operation.md#BR-CAP-ACC-TRX-014-07; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-016-find-transactions-and-see-what-can-be-done-next.md#BR-CAP-ACC-TRX-016-06; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-016-find-transactions-and-see-what-can-be-done-next.md#BR-CAP-ACC-TRX-016-08; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-018-report-receivables-at-a-past-month-end.md#BR-CAP-ACC-TRX-018-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-018-report-receivables-at-a-past-month-end.md#BR-CAP-ACC-TRX-018-05; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-008-put-a-payment-s-money-on-the-right-invoices.md#BR-CAP-ACC-TRX-008-04

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.