<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class ManufacturingConsumption extends Model
{
    protected \ = 'manufacturing_consumption';
    
    protected \ = [
        'product_id',
        'material_id',
        'quantity_used',
        'unit',
        'production_date',
        'batch_number',
        'notes'
    ];

    protected \ = [
        'production_date' => 'date',
        'quantity_used' => 'decimal:2'
    ];

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

    public function material()
    {
        return \->belongsTo(Material::class);
    }
}
