<?php

namespace App\Http\Requests\ExtraCharges;

use App\Http\Requests\ApiFormRequest;

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

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