<?php

namespace App\Http\Requests\TaskTemplates;

use Illuminate\Foundation\Http\FormRequest;

class StoreTaskTemplateRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'name' => ['required', 'string', 'max:255'],
            'frequency' => ['required', 'in:daily,weekly,biweekly,monthly'],
            'anchor_date' => ['nullable', 'date_format:Y-m-d'],
            'anchor_weekday' => ['nullable', 'integer', 'min:0', 'max:6'],
            'anchor_day_of_month' => ['nullable', 'integer', 'min:1', 'max:31'],
            'description' => ['nullable', 'string'],
        ];
    }
}
