<?php

namespace App\Models;

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

#[Fillable(['branch_id', 'product_id', 'quantity'])]
class ProductStock extends Model
{
    use BelongsToBranch;

    protected function casts(): array
    {
        return ['quantity' => 'decimal:3'];
    }

    public function product()
    {
        return $this->belongsTo(Product::class);
    }
}
