<?php

namespace App\Models;

use App\Enums\ChickenStatus;
use App\Observers\ChickenObserver;
use Illuminate\Database\Eloquent\Attributes\ObservedBy;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

#[ObservedBy([ChickenObserver::class])]
class Chicken extends Model
{
    use HasFactory, SoftDeletes;

    protected $guarded = ['id'];

    protected function casts(): array
    {
        return [
            'hatch_date' => 'date',
            'arrival_date' => 'date',
            'exit_date' => 'date',
            'status' => ChickenStatus::class,
        ];
    }
}
