<?php
// app/Models/BOMComponent.php

namespace App\Models;

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

class BOMComponent extends Model
{
    use HasFactory;

    protected $fillable = [
        'bom_id',
        'product_id',
        'quantity',
        'sequence'
    ];

    public function bom()
    {
        return $this->belongsTo(BillOfMaterial::class, 'bom_id');
    }

    public function product()
    {
        return $this->belongsTo(Product::class, 'product_id');
    }
}