<?php

namespace App\Models;

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

class SurveyFeedback extends Model
{
    use HasFactory;

    protected $fillable = ['code','survey_id', 'channel', 'time', 'customer_id', 'invoice_id', 'ip_address', 'agent'];

    public function detail() {
        return $this->hasMany(SurveyFeedbackDetail::class);
    }

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

    public function customer() {
        return $this->belongsTo(Customer::class);
    }

    public function invoice() {
        return $this->belongsTo(PosInvoice::class);
    }
}
