> For the complete documentation index, see [llms.txt](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jiffyjrdevelopment.gitbook.io/jiffyjrdevelopmentdocs/jiffy-jr-development-docs/jiffy-banking-v1/editables.md).

# Editables

The `editables/` folder contains files that are **not** escrow-protected. You can read and modify them freely. They are loaded at startup and override the default behaviour of the protected scripts.

***

## `editables/server.lua` — Inventory Hooks

This file controls how the bank card item is given, checked, and removed from players. By default it uses QBCore `Player.Functions.*`.

```lua
-- Default (QBCore / QBox with QBCore items)
function Jiffy.Integration.GiveBankCard(src, itemName)
    local Player = Jiffy.QBCore.Functions.GetPlayer(src)
    if not Player then return false end
    Player.Functions.AddItem(itemName, 1)
    return true
end
```

### Switching to `ox_inventory`

Open `editables/server.lua` and uncomment the `ox_inventory` block:

{% tabs %}
{% tab title="ox\_inventory" %}

```lua
function Jiffy.Integration.GiveBankCard(src, itemName)
    return exports.ox_inventory:AddItem(src, itemName, 1) == true
end

function Jiffy.Integration.HasBankCard(src, itemName)
    return exports.ox_inventory:GetItem(src, itemName, nil, true) ~= nil
end

function Jiffy.Integration.RemoveBankCard(src, itemName)
    return exports.ox_inventory:RemoveItem(src, itemName, 1) == true
end
```

{% endtab %}

{% tab title="ESX with ox\_inventory" %}
{% hint style="info" %}
If you are using **ESX with ox\_inventory**, use this same block. Comment out the default QBCore block first.
{% endhint %}
{% endtab %}
{% endtabs %}

### Switching to `mf-inventory`

```lua
function Jiffy.Integration.GiveBankCard(src, itemName)
    exports['mf-inventory']:addItem(src, itemName, 1)
    return true
end

function Jiffy.Integration.HasBankCard(src, itemName)
    return exports['mf-inventory']:hasItem(src, itemName, 1)
end

function Jiffy.Integration.RemoveBankCard(src, itemName)
    exports['mf-inventory']:removeItem(src, itemName, 1)
    return true
end
```

***

## `editables/client.lua` — Notifications

This file overrides the `Jiffy.Notify` function. By default, jiffy-banking uses `Config.Notify` (`'qb'` or `'ox'`). Uncomment one of the blocks below to use a different notification system.

{% tabs %}
{% tab title="okokNotify" %}

```lua
function Jiffy.Notify(message, ntype)
    local typeMap = { primary = 'info', success = 'success', error = 'error' }
    exports['okokNotify']:Alert('Jiffy Banking', message, 5000, typeMap[ntype] or 'info', false)
end
```

{% endtab %}

{% tab title="ox\_lib (alternative to Config.Notify = " %}

```lua
function Jiffy.Notify(message, ntype)
    local typeMap = { primary = 'inform', success = 'success', error = 'error' }
    exports.ox_lib:notify({ title = 'Jiffy Banking', description = message, type = typeMap[ntype] or 'inform' })
end
```

{% endtab %}

{% tab title="ESX.ShowNotification" %}

```lua
local ESX = exports['es_extended']:getSharedObject()
function Jiffy.Notify(message, ntype)
    ESX.ShowNotification(message)
end
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
Only uncomment **one** block at a time. Multiple `Jiffy.Notify` definitions will cause the last one to win, which may not be what you expect.
{% endhint %}

***

## `editables/items/`

Pre-made item registration files for each framework. See [Item Registration](/jiffyjrdevelopmentdocs/jiffy-jr-development-docs/jiffy-banking-v1/item-registration.md) for usage.

| File               | Purpose                                           |
| ------------------ | ------------------------------------------------- |
| `qb-item.md`       | Entry to paste into `qb-core/shared/items.lua`    |
| `qbox-items.lua`   | Entry to paste into `ox_inventory/data/items.lua` |
| `esx-items.sql`    | SQL to run once in your database                  |
| `banking_card.png` | Item image for your inventory resource            |
