<?php

namespace App\Http\Requests;

use App\Models\CajaMovimiento;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class StoreCajaMovimientoRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'tipo' => ['required', Rule::in([
                CajaMovimiento::TIPO_INGRESO,
                CajaMovimiento::TIPO_EGRESO,
            ])],
            'monto' => ['required', 'numeric', 'min:0.01'],
            'motivo' => ['nullable', 'string', 'max:500'],
        ];
    }
}
