<?php

namespace App\Models\Ecommerce\Product\Inventory;

use App\Models\Ecommerce\Product\Product\Product;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class InventoryHistoryRemovedItem extends Model
{
    use HasFactory;

    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'inventory_history_removed_id',
        'product_id',
        'quantity',
        'total',
        'cost_amount',
    ];

    /**
     * Inventory history
     */
    public function inventoryHistoryRemoved(): BelongsTo
    {
        return $this->belongsTo(InventoryHistoryRemoved::class, 'inventory_history_removed_id');
    }

    /**
     * Product
     */
    public function product(): BelongsTo
    {
        return $this->belongsTo(Product::class);
    }
}
