<?php

namespace App\Models;

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

class GatePassItem extends Model
{
    protected $fillable = [
        'gate_pass_id',
        'item_id',
        'purchase_order_item_id',
        'factory_invoice_id',
        'uom_id',
        'quantity',
        'dn_quantity'
    ];

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

    public function item(): BelongsTo
    {
        return $this->belongsTo(Account::class, 'item_id');
    }

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

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

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