<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class BusinessDebtInstallment extends Model
{
    protected $fillable = [
        'business_debt_id',
        'installment_number',
        'amount',
        'due_date',
        'status',
    ];

    protected $casts = [
        'due_date' => 'date',
    ];

    /**
     * Get the debt that this installment belongs to.
     */
    public function businessDebt(): BelongsTo
    {
        return $this->belongsTo(BusinessDebt::class);
    }
}
