<?php

namespace App\Models;

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

class CourierBooking extends Model
{
    protected $fillable = [
        'order_id',
        'courier_name',
        'consignment_id',
        'tracking_code',
        'cod_amount',
        'delivery_status',
        'raw_response',
    ];

    protected $casts = [
        'cod_amount' => 'decimal:2',
        'raw_response' => 'array',
    ];

    public function order(): BelongsTo
    {
        return $this->belongsTo(Order::class);
    }
}
