Design a workflow for receiving and processing refund requests. Explain validation, state transitions, interaction with the payment system, failure recovery, and how users learn the final outcome.
### Constraints & Assumptions
The source names refund processing but supplies no eligibility policy, payment provider, partial-refund rule, or timing target. Keep those configurable requirements rather than inventing policy.
### Clarifying Questions to Ask
- Are partial refunds allowed, and can several requests target one payment?
- Which policy determines eligibility and whether human approval is needed?
- Does the provider support idempotent refund creation and asynchronous status callbacks?
```hint Reserve refundable amount before dispatch
Two concurrent refund requests must not both consume the same remaining refundable balance.
```
### What a Strong Answer Covers
- Durable requests, authorization, eligibility, and amount validation.
- Idempotent provider interaction and explicit pending/unknown states.
- Concurrency control, reconciliation, and audit history.
### Follow-up Questions
- What happens when the provider refunds successfully but the response is lost?
- How would a rejected approval release a previously reserved amount?
Overview: Design a refund workflow with eligibility checks, refundable-amount reservations, idempotent provider calls, explicit pending states, and reliable reconciliation.
Design a workflow for receiving and processing refund requests. Explain validation, state transitions, interaction with the payment system, failure recovery, and how users learn the final outcome.
Constraints & Assumptions
The source names refund processing but supplies no eligibility policy, payment provider, partial-refund rule, or timing target. Keep those configurable requirements rather than inventing policy.
Clarifying Questions to Ask Guidance
Are partial refunds allowed, and can several requests target one payment?
Which policy determines eligibility and whether human approval is needed?
Does the provider support idempotent refund creation and asynchronous status callbacks?
What a Strong Answer Covers Guidance
Durable requests, authorization, eligibility, and amount validation.
Idempotent provider interaction and explicit pending/unknown states.
Concurrency control, reconciliation, and audit history.
Follow-up Questions Guidance
What happens when the provider refunds successfully but the response is lost?
How would a rejected approval release a previously reserved amount?