<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class StockTransferOutItem extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = [
        'stock_transfer_out_id',
        'item_id',
        'quantity',
        'received_qty',
        'remaining_qty',
        'item_code_snapshot',
        'item_name_snapshot',
    ];

    public function stockTransferOut()
    {
        return $this->belongsTo(StockTransferOut::class, 'stock_transfer_out_id', 'id');
    }

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