<?php

namespace App\Http\Requests\Attachment;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'file'            => ['required', 'file', 'mimes:jpg,jpeg,png,pdf', 'max:10240'],
            'type'            => ['required', 'in:passport,cnic'],
            'document_number' => ['nullable', 'string', 'max:50'],
            'full_name'       => ['nullable', 'string', 'max:255'],
            'dob'             => ['nullable', 'date'],
            'expiry_date'     => ['nullable', 'date', 'after:today'],
            'nationality'     => ['nullable', 'string', 'max:100'],
            'issuing_country' => ['nullable', 'string', 'max:100'],
        ];
    }
}
