<?php

namespace App\Modules\Settings\Onboarding\Requests;

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

class SaveOnboardingTimezoneRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()?->can('onboarding.manage') ?? false;
    }

    public function rules(): array
    {
        return [
            'timezone' => ['required', 'string', 'max:64', Rule::in(config('onboarding.timezones', []))],
        ];
    }
}
