# Configuration

The Configuration files is pretty self explanatory but if i feel that it's needed to further advance this documentation i will!<br>

{% code title="Shared Config" %}

```lua
Config = {}

Config.Locale = 'en' -- [[ Currently supported locales English(en) and Swedish(sv) ]]
Config.StartTab = 'money'

-- The event will always be avaiable even if command and export is disabled (event: 'force_loanbank:open')
Config.Interaction = {
    Job = 'cardealer', -- Set this to nil if job should not be required
    Command = {
        Enabled = false,
        
        Name = 'loanbank',
        Restricted = function()
            return true -- If you want to restrict this command you can return the checker here
        end
    },

    Export = {
        Enabled = false,
        Name = 'openApp',
    },

    Target = {
        Enabled = true,

        Locations = { -- These locations will be set via a box on the vector3 it is possible to add them as a prop by just adding the prop name in a string instead of a vector3
            vector3(-1296.3135986328125, -839.0258178710938, 17.50705909729004)
        }
    },

    Text3D = {
        Enabled = false,

        Key = 'E',
        Color = 'b', -- FiveM color codes 
        Distance = 1.5,
        Locations = {
            vector3(-1295.6802978515625, -837.4457397460938, 17.14835929870605)
        }
    }
}

Config.LoanSettings = {
    MinLoan = 1000,
    MaxLoan = 1000000,

    MinRate = 3,
    MaxRate = 25
}

Config.AutoInvoice = {
    Enabled = true,
    Interval = 1, -- Set in Days
}

Config.Logs = {
    Enabled = true,
    Webhook = '',
    Color = 16711680
}

Config.Blip = {
    Enabled = true,

    Blips = {
        {
            Coords = vector3(-1295.6802978515625, -837.4457397460938, 17.14835929870605),
            Sprite = 78,
            Color = 1,
            Scale = 0.7,
            Label = "Maze Bank"
        }
    }
}

Config.ATM = {
    Props = {
        Enabled = true,
        Models = {
            ['prop_atm_01'] = vector4(-1289.1190185546875, -840.7296752929688, 17.14835929870605, 33.43619537353515),
        },
    }
}
```

{% endcode %}

{% code title="Client Config" %}

```lua
Client_config = {}

function Client_config:SendInvoice(loan, date)
    local framework = Funcs:GetFramework()
    
    if framework == 'ESX' then
        local invoice = {
            description = 'Lån: ' .. loan.monthAmount .. 'kr',
            date = date,
            price = loan.monthAmount,
            senderDob = '1956-03-20-5269',
            senderName = Locale["BankName"],
            senderJob = Config.Interaction.Job,
            receiver = {
                name = loan.firstname .. ' ' .. loan.lastname,
                socialnumber = loan.dob
            }
        }

        FrameworkBased:TriggerCallback('billing:createInvoice', function()
        end, invoice)
    elseif framework == 'QBCore' then
        TriggerServerEvent('force_loanbank:Bridge:SendInvoice', loan, date)
    end
end
```

{% endcode %}


---

# 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://docs.forcedevelopments.com/resources/force-loanbank/configuration.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.
