<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class MealPostStatsRequest extends FormRequest
{
    public function rules(): array
    {
        return [
            'period' => ['sometimes', 'string', Rule::in(['day', 'week'])],
            'date' => ['sometimes', 'date_format:Y-m-d'],
        ];
    }

    public function authorize(): bool
    {
        return true;
    }
}
