import type { Express } from "express";
import { requireAuth } from "../middleware/auth.middleware.js";

import manual from "./notification.manualTrigger.js";
import getNotifications from "./notification.route.js";
import updateNote from "./notification.update.route.js";
import deleteSub from "./notificationSub.delete.route.js";
import subs from "./notificationSub.get.route.js";
import newSub from "./notificationSub.post.route.js";
import updateSub from "./notificationSub.update.route.js";

export const setupNotificationRoutes = (baseUrl: string, app: Express) => {
	//stats will be like this as we dont need to change this
	app.use(
		`${baseUrl}/api/notification`,
		requireAuth,

		getNotifications,
	);
	app.use(
		`${baseUrl}/api/notification`,
		requireAuth,

		updateNote,
	);
	app.use(
		`${baseUrl}/api/notification/manual`,
		requireAuth,

		manual,
	);
	app.use(
		`${baseUrl}/api/notification/sub`,
		requireAuth,

		subs,
	);
	app.use(
		`${baseUrl}/api/notification/sub`,
		requireAuth,

		newSub,
	);
	app.use(
		`${baseUrl}/api/notification/sub`,
		requireAuth,

		updateSub,
	);
	app.use(
		`${baseUrl}/api/notification/sub`,
		requireAuth,

		deleteSub,
	);

	// all other system should be under /api/system/*
};
