import { OpenAPIHono } from "@hono/zod-openapi";
import fakeEDI from "./route/fakeEDI.js";
import getArticles from "./route/getActiveArticles.js";
import addressCorrections from "./route/getCityStateData.js";
import activequerys from "./route/getCurrentQuerys.js";
import getCustomerInv from "./route/getCustomerInv.js";
import getDeliveryByDate from "./route/getDeliveryDateByRange.js";
import getDeliveryByDateRangeAndAv from "./route/getDeliveryDateByRangeAndAv.js";
import fifoIndex from "./route/getFifoIndex.js";
import financeAudit from "./route/getFinanceAudit.js";
import getForecastByAv from "./route/getForecastDataByAv.js";
import getInhouseDeliveryByDate from "./route/getInHouseDeliveryDateByRange.js";
import currentInv from "./route/getInventory.js";
import getOpenOrders from "./route/getOpenOrders.js";
import psiArticleData from "./route/getPsiArticleData.js";
import psiForecastData from "./route/getPsiForecast.js";
import psiInventory from "./route/getPsiinventory.js";
import psiPlanningData from "./route/getPsiPlanningData.js";
import psiProductionData from "./route/getPsiProductionData.js";

const app = new OpenAPIHono();

const routes = [
	activequerys,
	getArticles,
	currentInv,
	getCustomerInv,
	getOpenOrders,
	getDeliveryByDate,
	getInhouseDeliveryByDate,
	getDeliveryByDateRangeAndAv,
	getForecastByAv,
	fakeEDI,
	addressCorrections,
	fifoIndex,
	financeAudit,
	psiArticleData,
	psiPlanningData,
	psiProductionData,
	psiInventory,
	psiForecastData,
] as const;

const appRoutes = routes.forEach((route) => {
	app.route("/datamart", route);
});

export default app;
