<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class FinanceGroupSiteLimit extends Model
{
    use HasFactory;

    protected $fillable = [
        'site_id',
        'finance_group_id',
        'min_amount',
        'max_amount',
    ];

    protected $casts = [
        'min_amount' => 'decimal:2',
        'max_amount' => 'decimal:2',
    ];

    public function site()
    {
        return $this->belongsTo(Site::class);
    }

    public function financeGroup()
    {
        return $this->belongsTo(FinanceGroup::class);
    }
}

