feat: 급여 관리 API 구현 (Phase 2: 3.2)
- 마이그레이션: 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 키 추가
This commit is contained in:
54
app/Http/Requests/V1/Payroll/UpdatePayrollSettingRequest.php
Normal file
54
app/Http/Requests/V1/Payroll/UpdatePayrollSettingRequest.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\V1\Payroll;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdatePayrollSettingRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'income_tax_rate' => ['nullable', 'numeric', 'min:0', 'max:100'],
|
||||
'resident_tax_rate' => ['nullable', 'numeric', 'min:0', 'max:100'],
|
||||
'health_insurance_rate' => ['nullable', 'numeric', 'min:0', 'max:100'],
|
||||
'long_term_care_rate' => ['nullable', 'numeric', 'min:0', 'max:100'],
|
||||
'pension_rate' => ['nullable', 'numeric', 'min:0', 'max:100'],
|
||||
'employment_insurance_rate' => ['nullable', 'numeric', 'min:0', 'max:100'],
|
||||
'pension_max_salary' => ['nullable', 'numeric', 'min:0'],
|
||||
'pension_min_salary' => ['nullable', 'numeric', 'min:0'],
|
||||
'pay_day' => ['nullable', 'integer', 'min:1', 'max:31'],
|
||||
'auto_calculate' => ['nullable', 'boolean'],
|
||||
'allowance_types' => ['nullable', 'array'],
|
||||
'allowance_types.*.code' => ['required_with:allowance_types', 'string', 'max:20'],
|
||||
'allowance_types.*.name' => ['required_with:allowance_types', 'string', 'max:50'],
|
||||
'allowance_types.*.is_taxable' => ['nullable', 'boolean'],
|
||||
'deduction_types' => ['nullable', 'array'],
|
||||
'deduction_types.*.code' => ['required_with:deduction_types', 'string', 'max:20'],
|
||||
'deduction_types.*.name' => ['required_with:deduction_types', 'string', 'max:50'],
|
||||
];
|
||||
}
|
||||
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'income_tax_rate' => __('validation.attributes.income_tax_rate'),
|
||||
'resident_tax_rate' => __('validation.attributes.resident_tax_rate'),
|
||||
'health_insurance_rate' => __('validation.attributes.health_insurance_rate'),
|
||||
'long_term_care_rate' => __('validation.attributes.long_term_care_rate'),
|
||||
'pension_rate' => __('validation.attributes.pension_rate'),
|
||||
'employment_insurance_rate' => __('validation.attributes.employment_insurance_rate'),
|
||||
'pension_max_salary' => __('validation.attributes.pension_max_salary'),
|
||||
'pension_min_salary' => __('validation.attributes.pension_min_salary'),
|
||||
'pay_day' => __('validation.attributes.pay_day'),
|
||||
'auto_calculate' => __('validation.attributes.auto_calculate'),
|
||||
'allowance_types' => __('validation.attributes.allowance_types'),
|
||||
'deduction_types' => __('validation.attributes.deduction_types'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user