> 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/features/loans-credit.md).

# loans credit

## Credit Scoring

Every player has a credit score between **300 and 850**, persisted in the database. It is displayed on the banking dashboard home page.

| Score Range | Tier      |
| ----------- | --------- |
| 750 – 850   | Excellent |
| 700 – 749   | Very Good |
| 650 – 699   | Good      |
| 580 – 649   | Fair      |
| 300 – 579   | Poor      |

### What affects the score?

```lua
Config.Credit.StartingScore      = 650
Config.Credit.OnTimePaymentBonus = 5     -- points per on-time invoice payment
Config.Credit.LatePaymentPenalty = 15    -- points per late/overdue invoice
Config.Credit.LoanDefaultPenalty = 75    -- points when a loan defaults
Config.Credit.LoanPaidBonus      = 25    -- points when a loan is fully repaid
```

## Loans

Players apply for loans from the **Loans** page in the banking UI. Admins and banker managers can approve or deny applications from the Admin Panel or Banker Dashboard.

### Loan Types

```lua
Config.Loans.Types = {
    personal = {
        label           = 'Personal Loan',
        maxAmount       = 50000,
        minCreditScore  = 580,
        interestRate    = 0.07,    -- 7% simple interest on principal
        termDays        = 30,
        paymentInterval = 7,
    },
    vehicle = {
        label           = 'Vehicle Loan',
        maxAmount       = 200000,
        minCreditScore  = 620,
        interestRate    = 0.05,
        termDays        = 60,
        paymentInterval = 7,
    },
    business = {
        label           = 'Business Loan',
        maxAmount       = 500000,
        minCreditScore  = 680,
        interestRate    = 0.04,
        termDays        = 90,
        paymentInterval = 14,
    },
    medical = {
        label           = 'Medical Loan',
        maxAmount       = 25000,
        minCreditScore  = 500,
        interestRate    = 0.06,
        termDays        = 30,
        paymentInterval = 7,
    },
}
```

### Loan Options

```lua
Config.Loans.Enabled              = true
Config.Loans.AutoApprove          = false   -- true = instant approval, false = admin queue
Config.Loans.MaxActivePerPlayer   = 2       -- max open loans a player can hold at once
Config.Loans.DefaultsAfterMissed  = 3       -- missed payments before default
Config.Loans.PaymentCheckInterval = 30      -- minutes between payment checks
```

{% hint style="info" %}
With `AutoApprove = false`, loan applications go into a pending queue visible on the Admin Panel and Banker Dashboard. A manager must approve or deny each one.
{% endhint %}

## Loan Lifecycle

```
Applied → Pending → Approved → Active → (payments) → Paid Off
                 → Denied
                             → Late → Defaulted
```

1. Player applies, system validates credit score and active loan count.
2. If auto-approve is off, it sits in the pending queue.
3. On approval, the loan amount is deposited into the player's checking account.
4. The payment check runs every `PaymentCheckInterval` minutes. Players are notified when a payment is due.
5. After `DefaultsAfterMissed` consecutive missed payments, the loan is marked as **defaulted** and a credit penalty is applied.
