<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;

class SupplierOrder extends BaseModel
{
    protected $guarded = ['id'];
    protected $casts = [
        'items' => 'array',
        'totalAmount' => 'decimal:2',
        'orderDate' => 'date',
        'deliveryDate' => 'date',
    ];

    public function supplier(): BelongsTo { return $this->belongsTo(Supplier::class); }
    public function project(): BelongsTo { return $this->belongsTo(Project::class); }
}
