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:
@@ -28,8 +28,8 @@ const getDailyAttendanceStatus = asyncHandler(async (req, res) => {
|
||||
* 일일 근태 기록 조회
|
||||
*/
|
||||
const getDailyAttendanceRecords = asyncHandler(async (req, res) => {
|
||||
const { date, worker_id } = req.query;
|
||||
const data = await attendanceService.getDailyAttendanceRecordsService(date, worker_id);
|
||||
const { date, user_id } = req.query;
|
||||
const data = await attendanceService.getDailyAttendanceRecordsService(date, user_id);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
@@ -42,8 +42,8 @@ const getDailyAttendanceRecords = asyncHandler(async (req, res) => {
|
||||
* 기간별 근태 기록 조회 (월별 조회용)
|
||||
*/
|
||||
const getAttendanceRecordsByRange = asyncHandler(async (req, res) => {
|
||||
const { start_date, end_date, worker_id } = req.query;
|
||||
const data = await attendanceService.getAttendanceRecordsByRangeService(start_date, end_date, worker_id);
|
||||
const { start_date, end_date, user_id } = req.query;
|
||||
const data = await attendanceService.getAttendanceRecordsByRangeService(start_date, end_date, user_id);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
@@ -76,7 +76,7 @@ const upsertAttendanceRecord = asyncHandler(async (req, res) => {
|
||||
const processVacation = asyncHandler(async (req, res) => {
|
||||
const vacationData = {
|
||||
record_date: req.body.date,
|
||||
worker_id: req.body.worker_id,
|
||||
user_id: req.body.user_id,
|
||||
vacation_type_id: req.body.vacation_type,
|
||||
created_by: req.user?.user_id || req.user?.id
|
||||
};
|
||||
@@ -96,7 +96,7 @@ const processVacation = asyncHandler(async (req, res) => {
|
||||
const approveOvertime = asyncHandler(async (req, res) => {
|
||||
const overtimeData = {
|
||||
record_date: req.body.date,
|
||||
worker_id: req.body.worker_id,
|
||||
user_id: req.body.user_id,
|
||||
overtime_approved: true,
|
||||
approved_by: req.user?.user_id || req.user?.id
|
||||
};
|
||||
@@ -140,8 +140,8 @@ const getVacationTypes = asyncHandler(async (req, res) => {
|
||||
* 작업자 휴가 잔여 조회
|
||||
*/
|
||||
const getWorkerVacationBalance = asyncHandler(async (req, res) => {
|
||||
const { worker_id } = req.params;
|
||||
const data = await attendanceService.getWorkerVacationBalanceService(parseInt(worker_id));
|
||||
const { user_id } = req.params;
|
||||
const data = await attendanceService.getWorkerVacationBalanceService(parseInt(user_id));
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
@@ -154,11 +154,11 @@ const getWorkerVacationBalance = asyncHandler(async (req, res) => {
|
||||
* 월별 근태 통계
|
||||
*/
|
||||
const getMonthlyAttendanceStats = asyncHandler(async (req, res) => {
|
||||
const { year, month, worker_id } = req.query;
|
||||
const { year, month, user_id } = req.query;
|
||||
const data = await attendanceService.getMonthlyAttendanceStatsService(
|
||||
parseInt(year),
|
||||
parseInt(month),
|
||||
worker_id ? parseInt(worker_id) : null
|
||||
user_id ? parseInt(user_id) : null
|
||||
);
|
||||
|
||||
res.json({
|
||||
@@ -186,7 +186,7 @@ const getCheckinList = asyncHandler(async (req, res) => {
|
||||
* 출근 체크 저장 (일괄 처리)
|
||||
*/
|
||||
const saveCheckins = asyncHandler(async (req, res) => {
|
||||
const { date, checkins } = req.body; // checkins: [{worker_id, is_present}, ...]
|
||||
const { date, checkins } = req.body; // checkins: [{user_id, is_present}, ...]
|
||||
const result = await attendanceService.saveCheckinsService(date, checkins);
|
||||
|
||||
res.json({
|
||||
|
||||
Reference in New Issue
Block a user