<?php

namespace App\Models;

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

class SalesOrderItem extends Model
{
    use HasFactory;

    protected $guarded = ['id'];

    // Relasi balik ke Induk SO
    public function salesOrder()
    {
        return $this->belongsTo(SalesOrder::class, 'sales_order_id');
    }

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