<?php

namespace App\Models;

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

class SurveyResponse extends Model
{
    use HasFactory;

    protected $table = 'survey_responses';

    public $timestamps = false;

    protected $fillable = [
        'survey_id',
        'respondent_id',
        'rating',
        'feedback',
        'completed_at',
    ];

    protected $casts = [
        'rating' => 'integer',
        'completed_at' => 'datetime',
    ];

    public function survey(): BelongsTo
    {
        return $this->belongsTo(CustomerSurvey::class, 'survey_id');
    }
}
