Transactions and Money Flow Rules - AshleyThew/Bank GitHub Wiki
Transactions and Money Flow Rules
Overview
Money, exp, and loan flows are separate transaction subsystems with shared tax and history concepts.
How It Works
Money flow (BankMoneyInfo):
- Deposit pulls from economy provider and stores net amount after tax.
- Withdraw pushes to economy provider and subtracts gross amount including tax rules.
- Send moves between bank accounts and records sender/receiver entries.
Exp flow (BankExpInfo):
- Deposit removes player exp and stores net amount after tax.
- Withdraw adds exp to player and subtracts from bank exp.
- Send transfers exp between player bank accounts.
Loan flow (BankLoansInfo + loan managers):
- Loan creation deposits original amount via economy provider.
- Payback withdraws via economy first, then falls back to bank money subtraction if needed.
- Deadline, interest, and payback managers are feature-toggled.
Transaction subsystems
- Money transaction subsystem
- Exp transaction subsystem
- Loan lifecycle subsystem
- Tax accounting subsystem
- History retention subsystem
Configuration
Key rule controls:
Bank.Money.Deposit.Tax.PercentBank.Money.Withdraw.Tax.PercentBank.Exp.Deposit.Tax.PercentBank.Exp.Withdraw.Tax.PercentBank.Money.Transaction.Max.HistoryBank.Exp.Transaction.Max.HistoryBank.Loans.*
Admin checklist:
- Set tax behavior for money and exp independently.
- Set max history retention for both ledgers.
- Configure loan limits, timers, and interest if loans are enabled.
- Validate economy provider stability before enabling high-volume transaction features.
Commands
- Player:
/bank money ...,/bank exp ...,/bank cheque ... - Admin:
/bank admin money ...,/bank admin exp ...,/bank admin tax ...
Permissions
Core command permissions control transaction endpoints. Interest/loan bounds also depend on permission-value prefixes.
Data and Storage
SQL backends create transaction tables with:
uuid,type,amount,description,extra,timestamp
Separate money and exp transaction databases are maintained.
Examples
- Deposit with tax: player deposits 100, tax 5%, account receives 95, tax storage increases by 5.
- Interest payout on login: offline accrued amount is capped by max-add logic and then recorded as interest transaction.
Troubleshooting
- Economy errors on money operations usually indicate missing or failing Vault economy provider.
- Unexpected tax behavior: verify both deposit and withdraw tax keys and full-dollar settings.
- Loan repayment anomalies: verify payback timer/percent keys and permission-prefix limits.