import { createUser, deleteUser, getUserByEmail, getUserById, getUsers, updateUser, verifyEmailStatusSSE } from "../controllers/user.controller.mjs";
import { Router } from "express";

//#region src/routes/user.routes.ts
const userRouter = Router();
const userRoute = "/api/user";
const baseURL = () => `${process.env.BACKEND_URL}${userRoute}`;
const getUserRoutes = () => ({
	getUsers: {
		urlModel: "/",
		url: baseURL(),
		method: "GET"
	},
	updateUser: {
		urlModel: "/",
		url: baseURL(),
		method: "PUT"
	},
	createUser: {
		urlModel: "/",
		url: baseURL(),
		method: "POST"
	},
	getUserById: {
		urlModel: "/:userId",
		url: ({ userId }) => `${baseURL()}/${userId}`,
		method: "GET"
	},
	getUserByEmail: {
		urlModel: "/email/:email",
		url: ({ email }) => `${baseURL()}/email/${email}`,
		method: "GET"
	},
	deleteUser: {
		urlModel: "/:userId",
		url: ({ userId }) => `${baseURL()}/${userId}`,
		method: "DELETE"
	},
	verifyEmailStatusSSE: {
		urlModel: "/verify-email-status/:userId",
		url: ({ userId }) => `${baseURL()}/verify-email-status/${userId}`,
		method: "GET"
	}
});
userRouter.get(getUserRoutes().getUsers.urlModel, getUsers);
userRouter.put(getUserRoutes().updateUser.urlModel, updateUser);
userRouter.post(getUserRoutes().createUser.urlModel, createUser);
userRouter.get(getUserRoutes().getUserById.urlModel, getUserById);
userRouter.get(getUserRoutes().getUserByEmail.urlModel, getUserByEmail);
userRouter.delete(getUserRoutes().deleteUser.urlModel, deleteUser);
userRouter.get(getUserRoutes().verifyEmailStatusSSE.urlModel, verifyEmailStatusSSE);

//#endregion
export { getUserRoutes, userRoute, userRouter };
//# sourceMappingURL=user.routes.mjs.map