> For the complete documentation index, see [llms.txt](https://devmosaic.gitbook.io/devmosaic/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://devmosaic.gitbook.io/devmosaic/resources/devmosaic-banking/installation.md).

# Installation

**Install The Resource**

Place the resource anywhere in your resources folder.

Examples:

```
resources/[banking]/dm-banking
resources/[qb]/dm-banking
resources/[standalone]/dm-banking
```

The folder name should remain:

```
dm-banking
```

### 2. Import SQL

Import:

```
sql/dm-banking.sql
```

The base schema creates:

* `dm_banking_accounts`
* `dm_banking_acl`
* `dm_banking_transactions`
* `dm_banking_cards`

Loan tables are prepared by the server migration code when the resource starts.

### 3. Server CFG Order

Start dependencies first, then your framework, target/inventory, and then `dm-banking`.

QBCore example:

```cfg
ensure oxmysql
ensure ox_lib
ensure qb-core
ensure qb-target
ensure qb-inventory
ensure dm-banking
```

Qbox example:

```cfg
ensure oxmysql
ensure ox_lib
ensure qbx_core
ensure ox_target
ensure ox_inventory
ensure dm-banking
```

ESX example:

```cfg
ensure oxmysql
ensure ox_lib
ensure es_extended
ensure ox_target
ensure ox_inventory
ensure dm-banking
```

### 4. Configure Bridges

Recommended:

```lua
Config.Framework = 'auto'

Config.Bridge = {
    target = 'auto',
    inventory = 'auto',
    notify = 'auto',
}
```

Only force a bridge if auto detection chooses the wrong resource.

### 5. Add Bank Card Item

If `Config.Cards.inventory.enabled = true`, add the `bank_card` item to your inventory.

#### ox\_inventory

Add to `ox_inventory/data/items.lua`:

```lua
['bank_card'] = {
    label = 'Fleeca Bank Card',
    weight = 0,
    stack = false,
    close = true,
    description = 'A Fleeca Bank access card.',
}
```

#### qb-inventory / QBCore Item Table

Add to your shared items file:

```lua
bank_card = {
    name = 'bank_card',
    label = 'Fleeca Bank Card',
    weight = 0,
    type = 'item',
    image = 'bank_card.png',
    unique = true,
    useable = true,
    shouldClose = true,
    combinable = nil,
    description = 'A Fleeca Bank access card.',
},
```

#### Other Inventories

Create a unique item named:

```
bank_card
```

The item must support metadata.

### 6. Build UI After Editing Web Source

If you edit anything in `web/src`, rebuild:

```powershell
cd path\to\dm-banking\web
npm install
npm run build
```

Restart `dm-banking` after building.

### 7. Migrating From Another Banking Script

If you are replacing an existing banking resource, do not delete the old database tables before migration.

Read the full migration page:

Migration

Supported migration sources:

* `Renewed-Banking`
* `qb-banking`
* `esx_banking`

Always run a dry run first, then apply only after checking the console output.
