<?php

namespace App\Models\Interview;

use App\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;

class InterviewAnswer extends Model
{
    use BelongsToTenant;

    protected $fillable = [
        'tenant_id',
        'interview_session_id',
        'interview_question_id',
        'interview_template_id',
        'is_checked',
        'answer_text',
        'memo',
    ];

    protected $casts = [
        'is_checked' => 'boolean',
    ];

    public function session()
    {
        return $this->belongsTo(InterviewSession::class, 'interview_session_id');
    }

    public function question()
    {
        return $this->belongsTo(InterviewQuestion::class, 'interview_question_id');
    }

    public function template()
    {
        return $this->belongsTo(InterviewTemplate::class, 'interview_template_id');
    }
}
