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;
};
