- StoreSalaryRequest, UpdateSalaryRequest의 allowance_details.*, deduction_details.* 벨리데이션을 array에서 numeric으로 변경
- 수당/공제 항목은 {항목명: 금액} 구조이므로 값은 숫자가 올바름
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
1.2 KiB
PHP
34 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V1\Salary;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateSalaryRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'employee_id' => ['nullable', 'integer', 'exists:users,id'],
|
|
'year' => ['nullable', 'integer', 'min:2020', 'max:2100'],
|
|
'month' => ['nullable', 'integer', 'min:1', 'max:12'],
|
|
'base_salary' => ['nullable', 'numeric', 'min:0'],
|
|
'total_allowance' => ['nullable', 'numeric', 'min:0'],
|
|
'total_overtime' => ['nullable', 'numeric', 'min:0'],
|
|
'total_bonus' => ['nullable', 'numeric', 'min:0'],
|
|
'total_deduction' => ['nullable', 'numeric', 'min:0'],
|
|
'allowance_details' => ['nullable', 'array'],
|
|
'allowance_details.*' => ['nullable', 'numeric'],
|
|
'deduction_details' => ['nullable', 'array'],
|
|
'deduction_details.*' => ['nullable', 'numeric'],
|
|
'payment_date' => ['nullable', 'date'],
|
|
'status' => ['nullable', 'string', 'in:scheduled,completed'],
|
|
];
|
|
}
|
|
}
|