<?php

declare(strict_types=1);

namespace App\Http\Requests;

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

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

    /** @return array<string, array<int, mixed>> */
    public function rules(): array
    {
        return [
            'method' => ['required', Rule::in(['credit', 'paypal', 'bank_transfer'])],
        ];
    }

    /** @return array<string, string> */
    public function messages(): array
    {
        return [
            'method.required' => 'Payout method is required.',
            'method.in' => 'Payout method must be credit, paypal, or bank_transfer.',
        ];
    }
}
