<?php

namespace App\Models;

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

class CapitalSettlement extends Model
{
    protected $fillable = [
        'supplier_id',
        'amount',
        'payment_date',
        'notes',
        'status',
        'confirmed_at'
    ];

    protected $casts = [
        'payment_date' => 'date',
        'confirmed_at' => 'datetime',
    ];

    /**
     * Get the supplier for the settlement.
     */
    public function supplier(): BelongsTo
    {
        return $this->belongsTo(Supplier::class);
    }
}
