<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Attributes\Fillable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

#[Fillable(['item_id', 'name', 'dine_in_price', 'delivery_price', 'takeaway_price', 'is_active'])]
class ItemVariant extends Model
{
    protected $casts = [
        'dine_in_price' => 'decimal:2',
        'delivery_price' => 'decimal:2',
        'takeaway_price' => 'decimal:2',
        'is_active' => 'boolean',
    ];

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