<?php

namespace App\Models;

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

final class QuotationItem extends Model
{
    protected $fillable=['quotation_id','line_number','service_type_id','route_id','vehicle_type','description','quantity','unit','unit_rate','discount_amount','taxable_amount','vat_rate','vat_amount','line_total','tax_code_id'];
    protected function casts():array{return['quantity'=>'decimal:4','unit_rate'=>'decimal:4','discount_amount'=>'decimal:4','taxable_amount'=>'decimal:4','vat_rate'=>'decimal:4','vat_amount'=>'decimal:4','line_total'=>'decimal:4'];}
    public function quotation():BelongsTo{return $this->belongsTo(Quotation::class);} public function serviceType():BelongsTo{return $this->belongsTo(ServiceType::class);} public function route():BelongsTo{return $this->belongsTo(TransportRoute::class);} public function taxCode():BelongsTo{return $this->belongsTo(TaxCode::class);}
}
