<?php

namespace App\Http\Requests\ExtraCharges;

use App\Http\Requests\ApiFormRequest;

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

    public function rules(): array
    {
        return [
            'parent_id' => ['required', 'integer', 'min:1'],
            'title' => ['required', 'string', 'min:2'],
            'amount' => ['required', 'numeric'],
            'charge_type' => ['required', 'in:add,deduct'],
            'due_date' => ['nullable', 'date_format:Y-m-d'],
            'invoice_id' => ['nullable', 'integer', 'min:1'],
            'description' => ['nullable', 'string'],
            'school_year' => ['nullable', 'string'],
            'semester' => ['nullable', 'string'],
        ];
    }
}
