<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Concerns\HasUuids;
use Illuminate\Database\Eloquent\Model;

class SrsReview extends Model
{
    use HasFactory, HasUuids;

    protected $fillable = [
        'user_id', 'vocabulary_id', 'ease_factor', 'interval', 
        'repetitions', 'next_review_at', 'last_review_at', 'status'
    ];

    protected $casts = [
        'ease_factor' => 'decimal:2',
        'next_review_at' => 'datetime',
        'last_review_at' => 'datetime',
    ];

    public function vocabulary()
    {
        return $this->belongsTo(Vocabulary::class);
    }

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