<?php

namespace App\Models;

use App\Traits\HotelScopeTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class SurveyQuestion extends Model
{
    use HasFactory, HotelScopeTrait;

    protected $fillable = [
        'hotel_id',
        'survey_id',
        'question',
        'type',
        'options',
        'order',
        'is_required'
    ];

    protected $casts = [
        'options' => 'array',
        'is_required' => 'boolean'
    ];

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