<?php

namespace App\Http\Requests\Refunds;

use App\Http\Requests\ApiFormRequest;

class RefundPaymentRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return $this->user() !== null;
    }

    public function rules(): array
    {
        return [
            'paid_amount' => ['required', 'numeric', 'min:0.01'],
            'payment_method' => ['required', 'string', 'max:50', 'in:Check,Online,Cash'],
            'check_number' => ['nullable', 'string', 'max:80'],
            'check_file' => ['nullable', 'file', 'mimes:pdf,jpg,jpeg,png'],
        ];
    }
}
