Skip to content

JNY-ACC-TRX-004Approve an overpayment return and retain the remainder

Markdown

JNY-ACC-TRX-004

Approve an overpayment return and retain the remainder

Markdown
  • DocumentDraft
  • Product intentProposed
  • ImplementationPartially observed

KindJourneyProduct areaAccountingModuleTransactionsRevision1End-to-endRequired

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
Return 30.00 from a check overpayment with independent approval and retain another 20.00 as credit.
Screens
/console/{tenantId}/accounting/payments/{paymentId}/console/{tenantId}/accounting/refunds/{refundId}/console/{tenantId}/accounting/credits/{creditId}

Steps

#SurfaceActionCapabilityExpectedProvenance
1/console/{tenantId}/accounting/payments/{paymentId}Request a 30.00 check return from a 150.00 receipt with 100.00 allocated.CAP-ACC-TRX-012Approval wait reserves 30.00 and leaves only 20.00 otherwise refundable.test
2/console/{tenantId}/accounting/refunds/{refundId}Attempt requester approval, then authorize through a different approver.CAP-ACC-TRX-012Self-approval fails and independent approval permits the requested stage.test
services-accounting:modules/transactions/tests/integration/services/refunds/refunds.integration.spec.js#it is approved by another person (requested, approved_by_id theirs), then executed
3/console/{tenantId}/accounting/refunds/{refundId}Execute the offline refund using its permitted check-number entry.CAP-ACC-TRX-012Offline completion makes the receipt partly refunded.test
4/console/{tenantId}/accounting/payments/{paymentId}Issue credit from the remaining 20.00.CAP-ACC-TRX-011The open credit consumes available receipt value and prevents source-payment void while live.test

Alternate and Failure Paths

PathFrom stepConditionPath takenOutcomeProvenance
alternate1Independent refund approval is disabled.Request can proceed directly to execution.The separate approval stage is unnecessary.test
services-accounting:modules/transactions/tests/e2e/refunds.e2e.spec.js#it pays a refund in the request itself with execute: true
alternate1The original excess came through a card.Select its processor return path rather than an ordinary check return.Original-method treatment applies unless the supported fallback conditions are met.test
services-accounting:modules/transactions/tests/integration/services/refunds/refund-card-original-method.integration.spec.js#it refuses a check refund of the card’s unapplied money, saying the money goes back to the card
failure1Another operation tries to consume reserved refund value.Application, credit or repeat-refund eligibility rejects reuse.The first return keeps its held value.test
services-accounting:modules/transactions/tests/integration/services/refunds/refund-reservation.integration.spec.js#it refuses a credit of the reserved money, and a second refund of it (over_refund)

Assertions

IdStatementProvenance
01An approval-required request cannot authorize its own requester.test
services-accounting:modules/transactions/tests/integration/services/refunds/refunds.integration.spec.js#it requests it pending_approval, refusing to execute it (refund_not_requested) or to let the requester approve it (self_approval)
02Offline execution converts the reserved value into returned value.test
services-accounting:modules/transactions/tests/integration/services/refunds/refund-reservation.integration.spec.js#it turns the reservation into the refunded amount when the refund is paid offline
03After return and credit consume the excess, the receipt retains no net held value.test
services-accounting:modules/transactions/tests/integration/services/credits/credits.integration.spec.js#it mirrors the money’s move in the facts: plus on the payment item, minus on the credit item

End-to-end policy: required: Requester and approver actions need browser coverage with separate identities; enabling the approval setting still uses the service.

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.