feat: [hr] 근태등록 + 휴가관리 통합 시스템 구현

- Leave 모델 확장: 6개 유형 추가 (출장/재택/외근/조퇴/지각사유서/결근사유서)
- LeaveService: 유형별 결재양식 자동 선택, 유형별 Attendance 반영 분기
- ApprovalService: 콜백 3개 결재양식코드로 확장
- AttendanceIntegratedController: 통합 화면 컨트롤러
- 통합 UI: 근태현황/신청결재/연차잔여 3탭 + 신규 신청 드롭다운
- AttendanceRequest 모델/서비스/컨트롤러/뷰 삭제 (Leave로 일원화)
- AttendanceService: deductLeaveBalance 제거 (Leave 시스템으로 일원화)
This commit is contained in:
김보곤
2026-03-03 23:50:27 +09:00
parent 896446f388
commit 6cdcc293cf
16 changed files with 826 additions and 592 deletions

View File

@@ -48,7 +48,7 @@ public function store(Request $request): JsonResponse
{
$validated = $request->validate([
'user_id' => 'required|integer|exists:users,id',
'leave_type' => 'required|string|in:annual,half_am,half_pm,sick,family,maternity,parental',
'leave_type' => 'required|string|in:annual,half_am,half_pm,sick,family,maternity,parental,business_trip,remote,field_work,early_leave,late_reason,absent_reason',
'start_date' => 'required|date',
'end_date' => 'required|date|after_or_equal:start_date',
'reason' => 'nullable|string|max:1000',
@@ -176,6 +176,36 @@ public function cancel(Request $request, int $id): JsonResponse
}
}
/**
* pending 상태 신청 삭제
*/
public function destroy(Request $request, int $id): JsonResponse
{
try {
$leave = $this->leaveService->deletePendingLeave($id);
if (! $leave) {
return response()->json([
'success' => false,
'message' => '삭제 가능한 신청을 찾을 수 없습니다.',
], 404);
}
return response()->json([
'success' => true,
'message' => '신청이 삭제되었습니다.',
]);
} catch (\Throwable $e) {
report($e);
return response()->json([
'success' => false,
'message' => '삭제 중 오류가 발생했습니다.',
'error' => config('app.debug') ? $e->getMessage() : null,
], 500);
}
}
/**
* 잔여연차 목록 (HTMX → HTML)
*/