Wallet sanity checks
Superseded — kept for history only
This checklist describes a partner wallet (/agent/wallet, /finance/wallet/topups)
that does not exist in the application. No such routes are registered in
src/App.tsx. Partner credit today is a credit limit checked in the database
when a partner books — see PTR-030. A wallet is part of
the partner-portal rebuild in Wave 3.
- Apply migrations then log in as an agent; hit
/agent/walletand submit a top-up (UPI/bank/cash). It should land asPENDINGand show infinance/wallet/topups. - As a finance/admin role open
/finance/wallet/topups, approve the request, and confirm/agent/walletbalance increases by the approved amount. - Create a booking for an agent with a total that does not exceed the wallet balance; a
BOOKING_DEBITtransaction should appear and balance drop. If balance is too low, booking creation should fail and not leave a stranded booking row. - Patch a booking to
CANCELLED(or finance status toREJECTED) and confirm aREFUNDcredit is created and balance restored. - Verify RLS: an agent should only see their own wallet/transactions; a non-finance user should get a policy error if they call
/finance/wallet/topups. - Optional: attempt multiple approvals on the same top-up; only
PENDINGrows should update and duplicate debits/refunds for a booking should be rejected.