From 5772e95a940453c6df8e44038096f42c027e239f Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 31 Dec 2025 09:05:25 -0800 Subject: [PATCH] WIP Fortellis Certification changes. --- server/fortellis/fortellis.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/server/fortellis/fortellis.js b/server/fortellis/fortellis.js index bb808e36b..a9449bfe8 100644 --- a/server/fortellis/fortellis.js +++ b/server/fortellis/fortellis.js @@ -290,7 +290,9 @@ async function FortellisSelectedCustomer({ socket, redisHelpers, selectedCustome await MarkJobExported({ socket, jobid: JobData.id, JobData }); - CreateFortellisLogEvent(socket, "DEBUG", `{5} Updating Service Vehicle History.`); + try { + + CreateFortellisLogEvent(socket, "DEBUG", `{7} Updating Service Vehicle History.`); const DMSVehHistory = await InsertServiceVehicleHistory({ socket, redisHelpers, JobData }); await setSessionTransactionData( socket.id, @@ -299,10 +301,17 @@ async function FortellisSelectedCustomer({ socket, redisHelpers, selectedCustome DMSVehHistory, defaultFortellisTTL ); - socket.emit("export-success", JobData.id); + } catch (error) { + + CreateFortellisLogEvent(socket, "ERROR", `{7.1} Error posting vehicle service history. ${error.message}`); + } + + //TODO: IF THE VEHICLE SERVICE HISTORY FAILS, WE NEED TO MARK IT AS SUCH AND NOT DELETE THE TRANSACTION. + //socket.emit("export-success", JobData.id); } else { //There was something wrong. Throw an error to trigger clean up. - throw new Error("Error posting DMS Batch Transaction"); + //throw new Error("Error posting DMS Batch Transaction"); + } @@ -1281,7 +1290,7 @@ async function DeleteDmsWip({ socket, redisHelpers, JobData }) { } async function MarkJobExported({ socket, jobid, JobData }) { - CreateFortellisLogEvent(socket, "ERROR", `Marking job as exported for id ${jobid}`); + CreateFortellisLogEvent(socket, "DEBUG", `Marking job as exported for id ${jobid}`); const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {}); const currentToken =