From 1980c83377ecdd0cd182d59dc1c700b567eba58d Mon Sep 17 00:00:00 2001 From: Hyungi Ahn Date: Tue, 31 Mar 2026 10:40:16 +0900 Subject: [PATCH] =?UTF-8?q?fix(attendance):=20=EC=B6=9C=ED=87=B4=EA=B7=BC?= =?UTF-8?q?=20=EC=9E=90=EB=8F=99=EC=83=9D=EC=84=B1=20=EC=8B=9C=20=EC=9E=85?= =?UTF-8?q?=EC=82=AC=EC=9D=BC=20=EC=B2=B4=ED=81=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit initializeDailyRecords()에서 hire_date <= date 조건 추가. 입사일 이전 출퇴근 기록 자동생성 방지. 기존 잘못된 데이터 1건(조승민 1/2) 삭제. Co-Authored-By: Claude Opus 4.6 (1M context) --- system1-factory/api/models/attendanceModel.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/system1-factory/api/models/attendanceModel.js b/system1-factory/api/models/attendanceModel.js index 844e813..84678e9 100644 --- a/system1-factory/api/models/attendanceModel.js +++ b/system1-factory/api/models/attendanceModel.js @@ -150,9 +150,10 @@ class AttendanceModel { static async initializeDailyRecords(date, createdBy) { const db = await getDb(); - // 1. 활성 작업자 조회 + // 1. 활성 작업자 조회 (입사일 이전 제외) const [workers] = await db.execute( - 'SELECT user_id FROM workers WHERE status = "active" AND user_id IS NOT NULL' + 'SELECT user_id FROM workers WHERE status = "active" AND user_id IS NOT NULL AND (hire_date IS NULL OR hire_date <= ?)', + [date] ); if (workers.length === 0) return { inserted: 0 };