import { getNewsletterStatus, subscribeToNewsletter, unsubscribeFromNewsletter } from "../controllers/newsletter.controller.mjs";
import { Router } from "express";

//#region src/routes/newsletter.routes.ts
const newsletterRouter = Router();
const newsletterRoute = "/api/newsletter";
const baseURL = () => `${process.env.BACKEND_URL}${newsletterRoute}`;
const getNewsletterRoutes = () => ({
	subscribeToNewsletter: {
		urlModel: "/subscribe",
		url: `${baseURL()}/subscribe`,
		method: "POST"
	},
	unsubscribeFromNewsletter: {
		urlModel: "/unsubscribe",
		url: `${baseURL()}/unsubscribe`,
		method: "POST"
	},
	getNewsletterStatus: {
		urlModel: "/status",
		url: `${baseURL()}/status`,
		method: "GET"
	}
});
newsletterRouter.post(getNewsletterRoutes().subscribeToNewsletter.urlModel, subscribeToNewsletter);
newsletterRouter.post(getNewsletterRoutes().unsubscribeFromNewsletter.urlModel, unsubscribeFromNewsletter);
newsletterRouter.get(getNewsletterRoutes().getNewsletterStatus.urlModel, getNewsletterStatus);

//#endregion
export { getNewsletterRoutes, newsletterRoute, newsletterRouter };
//# sourceMappingURL=newsletter.routes.mjs.map