<?php

declare(strict_types=1);

namespace App\Models;

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

final class WrongQuestion extends Model
{
    protected $fillable = ['user_id', 'question_id', 'wrong_count', 'consecutive_correct_count', 'last_wrong_at', 'mastered_at'];

    protected $casts = [
        'last_wrong_at' => 'datetime',
        'mastered_at' => 'datetime',
    ];

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