<?php

namespace App\Models;

use App\Models\Concerns\BelongsToBranch;
use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;

#[Fillable(['branch_id', 'user_id', 'opname_date', 'status', 'note'])]
class StockOpname extends Model
{
    use BelongsToBranch;

    protected $table = 'stock_opname';

    protected function casts(): array
    {
        return ['opname_date' => 'date'];
    }

    public function details()
    {
        return $this->hasMany(StockOpnameDetail::class);
    }
}
