Skip to content

CAP-ACC-TRX-014Unwind billed purchases and their collected value

Markdown

CAP-ACC-TRX-014

Unwind billed purchases and their collected value

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationObserved

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
Staff and Commerce cancel billed value with coordinated adjustments and return treatment.Processor refunds can remain unresolved after the financial preparation commits. Offline refunds remain work for staff, so completion can include an exception.
Surfaces
consoleapi
Intent sources
services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-06services-accounting:docs/architecture/accounting-2.0/02-decisions.md#D-01services-accounting:docs/architecture/accounting-2.0/02-decisions.md#A-5services-accounting:docs/milestones/plans/ACCT-M2-plan.md#D7services-accounting:docs/milestones/plans/ACCT-M2-plan.md#D3

Controls

26 controls apply, from the corpus control catalogue.

TC-IAM-001 TC-IAM-002 TC-IAM-004 TC-IAM-005 TC-AZ-001 TC-AZ-002 TC-AZ-003 TC-AZ-004 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-LOG-004 TC-LOG-005 TC-PI-001 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.reversals.createapitenant
accounting.reversals.previewapitenant
accounting.reversals.readapitenant

Business Rules

9 rules, 9 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
Billing reversal requires an issued real invoice and its own eligible line quantities or values; invalid lifecycle, unrelated lines and excessive reversal are refused.
validationservicetest
services-accounting:modules/transactions/tests/integration/services/reversals/reversals.integration.spec.js#it refuses a draft invoice (invoice_not_draft), a line of another invoice (invoice_mismatch) and more than a line has left (over_application)
02must prove
Proposed
The operation first credits unused line value and releases no-longer-needed paid value back to the contributing payments.
calculationservicetest
services-accounting:modules/transactions/tests/integration/services/reversals/reversals.integration.spec.js#it wrote the credit memo of 4000 on the line, which freed the line’s 4000 back onto the check (W-05)
03must prove
Confirmed
A cancellation fee creates a separate invoice paid using credit derived from one contributing payment’s released money.
calculationservicetest
services-accounting:modules/transactions/tests/integration/services/reversals/reversals.integration.spec.js#it issued the fee invoice of 500 and settled it with a credit of 500 made from the check’s freed money
04must prove
Proposed
The selected remainder treatment issues credit or requests a refund per contributing payment; processor refunds execute immediately and offline refunds await staff.
calculationservicetest
05must prove
Confirmed
Financial preparation commits atomically and an invalid step leaves nothing; external refund execution afterward can remain unresolved.
invariantservicetest
services-accounting:modules/transactions/tests/integration/services/reversals/reversals.integration.spec.js#it refuses a reversal dated in no open period (period_not_open), writing nothing
06must prove
Confirmed
Preview calculates the same per-payment and refund-payer results and retains no records, but document-number allocations still advance.
policyservicetest
services-accounting:modules/transactions/tests/integration/services/reversals/reversals.integration.spec.js#it answers the figures of reversing 2000 more of the dues line with a fee of 300 and writes nothing
07must prove
Proposed
Billing adjustments book immediately; unresolved processor refunds keep reversal pending, successful refunds complete it, and failed or staff-payable refunds produce completion with an exception.
lifecycleservicetest
08must prove
Proposed
Reversed card-paid value also releases and credits its share of the processing-fee invoice.
calculationservicetest
services-accounting:modules/transactions/tests/integration/services/settlements/card-fees.integration.spec.js#it credits the fee’s share of the reversed money off the fee invoice and frees it with the rest: 4000 of 10000 reversed frees 4112
09must prove
Confirmed
Creation, preview and reading require reversal create, preview and read authorities respectively.
permissionapitest
services-accounting:modules/transactions/tests/e2e/settlements.e2e.spec.js#it is refused the reversal routes without accounting.reversals.create, .preview and .read (403)

Scenarios

IdGivenWhenThenProvenance
01A member cancels two of four card-paid gala tickets.Preview Reverse Invoice Lines and then confirm.Preview retains no financial records; confirmation credits the two tickets and refunds their card value.test
02A single invoice was paid by a 60.00 check and a 40.00 card tender.Reverse all billed value with refund treatment.The processor returns 40.00 and an offline request leaves staff responsible for the 60.00 check refund.test
services-accounting:modules/transactions/tests/integration/services/reversals/reversal-check-and-card.integration.spec.js#it previews the refund by who pays it: 4000 through the processor and 6000 for staff

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.