Files
TK-FB-Project/api.hyungi.net/controllers
Hyungi Ahn 405bf0dc65 refactor: Phase 3.2 - Attendance, Worker, Project 컨트롤러 개선
주요 변경사항:
- services/attendanceService.js 신규 생성 (269 lines)
  * 9개 서비스 함수로 비즈니스 로직 분리
  * 커스텀 에러 클래스 적용 (ValidationError, DatabaseError)
  * 구조화된 로깅 시스템 통합

- controllers/attendanceController.js 완전 재작성 (306 → 168 lines, 45% 감소)
  * 클래스 기반에서 함수 기반 export로 변경
  * 모든 비즈니스 로직을 서비스 레이어로 이동
  * asyncHandler 미들웨어로 에러 처리 자동화

- controllers/workerController.js 개선
  * 커스텀 에러 클래스 적용
  * console.log → logger 교체
  * 캐시 무효화 로직 유지

- controllers/projectController.js 완전 재작성 (117 → 163 lines)
  * 모든 함수에 새로운 에러 클래스 적용
  * 구조화된 로깅 추가
  * 표준화된 JSON 응답 형식

기술 스택:
- Custom Error Classes: ValidationError, NotFoundError, DatabaseError
- Structured Logging: logger.info/error/warn/debug with context
- asyncHandler: Automatic async error handling
- Service Layer Pattern: Business logic separation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-11 12:06:35 +09:00
..