# Crowe Banking

RedM banking for VORP Core with a modern, monochrome NUI. Includes player banking, safebox, transfers, loans, a full banker console, society integration, and unified notifications.

Features

* Player accounts per bank: unique account numbers, open-account flow, automatic legacy backfill from `bank_users` when present
* Deposits & withdrawals: cash and gold; per-action audit trail in DB with optional Discord webhooks
* Transfers: bank-to-bank with configurable fee (`Config.feeamount`), including withdraw-from-other convenience
* Safebox: per-bank inventory via VORP Inventory; upgradeable slots; auto-migration of legacy container IDs; safebox hold enforcement
* Activity log: searchable, filterable recent transactions and loan payments
* Loans: request/approval workflow, approval confirmation step, repayments, daily interest cadence (`Config.LoanInterestIntervalDays`), risk meter and analysis, missed-payment strikes and defaulting
* Banker console: pending/active lists; borrower overview; tools overlay (Freeze Outgoing, Freeze Full, Hold Safebox, Flag/Unflag with reason, Add Internal Note, Seize Bank Assets → apply to loan)
* Business/Society banking: deposit/withdraw to societies with permission checks via `crowe_society`; live details (funds, rank, permissions)
* Unified notifications: prefers `crowe_notification`, then `crowe_libs`, else clean NUI toasts (server uses a single `notifyCrowe` helper)
* Localization: full multi-language support (UI and server notifications)
  * Included UI locales: `en`, `es`, `fr`, `pt`, `de`, `it`, `ru`, `pl`, `tr`, `zh`, `ja`, `ko`, `nl`, `ar`
  * Server notification locales: separate files like `locales/en_server.lua`, `locales/es_server.lua`, etc.
  * Manifest auto-loads all locales via `locales/*.lua`

Installation

* Place `crowe_banking` in your `resources` folder
* Add `ensure crowe_banking` to `server.cfg`
* Import `sql/db.sql`
* Configure `config.lua` (banks, feeamount, hours, webhooks, language, loans, permissions)

Dependencies

* Required: `vorp_core`, `vorp_inventory`, `oxmysql`
* Optional: `crowe_notification`, `crowe_libs`, `crowe_society`

Configuration

* Banks & UI
  * `Config.banks`: locations, NPCs, blips, hours, safebox limits and pricing
  * `Config.Key`: interaction key for prompts
* Transfers & Fees
  * `Config.feeamount`: transfer fee multiplier (e.g., 0.9 ⇒ 10% fee)
* Loans
  * `Config.LoansRequireApproval` (bool): require staff approval before disbursement
  * `Config.LoanInterestIntervalDays` (int): interest cadence for active loans
  * `Config.LoanAgreementText` (string): agreement body for approval confirmation overlay
  * Missed-payment strikes & default: when a player opens the bank UI and an active loan is overdue (`next_due_at` in the past), a strike is applied automatically, the next due date is advanced by one payment interval, and the player is notified. At 3 strikes the loan is marked as defaulted. Optionally set a separate payment interval with `Config.LoanPaymentIntervalDays`.
* Permissions
  * Traditional: `Config.JobBankerMap`
  * Society Mode: `Config.SingleJobMode.enabled = true` with `SingleJobMode.jobs` mapped to society names; server validates via `crowe_society`
* Webhooks
  * `WithdrawLogWebhook`, `DepositLogWebhook`, `TransferLogWebhook`, etc.
* Language
  * Set default language: `Config.Lang = 'en'`
  * Available languages: `Config.AvailableLanguages = { 'en','es','fr','pt','de','it','ru','pl','tr','zh','ja','ko','nl','ar' }`

Usage

* Open UI at a configured bank; manage balances, transfers, safebox
* Loans (if enabled): request → staff approval → player confirmation → repayments
* Business tab (if `crowe_society` running): deposit/withdraw to societies based on permissions
* Banker console (authorized staff): review loans, open borrower overviews, apply tools (freeze/flag/notes/seize)

Admin/Staff

* Permissions are enforced server-side (traditional jobs or society-based)
* Banker approvals/declines/confirmations are available via the in-game banker console
* Server events exist for integrations (see `client/client.lua` and `server/server.lua`)

Database

* `crowe_banking`, `crowe_banking_transactions`, `crowe_banking_loans`
* `crowe_banking_account_meta` (freeze flags, safebox hold, flagged), `crowe_banking_account_notes`

Notes

* Crowe Notifications are used automatically if the resource is running; otherwise a simple toast fallback is used
* Default language is `en` (`Config.Lang = 'en'`)

Credits

* Based on and adapted from `vorp_banking` with Crowe UI enhancements


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://crowescripts.gitbook.io/documentation/about-our-scripts/redm-script-documentation/crowe-banking.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
