- 마이그레이션: payrolls, payroll_settings 테이블 생성 - 모델: Payroll (상태관리 draft→confirmed→paid), PayrollSetting - 서비스: PayrollService (4대보험 계산, 급여명세서) - 컨트롤러: PayrollController + FormRequest 5개 - API 엔드포인트 13개: - 급여 CRUD + confirm/pay/payslip - 일괄 계산/확정 (calculate, bulk-confirm) - 설정 관리 (settings/payroll) - Swagger 문서: PayrollApi.php - i18n: error.php, message.php, validation.php 키 추가
33 lines
808 B
PHP
33 lines
808 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\V1\Payroll;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class CalculatePayrollRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'year' => ['required', 'integer', 'min:2000', 'max:2100'],
|
|
'month' => ['required', 'integer', 'min:1', 'max:12'],
|
|
'user_ids' => ['nullable', 'array'],
|
|
'user_ids.*' => ['integer', 'exists:users,id'],
|
|
];
|
|
}
|
|
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'year' => __('validation.attributes.pay_year'),
|
|
'month' => __('validation.attributes.pay_month'),
|
|
'user_ids' => __('validation.attributes.user_ids'),
|
|
];
|
|
}
|
|
}
|