<?php

namespace App\Models;

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

class RestokLog extends Model
{
    use HasFactory;

    protected $table = 'restok_logs';

    protected $fillable = [
        'produk_id',
        'user_id',
        'stok_sebelum',
        'jumlah_tambah',
        'stok_sesudah',
        'catatan',
    ];

    public function produk()
    {
        return $this->belongsTo(Produk::class, 'produk_id');
    }

    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }
}
