<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'from_account_id' => ['required', 'exists:accounts,id'],
            'account_number' => ['required', 'string', 'max:34'],
            'routing_number' => ['required', 'string', 'max:20'],
            'recipient_name' => ['required', 'string', 'max:255'],
            'amount' => ['required', 'numeric', 'min:0.01'],
            'description' => ['nullable', 'string', 'max:500'],
            'category' => ['nullable', 'string', 'in:salary,transfer,shopping,utilities,entertainment,food,healthcare,education,investment,other'],
            'password' => ['required', 'string'],
        ];
    }
}
