fix(datamart): fixes to correct how we handle activations of new features and legacy queries

This commit is contained in:
2026-04-20 08:49:24 -05:00
parent 32517d0c98
commit b832d7aa1e
2 changed files with 11 additions and 4 deletions

View File

@@ -116,10 +116,17 @@ export const runDatamartQuery = async (data: Data) => {
// for queries that will need to be ran on legacy until we get the plant updated need to go in here
const doubleQueries = ["inventory"];
const sqlQuery = sqlQuerySelector(
`datamart.${fd.data[0].activated > 0 && doubleQueries.includes(data.name) ? data.name : `legacy.${data.name}`}`,
) as SqlQuery;
let queryFile = "";
if (doubleQueries.includes(data.name)) {
queryFile = `datamart.${
fd.data[0].activated > 0 ? data.name : `legacy.${data.name}`
}`;
} else {
queryFile = `datamart.${data.name}`;
}
const sqlQuery = sqlQuerySelector(queryFile) as SqlQuery;
// checking if warehousing is as it will start to effect a lot of queries for plants that are not on 2.
const getDataMartInfo = datamartData.filter((x) => x.endpoint === data.name);