feat(datamart): included fifoindex monitor

This commit is contained in:
2025-05-28 11:51:15 -05:00
parent a07a9d2145
commit 23da6c6304
4 changed files with 76 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import { desc } from "drizzle-orm";
import { db } from "../../../../database/dbclient.js";
import { fifoIndex } from "../../../../database/schema/fifoIndex.js";
export const getFifoIndex = async () => {
let articles: any = [];
try {
const res = await db
.select()
.from(fifoIndex)
.orderBy(desc(fifoIndex.add_Date));
articles = res;
} catch (error) {
articles = error;
}
return articles;
};