<?php

namespace App\Http\Requests\Reimbursements;

use App\Http\Requests\ApiFormRequest;

class ReimbursementProcessRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'amount' => ['required', 'numeric', 'gt:0'],
            'reimbursed_to' => ['required', 'integer', 'min:1'],
            'reimbursement_method' => ['required', 'in:Cash,Check'],
            'check_number' => ['required_if:reimbursement_method,Check', 'nullable', 'string', 'max:50'],
            'receipt' => ['nullable', 'file', 'max:2048', 'mimes:jpg,jpeg,png,webp,gif,pdf'],
            'expense_id' => ['nullable', 'integer', 'min:1'],
            'description' => ['nullable', 'string'],
            'school_year' => ['nullable', 'string', 'max:20'],
            'semester' => ['nullable', 'string', 'max:20'],
        ];
    }
}
