<?php

declare(strict_types=1);

namespace App\Models;

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

class MarketPrice extends Model
{
    protected $guarded = ['id', 'created_at', 'updated_at'];

    protected $casts = [
        'price' => 'integer',
        'change' => 'float',
        'recorded_at' => 'datetime',
    ];

    public function category(): BelongsTo
    {
        return $this->belongsTo(Category::class);
    }

    public function breed(): BelongsTo
    {
        return $this->belongsTo(Breed::class);
    }

    public function province(): BelongsTo
    {
        return $this->belongsTo(\Mortezaa97\Regions\Models\Province::class);
    }

    public function county(): BelongsTo
    {
        return $this->belongsTo(\Mortezaa97\Regions\Models\County::class);
    }
}
