IO-2776 Add posting transactions for Fortellis.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user