<?php

namespace App\Models;

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

class Substockopname extends Model
{
    use HasFactory;

    protected $table = 'substockopnames';

    protected $fillable = ['*'];

    // Relasi ke tabel Stockopname (tabel utama)
    public function stockopname()
    {
        return $this->belongsTo(StockTransactionSo::class, 'so_id');
    }

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