feat(sprint-004): 월간 비교·확인·정산 백엔드 (Section A) + Mock 해제
Backend: - monthly_work_confirmations 테이블 마이그레이션 - monthlyComparisonModel: 비교 쿼리 8개 (보고서/근태/확인 병렬 조회) - monthlyComparisonController: 5 API (my-records/records/confirm/all-status/export) - 일별 7상태 판정 (match/mismatch/report_only/attend_only/vacation/holiday/none) - 확인/반려 UPSERT + 반려 시 알림 (단일 트랜잭션) - 엑셀 2시트 (exceljs) + 헤더 스타일 + 불일치/휴가 행 색상 - support_team+ 권한 체크 (all-status, export) - exceljs 의존성 추가 Frontend: - monthly-comparison.js MOCK_ENABLED = false (API 연결) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
CREATE TABLE IF NOT EXISTS monthly_work_confirmations (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
user_id INT NOT NULL COMMENT '작업자 user_id (workers.user_id)',
|
||||
year INT NOT NULL,
|
||||
month INT NOT NULL,
|
||||
status ENUM('pending', 'confirmed', 'rejected') NOT NULL DEFAULT 'pending',
|
||||
total_work_days INT DEFAULT 0 COMMENT '총 근무일수',
|
||||
total_work_hours DECIMAL(6,2) DEFAULT 0 COMMENT '총 근무시간',
|
||||
total_overtime_hours DECIMAL(6,2) DEFAULT 0 COMMENT '총 연장근로시간',
|
||||
vacation_days DECIMAL(4,2) DEFAULT 0 COMMENT '휴가 일수',
|
||||
mismatch_count INT DEFAULT 0 COMMENT '불일치 건수',
|
||||
reject_reason TEXT NULL COMMENT '반려 사유',
|
||||
confirmed_at TIMESTAMP NULL COMMENT '확인 일시',
|
||||
rejected_at TIMESTAMP NULL COMMENT '반려 일시',
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
UNIQUE KEY uq_user_year_month (user_id, year, month),
|
||||
KEY idx_year_month (year, month),
|
||||
KEY idx_status (status)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
|
||||
COMMENT='월간 근무 확인 (승인/반려)'
|
||||
Reference in New Issue
Block a user