<?php

namespace App\Http\Requests\Loan;

use Illuminate\Foundation\Http\FormRequest;

class LoanSettleRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    public function rules(): array
    {
        return [
            'settlement_date' => ['required', 'date', 'date_format:Y-m-d'],
            'settlement_amount' => ['required', 'numeric', 'min:0.01', 'max:999999999999.99'],
        ];
    }

    /**
     * Get the validation attribute names.
     *
     * @return array<string, string>
     */
    public function attributes(): array
    {
        return [
            'settlement_date' => __('validation.attributes.settlement_date'),
            'settlement_amount' => __('validation.attributes.settlement_amount'),
        ];
    }
}
