<?php
namespace App\Models\Inventory;
use App\Models\User;
use App\Traits\BelongsToStore;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class InventoryCheck extends Model
{
    use BelongsToStore;
    protected $table = 'inventory_checks';
    protected $fillable = ['store_id','check_no','warehouse_id','items','status','finish_remark','operator_id'];
    protected function casts(): array { return ['items'=>'array','status'=>'integer']; }
    public function warehouse(): BelongsTo { return $this->belongsTo(Warehouse::class); }
    public function operator(): BelongsTo { return $this->belongsTo(User::class, 'operator_id'); }
}
