<?php

namespace App\Models\Interview;

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

class InterviewQuestion extends Model
{
    use BelongsToTenant, ModelTrait, SoftDeletes;

    protected $fillable = [
        'tenant_id',
        'interview_template_id',
        'question_text',
        'question_type',
        'options',
        'ai_hint',
        'expected_format',
        'depends_on',
        'domain',
        'is_required',
        'sort_order',
        'is_active',
        'created_by',
        'updated_by',
        'deleted_by',
    ];

    protected $casts = [
        'options' => 'array',
        'depends_on' => 'array',
        'is_required' => 'boolean',
        'is_active' => 'boolean',
        'sort_order' => 'integer',
    ];

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