<?php

namespace App\Models;

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

class DeliveryNote extends Model
{
    use SoftDeletes;

    protected $fillable = [
        'dn_number',
        'purchase_order_id',
        'delivery_date',
        'status',
        'remarks'
    ];

    protected $casts = [
        'delivery_date' => 'date'
    ];

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