refactor: worker_id → user_id 전체 마이그레이션 (Phase 1-4)

sso_users.user_id를 단일 식별자로 통합. JWT에서 worker_id 제거,
department_id/is_production 추가. 백엔드 15개 모델, 11개 컨트롤러,
4개 서비스, 7개 라우트, 프론트엔드 32+ JS/11+ HTML 변환.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-05 13:13:10 +09:00
parent 2197cdb3d5
commit abd7564e6b
90 changed files with 1790 additions and 925 deletions

View File

@@ -270,18 +270,18 @@
checkinStatus = {};
workers.forEach(w => {
const checkin = checkinList.find(c => c.worker_id === w.worker_id);
const record = records.find(r => r.worker_id === w.worker_id);
const checkin = checkinList.find(c => c.user_id === w.user_id);
const record = records.find(r => r.user_id === w.user_id);
if (checkin?.vacation_status === 'approved' || record?.vacation_type_id) {
checkinStatus[w.worker_id] = { status: 'vacation', vacationType: checkin?.vacation_type_name || record?.vacation_type_name || '연차' };
checkinStatus[w.user_id] = { status: 'vacation', vacationType: checkin?.vacation_type_name || record?.vacation_type_name || '연차' };
} else if (record && record.is_present === 0) {
checkinStatus[w.worker_id] = { status: 'absent' };
checkinStatus[w.user_id] = { status: 'absent' };
} else if (record && record.is_present === 1) {
checkinStatus[w.worker_id] = { status: 'present' };
checkinStatus[w.user_id] = { status: 'present' };
} else {
// 기록이 없으면 기본 출근
checkinStatus[w.worker_id] = { status: 'present' };
checkinStatus[w.user_id] = { status: 'present' };
}
});
@@ -301,9 +301,9 @@
}
container.innerHTML = workers.map(w => {
const s = checkinStatus[w.worker_id] || { status: 'present' };
const s = checkinStatus[w.user_id] || { status: 'present' };
const label = s.status === 'present' ? '출근' : s.status === 'absent' ? '결근' : (s.vacationType || '연차');
return `<span class="worker-chip ${s.status}" onclick="toggle(${w.worker_id})"><span class="chip-dot"></span>${w.worker_name} <small style="color:#6b7280">${label}</small></span>`;
return `<span class="worker-chip ${s.status}" onclick="toggle(${w.user_id})"><span class="chip-dot"></span>${w.worker_name} <small style="color:#6b7280">${label}</small></span>`;
}).join('');
updateSummary();
@@ -318,8 +318,8 @@
function setAllPresent() {
workers.forEach(w => {
if (checkinStatus[w.worker_id]?.status !== 'vacation') {
checkinStatus[w.worker_id] = { status: 'present' };
if (checkinStatus[w.user_id]?.status !== 'vacation') {
checkinStatus[w.user_id] = { status: 'present' };
}
});
render();
@@ -327,8 +327,8 @@
function setAllAbsent() {
workers.forEach(w => {
if (checkinStatus[w.worker_id]?.status !== 'vacation') {
checkinStatus[w.worker_id] = { status: 'absent' };
if (checkinStatus[w.user_id]?.status !== 'vacation') {
checkinStatus[w.user_id] = { status: 'absent' };
}
});
render();
@@ -374,10 +374,10 @@
// 연차가 아닌 작업자들만 체크인 데이터로 전송
const checkins = workers
.filter(w => checkinStatus[w.worker_id]?.status !== 'vacation')
.filter(w => checkinStatus[w.user_id]?.status !== 'vacation')
.map(w => ({
worker_id: w.worker_id,
is_present: checkinStatus[w.worker_id]?.status === 'present'
user_id: w.user_id,
is_present: checkinStatus[w.user_id]?.status === 'present'
}));
try {