Skip to content

ATS-ACC-TRX-013Record receipts that were voided or returned: Capability Test Specification

Markdown

ATS-ACC-TRX-013

Record receipts that were voided or returned: Capability Test Specification

Markdown
  • DocumentProposed

KindAcceptance test setProduct areaAccountingModuleTransactionsRevision1

Read atservices-accounting f47cb263react-console baf6dae3

Coverage

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

Test Scenarios

10 scenarios proving CAP-ACC-TRX-013; 8 bound to an existing test.

01 Reversal needs authority and valid inputpermissionapinegativetest
Proves
BR-CAP-ACC-TRX-013-01
Preconditions
The caller cannot move money.
Steps
[ { "do": "Attempt reversal without authority, invalid kind or missing reason, and unauthorized void.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/e2e/payment-reversals.e2e.spec.js#it is refused the reverse route without accounting.payments.reverse and the reversals read without .read (403)" } ]
Expected
Access and input failures prevent mutation.
Data
Staff permission variants.
Bound to
services-accounting:modules/transactions/tests/e2e/payment-reversals.e2e.spec.js#it is refused the reverse route without accounting.payments.reverse and the reversals read without .read (403)
services-accounting:modules/transactions/tests/e2e/payment-reversals.e2e.spec.js#it refuses a kind the contract does not know and a missing reason (400)
services-accounting:modules/transactions/tests/e2e/payments.e2e.spec.js#it is refused the allocate and reallocate routes without accounting.payments.update, and the void route without .void (403)
Source
services-accounting:modules/transactions/tests/e2e/payment-reversals.e2e.spec.js#it is refused the reverse route without accounting.payments.reverse and the reversals read without .read (403)
02 Reversal type follows instrument behaviorvalidationapinegativetest
Proves
BR-CAP-ACC-TRX-013-02
Preconditions
Paper check, card and cash receipts exist.
Steps
[ { "do": "Submit bank return for check and bounced-check reversal for card and cash.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses a kind the method does not allow (reversal_kind_mismatch): an ACH return of a check, a bounced check of a card" } ]
Expected
All incompatible kinds fail.
Data
Configured methods with bounce behavior.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses a kind the method does not allow (reversal_kind_mismatch): an ACH return of a check, a bounced check of a card
services-accounting:modules/transactions/tests/integration/services/payments/payment-methods.integration.spec.js#it refuses a bounced check of cash, whose method may not bounce (reversal_kind_mismatch)
Source
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses a kind the method does not allow (reversal_kind_mismatch): an ACH return of a check, a bounced check of a card
03 Returned check restores debt exactly oncetransitionapitest
Proves
BR-CAP-ACC-TRX-013-03 BR-CAP-ACC-TRX-013-04 INV-DOM-ACC-TRX-003-11
Preconditions
A 50.00 check settled an invoice line.
Steps
[ { "do": "Record bounce, attempt another reversal and repeat the first request.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it reverses the live allocation so the line owes again, and the payment item’s facts sum to zero (FC-16)" } ]
Expected
Returned receipt has 50.00 reversed and zero net money facts; second reversal fails and replay retains the first.
Data
An applied paper check.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it completes the reversal at once for the whole 5000, numbered from 1,000,000, and the payment is returned with 5000 reversed
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it reverses the live allocation so the line owes again, and the payment item’s facts sum to zero (FC-16)
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses reversing it again (payment_not_live) and replays the same key as the same reversal
Source
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it reverses the live allocation so the line owes again, and the payment item’s facts sum to zero (FC-16)
04 Source credit blocks payment voidinteractionapitest
Proves
BR-CAP-ACC-TRX-013-03 BR-CAP-ACC-TRX-013-05 INV-DOM-ACC-TRX-003-12
Preconditions
A live credit derives from the receipt.
Steps
[ { "do": "Void the payment, void its credit, then retry payment void.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses a payment with a credit made from it that is not void (payment_has_credit)" } ]
Expected
Initial reversal fails and clearing the credit permits restoration of all applied debt.
Data
A payment-backed credit.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/allocate.integration.spec.js#it refused the void while a credit from the payment was open (payment_has_credit)
services-accounting:modules/transactions/tests/integration/services/payments/allocate.integration.spec.js#it marks the payment voided with the reason and takes every live allocation back
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses a payment with a credit made from it that is not void (payment_has_credit)
Source
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses a payment with a credit made from it that is not void (payment_has_credit)
05 Processor settlement determines void eligibilityfailureapitest
Proves
BR-CAP-ACC-TRX-013-06 BR-CAP-ACC-TRX-013-07
Preconditions
One card capture is unsettled and another settled.
Steps
[ { "do": "Void each.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it fails a void the processor says is already settled (payment_settled): the reversal failed, the payment untouched" } ]
Expected
Unsettled capture reverses with reconciliation evidence and settled capture stays intact after refusal.
Data
Processor void-state scripts.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it completes with the dummy’s reference: the payment voided, 2000 reversed, its allocation reversed
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it records the void’s settlement item beside the capture: kind void, minus 2000
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it fails a void the processor says is already settled (payment_settled): the reversal failed, the payment untouched
Source
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it fails a void the processor says is already settled (payment_settled): the reversal failed, the payment untouched
06 Void eliminates the full associated feeruleapitest
Proves
BR-CAP-ACC-TRX-013-08
Preconditions
A card settled required-fee billing.
Steps
[ { "do": "Void that receipt.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/settlements/card-fees.integration.spec.js#it credits the fee invoice whole once the void reopens it: no money, no fee; the invoice owes again" } ]
Expected
The fee invoice is fully credited and billed debt reopens.
Data
A fee-bearing card settlement.
Bound to
services-accounting:modules/transactions/tests/integration/services/settlements/card-fees.integration.spec.js#it credits the fee invoice whole once the void reopens it: no money, no fee; the invoice owes again
Source
services-accounting:modules/transactions/tests/integration/services/settlements/card-fees.integration.spec.js#it credits the fee invoice whole once the void reopens it: no money, no fee; the invoice owes again
07 Dispute lifecycle permits one conclusionvalidationapitest
Proves
BR-CAP-ACC-TRX-013-09 INV-DOM-ACC-TRX-003-18
Preconditions
Card and check receipts are available.
Steps
[ { "do": "Win a card inquiry, target a check, exceed receipt value and reclose the inquiry.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses closing a closed dispute (dispute_not_open), a dispute of a check (reversal_kind_mismatch) and an amount beyond the payment" } ]
Expected
Inquiry conclusion moves no money and invalid or repeated disputes fail.
Data
Receipts of different behavior.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it opens an inquiry for the payment’s whole amount, numbered from 1,000,000, and closing it won leaves the payment as it was
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses closing a closed dispute (dispute_not_open), a dispute of a check (reversal_kind_mismatch) and an amount beyond the payment
Source
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses closing a closed dispute (dispute_not_open), a dispute of a check (reversal_kind_mismatch) and an amount beyond the payment
08 Lost inquiry differs from lost chargebacktransitionapitest
Proves
BR-CAP-ACC-TRX-013-10
Preconditions
Separate card disputes represent chargeback and inquiry.
Steps
[ { "do": "Close both as lost.", "provenance": "test", "source": "services-accounting:modules/transactions/tests/integration/services/payments/dispute-inquiry-lost.integration.spec.js#it writes no payment reversal and leaves the payment succeeded, nothing reversed" } ]
Expected
Chargeback reverses with reconciliation evidence; inquiry preserves the receipt.
Data
Two open processor disputes.
Bound to
services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it closes a chargeback lost by reversing the payment as a chargeback: charged_back, the item keyed dispute:<id>:withdrawn
services-accounting:modules/transactions/tests/integration/services/payments/dispute-inquiry-lost.integration.spec.js#it writes no payment reversal and leaves the payment succeeded, nothing reversed
services-accounting:modules/transactions/tests/e2e/payment-reversals.e2e.spec.js#it opens a dispute on the card, reads it, lists it by payment and closes it lost, charging the payment back
Source
services-accounting:modules/transactions/tests/integration/services/payments/dispute-inquiry-lost.integration.spec.js#it writes no payment reversal and leaves the payment succeeded, nothing reversed
09 Partial chargeback should preserve undisputed valueedgeapiproposed
Proves
BR-CAP-ACC-TRX-013-11
Preconditions
An 80.00 applied card receipt has a 30.00 chargeback.
Steps
[ { "do": "Close it lost.", "provenance": "proposed", "source": "services-accounting:docs/milestones/plans/ACCT-M2-plan.md#D7" } ]
Expected
The proposed outcome reverses 30.00 while retaining 50.00 applied.
Data
A partially disputed card receipt.
Source
services-accounting:docs/milestones/plans/ACCT-M2-plan.md#D7
10 Returned receipts respect credit and processor outcomesinteractionapiproposed
Proves
BR-CAP-ACC-TRX-013-03 BR-CAP-ACC-TRX-013-04 BR-CAP-ACC-TRX-013-05 BR-CAP-ACC-TRX-013-06 BR-CAP-ACC-TRX-007-10 BR-CAP-ACC-TRX-011-02 BR-CAP-ACC-TRX-011-09 BR-CAP-ACC-TRX-012-03 BR-CAP-ACC-TRX-012-09 BR-CAP-ACC-TRX-020-08 BR-CAP-ACC-TRX-009-10
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": "Create receipt-derived credit and attempt source void, cancel an unused grant and retry an eligible void. Compare a settled card’s refused void with a refund request, then redeliver a bank-return event after recovery. In another branch, recover an uncertain credit-and-card settlement before evaluating reversal eligibility.", "provenance": "proposed", "source": "services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it reverses the live allocation so the line owes again, and the payment item’s facts sum to zero (FC-16); services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses reversing it again (payment_not_live) and replays the same key as the same reversal; services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses a payment with a credit made from it that is not void (payment_has_credit); services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it fails a void the processor says is already settled (payment_settled): the reversal failed, the payment untouched; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-007-resolve-lost-processor-answers-and-clear-bank-debits.md#WF-ACC-TRX-007; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-011-void-or-reverse-a-payment-and-follow-its-disputes.md#WF-ACC-TRX-011; 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/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-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-04; 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-05; 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-06; 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-10; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-03; 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-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-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-10" } ]
Expected
Credit protects its source until cancellation; a settled capture uses refund treatment; replayed return confirmation restores debt once and leaves no available receipt money.
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/integration/services/payments/payment-reversals.integration.spec.js#it reverses the live allocation so the line owes again, and the payment item’s facts sum to zero (FC-16); services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses reversing it again (payment_not_live) and replays the same key as the same reversal; services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it refuses a payment with a credit made from it that is not void (payment_has_credit); services-accounting:modules/transactions/tests/integration/services/payments/payment-reversals.integration.spec.js#it fails a void the processor says is already settled (payment_settled): the reversal failed, the payment untouched; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-007-resolve-lost-processor-answers-and-clear-bank-debits.md#WF-ACC-TRX-007; rhythm-v2-docs:specs/accounting/transactions/design/workflows/WF-ACC-TRX-011-void-or-reverse-a-payment-and-follow-its-disputes.md#WF-ACC-TRX-011; 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/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-013-undo-a-payment-whose-money-did-not-stay.md#BR-CAP-ACC-TRX-013-04; 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-05; 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-06; 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-10; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-02; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-011-give-a-customer-credit-and-apply-it.md#BR-CAP-ACC-TRX-011-09; rhythm-v2-docs:specs/accounting/transactions/planning/capabilities/CAP-ACC-TRX-012-pay-money-back-with-refunds.md#BR-CAP-ACC-TRX-012-03; 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-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-009-settle-a-customer-s-invoices-in-one-step.md#BR-CAP-ACC-TRX-009-10

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.