Skip to content

CAP-ACC-TRX-020Coordinate financial commands across applications

Markdown

CAP-ACC-TRX-020

Coordinate financial commands across applications

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationPartially observed

KindCapabilityProduct areaAccountingModuleTransactionsRevision1

Read atservices-accounting f47cb263react-console baf6dae3

The Formal Contract

The narrative above explains; the sections below are authoritative — the rules, scenarios and tests this document binds.

Outcomes
Connected applications retry financial work safely and consume Accounting’s resulting facts.Order-line positions remain available for financial reconstruction. Workspace deletion removes owned financial data before dependent configuration.
Surfaces
apijob
Intent sources
services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-07services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-01services-accounting:docs/architecture/accounting-2.0/02-decisions.md#M4-1services-accounting:docs/architecture/accounting-2.0/02-decisions.md#M4-2services-accounting:docs/architecture/accounting-2.0/02-decisions.md#M4-6services-accounting:docs/accounting/invoices.md#Invoices

Controls

33 controls apply, from the corpus control catalogue.

TC-IAM-001 TC-IAM-002 TC-IAM-004 TC-IAM-005 TC-IAM-006 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 TC-AZ-005 TC-AZ-006 TC-TEN-001 TC-TEN-002 TC-TEN-003 TC-CRY-001 TC-DAT-001 TC-DAT-002 TC-DAT-003 TC-DAT-004 TC-LOG-001 TC-LOG-002 TC-LOG-003 TC-LOG-004 TC-LOG-005 TC-PI-001 TC-PI-002 TC-PI-003 TC-PI-005 TC-VEN-001 TC-VEN-002 TC-VEN-003 TC-PRV-001 TC-PRV-002

Permissions

KeyChecked atScope
accounting.invoices.createapitenant
accounting.payments.createapitenant
accounting.reversals.createapitenant
accounting.tax.calculateapitenant

Business Rules

11 rules, 8 to be proved before approval. A rule's product intent is derived from its origin: 5 confirmed by a product decision, the rest inheriting this capability's proposed.

IdRuleKindEnforced atProvenance
01must prove
Confirmed
Commerce authenticates as its own registered service identity through separately restricted billing, tender, reversal and tax functions; unknown identities are denied.
permissionapi, servicetest
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)
02must prove
Proposed
Service-created records identify the service actor and preserve the originating person when supplied.
invariantservicetest
03must prove
Confirmed
A retry key replays the stored result for the same command body, rejects altered reuse and remains reusable after a refused command commits nothing.
policyapi, service, databasetest
04must prove
Proposed
Retry-key ownership spans the workspace, preventing another actor from executing an independent command under a used key.
policyservice, databasetest
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)
05must prove
Confirmed
Racing identical requests execute the financial effect once, although a competing request can receive a lifecycle refusal rather than a replay.
invariantservice, databasetest
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
06must prove
Confirmed
Receivable history records each monetary change and reconstructs both current balances and earlier positions at their known-time cutoff.
invariantservice, databasetest
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)
07must prove
Proposed
Transactional receivable events retry failed configured delivery, but acknowledge and log events when Commerce has no configured receiver.
policyserviceobserved
08must prove
Proposed
Platform-routed processor events are consumed transactionally by identity, so redelivery changes nothing and unrelated or unknown payments are ignored.
invariantservice, databasetest
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
Confirmed
The order-line position view supplies Commerce with invoiced, settled, credited, refunded and abandoned amounts.
policydatabasetest
10
Proposed
Accounting still serves Commerce tax quotes despite the recorded transfer of tax determination to Commerce.
policyapitest
services-accounting:modules/transactions/tests/e2e/service-functions.e2e.spec.js#it serves the calculation as Commerce: a quote of a line with no address is zero with the warning, and nothing else is served
11
Proposed
Deletion purges transaction data before dependent configuration and refuses to purge an active workspace.
lifecycleservicetest

Scenarios

IdGivenWhenThenProvenance
01Commerce needs to bill an order using resolved terms.Invoke its separate billing service.The issued invoice identifies Commerce as the creating actor.test
02A request’s completion is uncertain to another operator.Submit a retry using its original key.The operation returns its earlier result or a refusal without a second financial execution.test

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.