<?php

namespace App\Modules\Production\Models;

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


class Recipe extends Model
{
    use HasFactory, SoftDeletes;

    protected $fillable = [
        'product_id',
        'code',
        'name',
        'description',
        'yield_quantity',
        'is_active',
    ];

    protected $casts = [
        'yield_quantity' => 'decimal:2',
        'is_active' => 'boolean',
    ];



    public function items()
    {
        return $this->hasMany(RecipeItem::class);
    }
}
