<?php

namespace App\Models\Fish;

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

class SpeciesFeaturePref extends Model
{
    protected $table = 'species_feature_prefs';

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

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

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

    /**
     * Geçerli eval_type değerleri.
     */
    public static function validEvalTypes(): array
    {
        return [
            'range',
            'categorical',
            'distance_bonus',
            'distance_penalty',
            'trend',
            'gradient',
            'presence',
            'value_in_set',
        ];
    }
}
