import type { Express } from "express";
import { featureCheck } from "../middleware/featureActive.middleware.js";
import gpData from "./eom.gpdata.route.js";
import historyInv from "./eom.historyInv.route.js";
import lastPurchasePrice from "./eom.lastPurchasePrice.route.js";
import lastSalesPrice from "./eom.lastSalesPrice.route.js";
import productionConsumption from "./eom.productionConsumption.route.js";
import purchased from "./eom.purchased.route.js";
import regrind from "./eom.regrind.route.js";
import soldItems from "./eom.soldItems.route.js";

export const setupEomRoutes = (baseUrl: string, app: Express) => {
	//stats will be like this as we dont need to change this

	app.use(`${baseUrl}/api/eom/historyInv`, featureCheck("eom"), historyInv);
	app.use(`${baseUrl}/api/eom/purchased`, featureCheck("eom"), purchased);
	app.use(
		`${baseUrl}/api/eom/lastSalesPrice`,
		featureCheck("eom"),
		lastSalesPrice,
	);
	app.use(
		`${baseUrl}/api/eom/lastPurchasePrice`,
		featureCheck("eom"),
		lastPurchasePrice,
	);
	app.use(
		`${baseUrl}/api/eom/productionConsumption`,
		featureCheck("eom"),
		productionConsumption,
	);
	app.use(`${baseUrl}/api/eom/regrind`, featureCheck("eom"), regrind);
	app.use(`${baseUrl}/api/eom/soldItems`, featureCheck("eom"), soldItems);
	app.use(`${baseUrl}/api/eom/gpData`, featureCheck("eom"), gpData);
};
