<?php

namespace App\Models\Agency;

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

class Currency extends Model
{
    use HasFactory;

    protected $table = 'currencies';

    protected $fillable = [
        'agency_id',
        'code',
        'symbol',
        'exchange_rate',
        'is_active',
        'is_base'
    ];

    protected $casts = [
        'exchange_rate' => 'decimal:6',
        'is_active' => 'boolean',
        'is_base' => 'boolean',
    ];

    public function agency()
    {
        return $this->belongsTo(Agency::class);
    }
}
