<?php

namespace App\Http\Requests\Finance;

use Illuminate\Foundation\Http\FormRequest;

class PaymentAllocationRequest extends FormRequest
{
    public function authorize(): bool { return true; }
    public function rules(): array
    {
        return [
            'installments' => ['nullable','array'],
            'installments.*.installment_id' => ['required_with:installments','integer'],
            'installments.*.amount' => ['required_with:installments','numeric','min:0.01'],
        ];
    }
}
