<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class StoreKycSubmissionRequest extends FormRequest
{
    /**
     * @return array<string, mixed>
     */
    public function rules(): array
    {
        return [
            'legal_first_name' => ['required', 'string', 'max:120'],
            'legal_last_name' => ['required', 'string', 'max:120'],
            'date_of_birth' => ['required', 'date', 'before:today'],
            'document_type' => ['required', 'in:national_id,passport,drivers_license,residence_card'],
            'document_number' => ['required', 'string', 'max:80'],
            'document_issuing_country' => ['required', 'string', 'size:2', 'regex:/^[A-Za-z]{2}$/'],
            'country_of_residence' => ['required', 'string', 'size:2', 'regex:/^[A-Za-z]{2}$/'],
            'address_line1' => ['required', 'string', 'max:255'],
            'address_line2' => ['nullable', 'string', 'max:255'],
            'city' => ['required', 'string', 'max:120'],
            'region_state' => ['required', 'string', 'max:120'],
            'postal_code' => ['required', 'string', 'max:40'],
            'occupation' => ['nullable', 'string', 'max:160'],
            'document_front' => ['required', 'file', 'max:15360', 'mimes:jpeg,jpg,png,webp,pdf'],
            'document_back' => ['nullable', 'file', 'max:15360', 'mimes:jpeg,jpg,png,webp,pdf'],
            'selfie_document' => ['nullable', 'file', 'max:15360', 'mimes:jpeg,jpg,png,webp'],
        ];
    }
}
