<?php

declare(strict_types=1);

namespace App\Models;

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

class CollectionRecommendationSnapshot extends Model
{
    use HasFactory;

    protected $fillable = [
        'collection_id',
        'context_key',
        'recommendation_score',
        'rationale_json',
        'snapshot_date',
    ];

    protected $casts = [
        'rationale_json' => 'array',
        'snapshot_date' => 'date',
    ];

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