<?php

namespace App\Http\Requests\V1\ExpectedExpense;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'ids' => ['required', 'array', 'min:1'],
            'ids.*' => ['required', 'integer'],
            'expected_payment_date' => ['required', 'date'],
        ];
    }

    public function messages(): array
    {
        return [
            'ids.required' => __('validation.required', ['attribute' => '대상 ID']),
            'ids.min' => __('validation.min.array', ['attribute' => '대상 ID', 'min' => 1]),
            'expected_payment_date.required' => __('validation.required', ['attribute' => '예상 지급일']),
        ];
    }

    public function attributes(): array
    {
        return [
            'ids' => '대상 ID',
            'expected_payment_date' => '예상 지급일',
        ];
    }
}
