feat: 급여 관리 API 및 더미 시더 확장

- 급여 관리 API 추가 (SalaryController, SalaryService, Salary 모델)
  - 급여 목록/상세/등록/수정/삭제
  - 상태 변경 (scheduled/completed)
  - 일괄 상태 변경
  - 통계 조회
- 더미 시더 확장
  - 근태, 휴가, 부서, 사용자 시더 추가
  - 기존 시더 tenant_id/created_by/updated_by 필드 추가
- 부서 서비스 개선 (tree 조회 기능 추가)
- 카드 서비스 수정

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-25 03:48:32 +09:00
parent 0508282e58
commit 638e87b05d
35 changed files with 2057 additions and 24 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Http\Requests\V1\Salary;
use Illuminate\Foundation\Http\FormRequest;
class BulkUpdateStatusRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'ids' => ['required', 'array', 'min:1'],
'ids.*' => ['required', 'integer'],
'status' => ['required', 'string', 'in:scheduled,completed'],
];
}
public function messages(): array
{
return [
'ids.required' => __('validation.required', ['attribute' => 'ID 목록']),
'ids.min' => __('validation.min.array', ['attribute' => 'ID 목록', 'min' => 1]),
'status.required' => __('validation.required', ['attribute' => '상태']),
'status.in' => __('validation.in', ['attribute' => '상태']),
];
}
}

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Http\Requests\V1\Salary;
use Illuminate\Foundation\Http\FormRequest;
class StoreSalaryRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'employee_id' => ['required', 'integer', 'exists:users,id'],
'year' => ['required', 'integer', 'min:2020', 'max:2100'],
'month' => ['required', 'integer', 'min:1', 'max:12'],
'base_salary' => ['required', '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', 'array'],
'deduction_details' => ['nullable', 'array'],
'deduction_details.*' => ['nullable', 'array'],
'payment_date' => ['nullable', 'date'],
'status' => ['nullable', 'string', 'in:scheduled,completed'],
];
}
public function messages(): array
{
return [
'employee_id.required' => __('validation.required', ['attribute' => '직원']),
'employee_id.exists' => __('validation.exists', ['attribute' => '직원']),
'year.required' => __('validation.required', ['attribute' => '년도']),
'month.required' => __('validation.required', ['attribute' => '월']),
'base_salary.required' => __('validation.required', ['attribute' => '기본급']),
];
}
}

View File

@@ -0,0 +1,33 @@
<?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', 'array'],
'deduction_details' => ['nullable', 'array'],
'deduction_details.*' => ['nullable', 'array'],
'payment_date' => ['nullable', 'date'],
'status' => ['nullable', 'string', 'in:scheduled,completed'],
];
}
}