<?php

namespace App\Models\Fish;

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

class SpeciesRegionalOverride extends Model
{
    protected $table = 'species_regional_overrides';

    protected $fillable = [
        'species_id',
        'region_code',
        'feature_key',
        'eval_type',
        'params',
        'weight',
    ];

    protected $casts = [
        'params' => 'array',
        'weight' => 'decimal:2',
    ];

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

    /**
     * Geçerli bölge kodları.
     */
    public static function validRegions(): array
    {
        return ['ege', 'marmara', 'akdeniz', 'karadeniz'];
    }
}
