import { addOrganization, addOrganizationMember, deleteOrganization, getOrganizations, selectOrganization, unselectOrganization, updateOrganization, updateOrganizationMembers, updateOrganizationMembersById } from "../controllers/organization.controller.mjs";
import { Router } from "express";

//#region src/routes/organization.routes.ts
const organizationRouter = Router();
const organizationRoute = "/api/organization";
const baseURL = () => `${process.env.BACKEND_URL}${organizationRoute}`;
const getOrganizationRoutes = () => ({
	getOrganizations: {
		urlModel: "/",
		url: baseURL(),
		method: "GET"
	},
	addOrganization: {
		urlModel: "/",
		url: baseURL(),
		method: "POST"
	},
	updateOrganization: {
		urlModel: "/",
		url: baseURL(),
		method: "PUT"
	},
	updateOrganizationMembers: {
		urlModel: "/members",
		url: `${baseURL()}/members`,
		method: "PUT"
	},
	updateOrganizationMembersById: {
		urlModel: "/:organizationId/members",
		url: ({ organizationId }) => `${baseURL()}/${organizationId}/members`,
		method: "PUT"
	},
	addOrganizationMember: {
		urlModel: "/member",
		url: `${baseURL()}/member`,
		method: "POST"
	},
	deleteOrganization: {
		urlModel: "/",
		url: baseURL(),
		method: "DELETE"
	},
	selectOrganization: {
		urlModel: "/:organizationId",
		url: ({ organizationId }) => `${baseURL()}/${organizationId}`,
		method: "PUT"
	},
	unselectOrganization: {
		urlModel: "/logout",
		url: `${baseURL()}/logout`,
		method: "POST"
	}
});
organizationRouter.get(getOrganizationRoutes().getOrganizations.urlModel, getOrganizations);
organizationRouter.post(getOrganizationRoutes().addOrganization.urlModel, addOrganization);
organizationRouter.put(getOrganizationRoutes().updateOrganization.urlModel, updateOrganization);
organizationRouter.put(getOrganizationRoutes().updateOrganizationMembers.urlModel, updateOrganizationMembers);
organizationRouter.put(getOrganizationRoutes().updateOrganizationMembersById.urlModel, updateOrganizationMembersById);
organizationRouter.post(getOrganizationRoutes().addOrganizationMember.urlModel, addOrganizationMember);
organizationRouter.delete(getOrganizationRoutes().deleteOrganization.urlModel, deleteOrganization);
organizationRouter.put(getOrganizationRoutes().selectOrganization.urlModel, selectOrganization);
organizationRouter.post(getOrganizationRoutes().unselectOrganization.urlModel, unselectOrganization);

//#endregion
export { getOrganizationRoutes, organizationRoute, organizationRouter };
//# sourceMappingURL=organization.routes.mjs.map