csa-backend-test/app/routes/ai-notification.route.js

31 lines
1.2 KiB
JavaScript

// LIBRARY IMPORT
const router = require("express").Router()
// CONTROLLER IMPORT
const aiNotificationController = require("../controllers/ai-notification.controller.js")
// MIDDLEWARE IMPORT
const { validateApiKey } = require("../middleware/middleware.js");
// ROUTES
// ANALYTICS ROUTES
router.get("/ai-notifications/analytics", validateApiKey, aiNotificationController.getAnalytics);
router.post("/ai-notifications/analytics/update", validateApiKey, aiNotificationController.updateAnalytics);
router.get("/ai-notifications/dashboard-stats", validateApiKey, aiNotificationController.getDashboardStats);
// NOTIFICATIONS ROUTES
router.get("/ai-notifications/all", validateApiKey, aiNotificationController.getAllNotifications);
router.get("/ai-notifications/:id", validateApiKey, aiNotificationController.getNotificationDetail);
// SCHEDULED NOTIFICATIONS ROUTES (NEW)
router.get("/ai-notifications/scheduled/stats", validateApiKey, aiNotificationController.getScheduledStats);
router.post("/ai-notifications/scheduled/process", validateApiKey, aiNotificationController.triggerScheduledProcessor);
router.post("/ai-notifications/scheduled/:id/cancel", validateApiKey, aiNotificationController.cancelScheduled);
module.exports = router