<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Ticket extends Model
{
    use SoftDeletes;

    protected $fillable = ['client_id', 'installation_id', 'technician_id', 'subject', 'description', 'status', 'priority'];

    public function client()
    {
        return $this->belongsTo(Client::class);
    }

    public function installation()
    {
        return $this->belongsTo(Installation::class);
    }

    public function technician()
    {
        return $this->belongsTo(User::class, 'technician_id');
    }
}
