<?php

namespace App\Models;

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

class StockTransferInItem extends Model
{
    use HasFactory;

    protected $fillable = [
        'stock_transfer_in_id',
        'item_id',
        'quantity',
        'item_code_snapshot',
        'item_name_snapshot',
    ];

    public function stockTransferIn()
    {
        return $this->belongsTo(StockTransferIn::class, 'stock_transfer_in_id', 'id');
    }

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