flowrefund_request v1examples/refund_request/refund_request.flow · dandori doc
Pays a refund out of what is left of the order
flow| Line | Call | Calls | Retries | Timeout | When it fails |
|---|---|---|---|---|---|
| 24 | done = pay_out(…) | lambda pay-out, idempotent | — | — | timeout, failure → the workflow fails |
| Line | End |
|---|---|
| 25 | succeed paid = done |
Pick a step to see what the checker knows there. Pick a scenario on the left to light up the way its run goes; the number beside a step is how often the run passes it.
refund_request v1Pays a refund out of what is left of the order
amount: money[USDc] range >=1USDc <=1_000_000USDc, reason: string, balance: Balancepaid: boolamount: Comes from `openapi "specs/refunds.json" schema RefundCreate property amount` (`ritsu check` holds the range of its values; the hand-written code that carries the value is not checked)reason: Comes from `openapi "specs/refunds.json" schema RefundCreate property reason` (`ritsu check` holds the range of its values; the hand-written code that carries the value is not checked)Balance.left: Comes from `chobo "books/refunds.book" account remaining` (`ritsu check` holds the range of its values; the hand-written code that carries the value is not checked)examples/refund_request/refund_request.flowdone = pay_out(…) line 24 24 let done = pay_out(amount: amount, left: balance.left, reason: reason)
lambda pay-out, idempotenttimeout, failure → the workflow fails19 task pay_out(amount: money[USDc], left: money[USDc], reason: string) -> bool 20 lambda "arn:aws:lambda:us-east-1:123456789012:function:pay-out" 21 idempotent
succeed paid = done line 25 25 succeed paid = done
end: succeedsThe flow runs to its end, and the workflow succeeds.
done = pay_out(…) oksucceed paid = donedone = pay_out(…) failure → not handled heredone = pay_out(…) ok