fix(monthly-comparison): 0일 0h 수정 + 관리자 검토 태깅
- getAllStatus: daily_attendance_records JOIN으로 실제 근무일/시간 집계 - vacation_days: vacation_types.deduct_days SUM (반차 0.5 정확 반영) - admin_checked 컬럼 + POST /admin-check API (upsert 패턴) - 상태 뱃지 라벨: 미검토/확인요청/수정요청/반려/확인완료 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -262,6 +262,20 @@ const MonthlyComparisonController = {
|
||||
}
|
||||
},
|
||||
|
||||
// POST /admin-check (관리자 개별 검토 태깅)
|
||||
adminCheck: async (req, res) => {
|
||||
try {
|
||||
const { user_id, year, month, checked } = req.body;
|
||||
if (!user_id || !year || !month) return res.status(400).json({ success: false, message: 'user_id, year, month 필수' });
|
||||
const checkedBy = req.user.user_id || req.user.id;
|
||||
const result = await Model.adminCheck(parseInt(user_id), parseInt(year), parseInt(month), !!checked, checkedBy);
|
||||
res.json({ success: true, data: result, message: checked ? '검토완료 표시' : '검토 해제' });
|
||||
} catch (err) {
|
||||
logger.error('monthlyComparison adminCheck error:', err);
|
||||
res.status(500).json({ success: false, message: '서버 오류가 발생했습니다.' });
|
||||
}
|
||||
},
|
||||
|
||||
// GET /all-status (support_team+)
|
||||
getAllStatus: async (req, res) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user