import { addDictionary, deleteDictionary, getDictionaries, getDictionariesKeys, getDictionariesUpdateTimestamp, getDictionaryByKey, pushDictionaries, updateDictionary } from "../controllers/dictionary.controller.mjs";
import { Router } from "express";

//#region src/routes/dictionary.routes.ts
const dictionaryRouter = Router();
const dictionaryRoute = "/api/dictionary";
const baseURL = () => `${process.env.BACKEND_URL}${dictionaryRoute}`;
const getDictionaryRoutes = () => ({
	getDictionaries: {
		urlModel: "/",
		url: baseURL,
		method: "GET"
	},
	getDictionariesKeys: {
		urlModel: "/keys",
		url: `${baseURL}/keys`,
		method: "GET"
	},
	getDictionariesUpdateTimestamp: {
		urlModel: "/update",
		url: `${baseURL}/update`,
		method: "GET"
	},
	getDictionary: {
		urlModel: "/:dictionaryKey",
		url: ({ dictionaryKey }) => `${baseURL}/${dictionaryKey}`,
		method: "GET"
	},
	addDictionary: {
		urlModel: "/",
		url: baseURL,
		method: "POST"
	},
	pushDictionaries: {
		urlModel: "/",
		url: baseURL,
		method: "PATCH"
	},
	updateDictionary: {
		urlModel: "/:dictionaryId",
		url: ({ dictionaryId }) => `${baseURL}/${dictionaryId}`,
		method: "PUT"
	},
	deleteDictionary: {
		urlModel: "/:dictionaryId",
		url: ({ dictionaryId }) => `${baseURL}/${dictionaryId}`,
		method: "DELETE"
	}
});
dictionaryRouter.get(getDictionaryRoutes().getDictionaries.urlModel, getDictionaries);
dictionaryRouter.get(getDictionaryRoutes().getDictionariesKeys.urlModel, getDictionariesKeys);
dictionaryRouter.get(getDictionaryRoutes().getDictionariesUpdateTimestamp.urlModel, getDictionariesUpdateTimestamp);
dictionaryRouter.get(getDictionaryRoutes().getDictionary.urlModel, getDictionaryByKey);
dictionaryRouter.post(getDictionaryRoutes().addDictionary.urlModel, addDictionary);
dictionaryRouter.patch(getDictionaryRoutes().pushDictionaries.urlModel, pushDictionaries);
dictionaryRouter.put(getDictionaryRoutes().updateDictionary.urlModel, updateDictionary);
dictionaryRouter.delete(getDictionaryRoutes().deleteDictionary.urlModel, deleteDictionary);

//#endregion
export { dictionaryRoute, dictionaryRouter, getDictionaryRoutes };
//# sourceMappingURL=dictionary.routes.mjs.map