<?php

namespace App\Http\Requests\Payments;

use App\Http\Requests\ApiFormRequest;

class PaymentCreateRequest extends ApiFormRequest
{
    public function rules(): array
    {
        return [
            'parent_id' => ['required', 'integer', 'exists:users,id'],
            'total_amount' => ['required', 'numeric', 'min:0.01'],
            'number_of_installments' => ['required', 'integer', 'min:1'],
            'payment_date' => ['nullable', 'date'],
            'payment_method' => ['nullable', 'string', 'max:50'],
            'payment_type' => ['nullable', 'string', 'max:50'],
            'status' => ['nullable', 'string', 'max:50'],
            'semester' => ['nullable', 'string', 'max:50'],
            'school_year' => ['nullable', 'string', 'max:50'],
        ];
    }
}
