<?php

namespace App\Http\Requests;

use App\Enums\FoodCategory;
use App\Enums\WeightUnit;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class RefrigeratorItemRequest extends FormRequest
{
    /**
     * @return array<string, mixed>
     */
    public function rules(): array
    {
        return [
            'name' => ['required', 'string', 'max:255'],
            'category' => ['required', Rule::enum(FoodCategory::class)],
            'quantity' => ['required', 'numeric', 'min:0.01'],
            'unit' => ['required', Rule::enum(WeightUnit::class)],
            'expiry_date' => ['nullable', 'date'],
            'added_at' => ['nullable', 'date'],
        ];
    }
}
