<?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 UserInterestProfile extends Model
{
    use HasFactory;

    protected $table = 'user_interest_profiles';

    protected $guarded = [];

    protected $casts = [
        'raw_scores_json' => 'array',
        'normalized_scores_json' => 'array',
        'last_event_at' => 'datetime',
        'half_life_hours' => 'float',
        'total_weight' => 'float',
    ];

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