<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\BelongsTo;

class Batch extends BasePosModel
{
    protected function casts(): array
    {
        return [
            'manufactured_at' => 'date',
            'expires_at' => 'date',
            'quantity' => 'decimal:4',
            'cost_price' => 'decimal:4',
        ];
    }

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

    public function branch(): BelongsTo
    {
        return $this->belongsTo(Branch::class);
    }
}
