<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class InstantBookingRequest extends Model
{
    protected $fillable = ['uuid', 'client_id', 'profession_id', 'specialty_id', 'concern', 'status', 'selected_offer_id', 'booking_id', 'expires_at'];
    protected $casts = ['expires_at' => 'datetime'];

    public function client() { return $this->belongsTo(User::class, 'client_id'); }
    public function profession() { return $this->belongsTo(Profession::class); }
    public function specialty() { return $this->belongsTo(Profession::class, 'specialty_id'); }
    public function offers() { return $this->hasMany(InstantBookingOffer::class); }
    public function booking() { return $this->belongsTo(Booking::class); }
    public function attachments() { return $this->hasMany(BookingAttachment::class); }
}
