🪝 Hooks
Register from a server resource after Finance starts. Before callbacks receive (source, payload); after callbacks receive (source, payload, result).
Prefer built-in limits when they cover your rule.
Common before/after pairs: Deposit, Withdraw, Transfer, AddSocietyMoney, and RemoveSocietyMoney, such as beforeTransfer and afterTransfer.
Return false or { success = false, message = '...' } to refuse. Returning nothing allows processing. Thrown errors are logged, not treated as vetoes; explicitly refuse when your policy cannot decide safely.
After hooks observe result.success and cannot undo settlement. Do not repeat a payout because a hook failed, or start another money/freeze operation on the same locked account inside its hook.
Registrations are removed when the owning resource stops. Register again when it or Finance restarts, not on each player interaction.