IO-2776 Add posting transactions for Fortellis.

This commit is contained in:
Patrick Fic
2025-08-27 16:37:31 -07:00
parent 3d691568ff
commit 8296d914c5
4 changed files with 313 additions and 175 deletions

View File

@@ -1,7 +1,7 @@
const { admin } = require("../firebase/firebase-handler");
const { FortellisJobExport, FortellisSelectedCustomer } = require("../fortellis/fortellis");
const FortellisLogger = require("../fortellis/fortellis-logger");
const CdkCalculateAllocations = require("../cdk/cdk-calculate-allocations").default;
const redisSocketEvents = ({
io,
redisHelpers: {
@@ -285,6 +285,18 @@ const redisSocketEvents = ({
});
}
});
socket.on("fortellis-calculate-allocations", async (jobid, callback) => {
try {
const allocations = await CdkCalculateAllocations(socket, jobid);
callback(allocations);
} catch (error) {
FortellisLogger(socket, "error", `Error during Fortellis export : ${error.message}`);
logger.log("fortellis-selectd-customer-error", "error", null, null, {
message: error.message,
stack: error.stack
});
}
});
};
// Task Events