<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class UpdateAffiliateSettingsRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'code_binding_days' => 'required|integer|min:1|max:365',
        ];
    }

    /**
     * Get custom error messages for validation rules.
     *
     * @return array
     */
    public function messages()
    {
        return [
            'code_binding_days.required' => 'The code binding days setting is required.',
            'code_binding_days.integer' => 'The code binding days must be a number.',
            'code_binding_days.min' => 'The code binding days must be at least 1 day.',
            'code_binding_days.max' => 'The code binding days cannot exceed 365 days.',
        ];
    }
}


