- Admin → Withdraw $1000 → needs an approver
- Member → Withdraw $1000 → needs 2 approvers.
Full Schema | Open in playground
So let’s start with building basics. We need Users, Organization, Accounts both Savings and Deposits as entities in the mercury- Balance of the account must be more than withdraw amount
- If withdraw amount is less than the withdraw limit we don’t need approval
- Else; we need approve of two admins if we’re member, and we need approve of single admin if we’re another admin.
- Check balance if it’s over the withdraw amount. If not don’t allow the action.
- Check withdraw limit; if it’s less than the limit allow the action…
- Else;
- Check if user is admin, and have approval more than the approval limit for admins.
- Check if user is member, and have approval more than the approval limit for members.