Skip to content

JNY-ACC-TRX-006Bill, collect and unwind an order through service calls

Markdown

JNY-ACC-TRX-006

Bill, collect and unwind an order through service calls

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

KindJourneyProduct areaAccountingModuleTransactionsRevision1End-to-endOptional

Read atreact-console baf6dae3services-accounting f47cb263

The Formal Contract

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

Goal
Use attributed repeat-safe service work to bill, tender and later cancel an order with its fee treatment.

Steps

#SurfaceActionCapabilityExpectedProvenance
1accounting_billing_service (createInvoiceDraft with issue)Commerce invokes its billing function for the placed purchase.CAP-ACC-TRX-001One issued invoice retains the order context and service actor.test
2accounting_tender_service (settle)Commerce invokes tender for the order’s card payment.CAP-ACC-TRX-009One receipt settles the bill and the order-line position reflects collected value.test
3accounting_tender_service (settle)Repeat an interrupted tender using its original command identity.CAP-ACC-TRX-020The earlier result or a refusal prevents another capture.test
4accounting_reversals_service (reverseBilling)Invoke billing cancellation with fee and refund treatment.CAP-ACC-TRX-014The reduction releases money, credit settles the fee and the remainder returns to the card.test

Alternate and Failure Paths

PathFrom stepConditionPath takenOutcomeProvenance
alternate2Gateway capture completed without a usable response.Commerce repeats the original uncertain request.Lookup establishes the existing capture and its receipt.test
services-accounting:modules/transactions/tests/e2e/service-functions-gateway-lost-answer.e2e.spec.js#it finds the one capture with the lookup and answers the succeeded payment
failure1An unknown service identity invokes the function.Registry authorization rejects the caller.No bill is created.test
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)

Assertions

IdStatementProvenance
01Commerce-created billing retains the registered service actor.test
services-accounting:modules/transactions/tests/e2e/service-functions.e2e.spec.js#it answers the issued invoice, whose rows name the service principal as their actor
02Receivable changes capture their corresponding Commerce events transactionally.test
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
03Cancellation records its financial components while exposing refund progress.test
services-accounting:modules/transactions/tests/integration/services/reversals/reversal-refund-status.integration.spec.js#it answers refund_status processing with the refund id and the reversal pending

End-to-end policy: optional: This service-to-service journey requires API proof; no staff browser interaction establishes stronger financial evidence.

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.