<?php
namespace App\Models;

use App\Models\Concerns\HasPublicId;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;

final class FiscalYear extends Model
{
    use HasPublicId;


protected $fillable = ['public_id','company_id','name','starts_on','ends_on','status'];
protected function casts(): array { return ['starts_on'=>'date','ends_on'=>'date']; }
public function company(): BelongsTo { return $this->belongsTo(Company::class); }
public function periods(): HasMany { return $this->hasMany(AccountingPeriod::class); }
}
