<?php

namespace Modules\Accounts\Http\Requests\BankAccount;

use Illuminate\Foundation\Http\FormRequest;
use Modules\Core\Traits\FailedValidation;

class BankAccountTransactionRequest extends FormRequest
{
    use FailedValidation;

    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'amount' => ['required', 'numeric', 'gt:0'],
            'voucher_date' => ['required', 'date'],
            'counter_account_id' => ['required', 'integer', 'exists:chart_of_accounts,id'],
            'reference' => ['nullable', 'string'],
        ];
    }
}
