Section A (Backend): - POST /api/proxy-input: TBM 세션+팀배정+작업보고서 일괄 생성 (트랜잭션) - GET /api/proxy-input/daily-status: 일별 TBM/보고서 입력 현황 - GET /api/proxy-input/daily-status/detail: 작업자별 상세 - tbm_sessions에 is_proxy_input, proxy_input_by 컬럼 추가 - system1/system2/tkuser requireMinLevel → shared requirePage 전환 - permissionModel에 factory_proxy_input, factory_daily_status 키 등록 Section B (Frontend): - daily-status.html: 날짜 네비 + 요약 카드 + 필터 탭 + 작업자 리스트 + 바텀시트 - proxy-input.html: 미입력자 카드 + 확장 폼 + 일괄 설정 + 저장 - tkfb-core.js NAV_MENU에 입력 현황/대리입력 추가 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
38 lines
1.4 KiB
JavaScript
38 lines
1.4 KiB
JavaScript
// routes/notificationRoutes.js
|
|
const express = require('express');
|
|
const router = express.Router();
|
|
const notificationController = require('../controllers/notificationController');
|
|
const { requireAuth } = require('../middleware/auth');
|
|
const { createRequirePage } = require('../../../shared/middleware/pagePermission');
|
|
const { getPool } = require('../../shared/config/database');
|
|
const requirePage = createRequirePage(getPool);
|
|
|
|
// 내부 서비스용 알림 생성 (X-Internal-Service-Key 인증, JWT 불필요)
|
|
router.post('/internal', notificationController.createInternal);
|
|
|
|
// 이하 모든 라우트는 JWT 인증 필요
|
|
router.use(requireAuth);
|
|
|
|
// 읽지 않은 알림 조회 (본인 알림만)
|
|
router.get('/unread', notificationController.getUnread);
|
|
|
|
// 읽지 않은 알림 개수
|
|
router.get('/unread/count', notificationController.getUnreadCount);
|
|
|
|
// 전체 알림 조회 (페이징)
|
|
router.get('/', notificationController.getAll);
|
|
|
|
// 알림 생성 (시스템/관리자용)
|
|
router.post('/', requirePage('tkuser.notifications'), notificationController.create);
|
|
|
|
// 모든 알림 읽음 처리 (본인 알림만)
|
|
router.post('/read-all', notificationController.markAllAsRead);
|
|
|
|
// 특정 알림 읽음 처리 (본인 알림만)
|
|
router.post('/:id/read', notificationController.markAsRead);
|
|
|
|
// 알림 삭제 (본인 알림만)
|
|
router.delete('/:id', notificationController.delete);
|
|
|
|
module.exports = router;
|