<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Booking extends Model
{
    protected $guarded = [];

    public const QUOTATION_STATUSES = [
        'Pending',
        'Confirmed',
    ];

    public function items()
    {
        return $this->hasMany(BookingItem::class);
    }

    public function otherCosts()
    {
        return $this->hasMany(BookingOtherCost::class);
    }

    public function delivery()
    {
        return $this->hasOne(BookingDelivery::class);
    }

    public function payments()
    {
        return $this->hasOne(BookingPayment::class);
    }

    public function statusHistory()
    {
        return $this->hasMany(BookingStatusHistory::class);
    }

    public function priority()
    {
        return $this->belongsTo(JobPriority::class, 'job_priority_id');
    }

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

    public function printJob()
    {
        return $this->hasOne(PrintJob::class);
    }
}
