<?php

namespace App\Models\Orders;

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

/**
 * @mixin IdeHelperOrderItemComponent
 */
class OrderItemComponent extends Model
{
    use SoftDeletes;

    // 투입구성(자재, 제품, 부품, BOM)
    protected $table = 'order_item_components';

    protected $fillable = [
        'tenant_id', 'order_item_id', 'component_type', 'component_id', 'quantity',
        'unit', 'price', 'remarks', 'created_by', 'updated_by',
    ];

    public function orderItem()
    {
        return $this->belongsTo(OrderItem::class);
    }
}
