> For the complete documentation index, see [llms.txt](https://shredded.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shredded.gitbook.io/docs/paid-scripts/shr-banksystem/config.md).

# CONFIG

All settings live in `config.lua` (escrow-safe). Locale strings are in `locales/`.

## Language

```lua
Config.Locale = 'en' -- 'en' | 'cs'
```

This switches server notifications, interaction labels, **and the entire bank UI**.

Product display names for loans/savings are localized via `locales/cs.lua` and `locales/en.lua` (`product_loan_*`, `product_saving_*` keys). Config `label` fields are fallbacks.

## Modules

```lua
Config.Modules = {
    Bills = true,      -- esx_billing invoices
    Spending = true,   -- 30-day spending analytics
    Loans = false,     -- loan products + repayment UI
    Savings = false,   -- locked savings accounts
    Society = true,    -- company accounts (view/deposit/withdraw)
    IBAN = true,       -- account numbers on cards
    PIN = true,        -- card + ATM PIN
    Transfers = true,  -- player ID / IBAN transfers
}
```

## Interaction

```lua
Config.Interaction = 'ox_target' -- 'ox_target' | 'drawtext' | 'both'
Config.InteractionDistance = 2.0
Config.DrawTextKey = 38          -- E key
```

Bank locations: `Config.BankLocations`\
ATM props: `Config.ATMModels`\
Map blip: `Config.Blip`

## Limits & cooldowns

```lua
Config.Limits = {
    MinAmount = 1,
    MaxTransfer = 500000,
    MaxDeposit = 1000000,
    MaxWithdraw = 500000,
}

Config.TransactionRetentionDays = 30

Config.Cooldowns = {
    Transfer = 3,
    Withdraw = 2,
    Deposit = 1,
    PayBill = 5,
    Loan = 10,
    Saving = 5,
    Society = 3,
}
```

## PIN & IBAN

```lua
Config.PIN = {
    Length = 4,
    MaxAttempts = 3,
    LockDuration = 300,   -- seconds after too many wrong PINs
    RestoreCost = 500,    -- bank fee to reset PIN after card cancel
}

Config.IBAN = {
    Prefix = 'US',
    Digits = 7,
}
```

## Billing

```lua
Config.BillingCallbacks = {
    getBills = 'esx_billing:getBills',
    payBill = 'esx_billing:payBill',
}

Config.BillingJobLabels = {
    ['police'] = 'LSPD',
    -- sender label overrides for invoice list
}
```

## Society accounts

```lua
Config.Society = {
    ReadOnly = true,   -- if true: deposit/withdraw only via bossmenu, bank is view-only
    Logs = {
        Enabled = true,
        Table = 'shr_bossmenu_logs',
        Limit = 30,
        -- column mapping for activity feed
        JobColumn = 'job',
        ActionColumn = 'action_type',
        AmountColumn = 'amount',
        ExecutorColumn = 'actor_identifier',
        DescriptionColumn = 'details',
        CreatedAtColumn = 'created_at',
        Actions = { 'deposit', 'withdraw', 'invoice' },
    },
}

Config.SocietyJobs = {
    { name = 'police', grades = { 13, 14 }, label = 'LSPD', account = 'society_police' },
    -- name = ESX job, grades = allowed grades, account = esx_addonaccount name
}
```

Set `Logs.Enabled = false` if you do not use shr-bossmenu or another compatible log table.

## Loans

Enable with `Config.Modules.Loans = true`.

```lua
Config.LoanData = {
    {
        id = 'entry',
        label = 'Basic Loan',   -- fallback; UI uses locale product_loan_entry
        amount = 10000,         -- principal paid to player
        interest = 0,           -- % added to total repayment
        duration = 86400,       -- seconds until next due date after payment
        paymentRate = 0.05,     -- default installment = 5% of remaining
        jobs = { 'all' },       -- or { 'police', 'ambulance' }
    },
}
```

**In-game UI:** active loan shows principal, paid amount, installment, due date, progress bar, and payment options (custom amount, installment, full payoff).

## Savings

Enable with `Config.Modules.Savings = true`.

```lua
Config.SavingData = {
    {
        id = 'basic',
        label = 'Basic Savings',
        maxAmount = 10000,
        interest = 5,     -- % bonus on withdraw after lock
        lockDays = 7,
        jobs = { 'all' },
    },
}
```

**In-game UI:** active savings show deposited amount, projected bonus, total at maturity, lock progress, and unlock countdown.

## Avatar

```lua
Config.UseBadgerDiscordAPI = true  -- Discord avatar via Badger_Discord_API
Config.UseBadgerDiscordAPI = false -- Steam avatar fallback
Config.SteamWebApiKey = ''         -- https://steamcommunity.com/dev/apikey
```

Override completely in `open/server.lua` → `Open.Server.GetAvatarUrl(source)`.

## Discord webhooks

```lua
Config.DiscordWebhooks = {
    enabled = false,
    deposit = '',
    withdraw = '',
    transfer = '',
    paybill = '',
    loan = '',
    saving = '',
    society = '',
}
```

## Notifications

```lua
Config.Notify = function(message, ntype, isServer, src)
    if isServer then
        TriggerClientEvent('esx:showNotification', src, message)
    else
        TriggerEvent('esx:showNotification', message)
    end
end
```

Or use hooks in `open/client.lua` and `open/server.lua`.

## Escrow-safe files

Buyers can edit without breaking escrow:

| Path              | Purpose                  |
| ----------------- | ------------------------ |
| `config.lua`      | All configuration        |
| `locales/*.lua`   | Server + UI translations |
| `open/client.lua` | Client hooks             |
| `open/server.lua` | Server hooks             |
| `sql/install.sql` | Database install         |
