feat(tksafety): 통합 출입신고 관리 시스템 구현

- DB 마이그레이션: request_type, visitor_name, department_id, check_in/out_time 컬럼 + status ENUM 확장
- 4소스 UNION 대시보드: 방문(외부/내부) + TBM + 협력업체 통합 조회
- 체크인/체크아웃 API + 내부 출입 신고(승인 불필요) 지원
- 통합 출입 현황판 페이지 신규 (entry-dashboard.html)
- 출입 신청/관리 페이지에 유형 필터 + 체크인/아웃 버튼 추가
- safety_entry_dashboard 권한 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-13 14:24:13 +09:00
parent 5a062759c5
commit 6a20056e05
16 changed files with 810 additions and 57 deletions

View File

@@ -6,6 +6,7 @@ const educationRoutes = require('./routes/educationRoutes');
const visitRequestRoutes = require('./routes/visitRequestRoutes');
const checklistRoutes = require('./routes/checklistRoutes');
const dailyVisitModel = require('./models/dailyVisitModel');
const visitRequestModel = require('./models/visitRequestModel');
const { requireAuth } = require('./middleware/auth');
const app = express();
@@ -83,8 +84,14 @@ cron.schedule('59 23 * * *', async () => {
}
}, { timezone: 'Asia/Seoul' });
app.listen(PORT, () => {
app.listen(PORT, async () => {
console.log(`tksafety-api running on port ${PORT}`);
// DB 마이그레이션 실행
try {
await visitRequestModel.runMigration();
} catch (err) {
console.error('Migration error:', err.message);
}
});
module.exports = app;