feat: Implement daily attendance tracking system
- Backend: Auto-sync work reports with attendance records - Backend: Lazy initialization of daily active worker records - Frontend: Real-time attendance status on Group Leader Dashboard
This commit is contained in:
@@ -25,6 +25,12 @@ const getDailyAttendanceStatusService = async (date) => {
|
||||
logger.info('일일 근태 현황 조회 요청', { date });
|
||||
|
||||
try {
|
||||
// 조회 전 초기화 수행 (Lazy Initialization)
|
||||
// 생성자는 시스템(1) 또는 요청자가 될 수 있으나, 여기서는 안전하게 1(System/Admin) 사용
|
||||
// 혹은 req.user가 없으므로 서비스 레벨에서는 1로 가정하거나 파라미터로 받아야 함.
|
||||
// 서비스 인터페이스 변경 최소화를 위해 하드코딩 또는 안전장치.
|
||||
await AttendanceModel.initializeDailyRecords(date, 1);
|
||||
|
||||
const attendanceStatus = await AttendanceModel.getWorkerAttendanceStatus(date);
|
||||
logger.info('일일 근태 현황 조회 성공', { date, count: attendanceStatus.length });
|
||||
return attendanceStatus;
|
||||
|
||||
Reference in New Issue
Block a user