feat(dm): migrated all the dm topics
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 4m26s

This commit is contained in:
2026-06-26 11:05:17 -05:00
parent 012a7e83b2
commit 47b149d1ea
48 changed files with 14156 additions and 44 deletions

View File

@@ -1,5 +1,6 @@
import { db } from "../db/db.controller.js";
import { forecastImport } from "../db/schema/forecastImports.schema.js";
import { orderImport } from "../db/schema/ordersImports.schema.js";
import { runProdApi } from "../utils/prodEndpoint.utils.js";
import { returnFunc } from "../utils/returnHelper.utils.js";
@@ -8,6 +9,7 @@ type PostData = {
documentName: string;
sender: string;
customerId: string;
invoiceAddressId?: string;
positions: unknown[];
};
type Data = {
@@ -52,6 +54,19 @@ export const postData = async (data: Data, user: any) => {
});
}
if (data.type === "orders") {
await db.insert(orderImport).values({
receivingPlantId: data.data.receivingPlantId ?? "test1",
documentName: data.data.documentName ?? "order-data-missing",
sender: data.data.sender ?? "lst-user",
customerId: data.data.customerId ?? "0",
invoiceAddressId: data.data.invoiceAddressId ?? "0",
rawData: data ?? [],
add_user: user.username ?? undefined,
upd_user: user.username ?? undefined,
});
}
return returnFunc({
success: true,
level: "info",