<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'rc_number'    => ['required', 'string', 'max:20'],
            'company_type' => [
                'required',
                'string',
                'in:COMPANY,BUSINESS_NAME,INCORPORATED_TRUSTEES,LIMITED_PARTNERSHIP,LIMITED_LIABILITY_PARTNERSHIP',
            ],
        ];
    }

    public function messages(): array
    {
        return [
            'rc_number.required'    => 'RC number is required.',
            'rc_number.max'         => 'Invalid RC number format.',
            'company_type.required' => 'Company type is required.',
            'company_type.in'       => 'Invalid company type. Must be one of: COMPANY, BUSINESS_NAME, INCORPORATED_TRUSTEES, LIMITED_PARTNERSHIP, LIMITED_LIABILITY_PARTNERSHIP.',
        ];
    }
}
