WIP Fortellis Certification changes.
This commit is contained in:
@@ -290,7 +290,9 @@ async function FortellisSelectedCustomer({ socket, redisHelpers, selectedCustome
|
|||||||
|
|
||||||
await MarkJobExported({ socket, jobid: JobData.id, JobData });
|
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 });
|
const DMSVehHistory = await InsertServiceVehicleHistory({ socket, redisHelpers, JobData });
|
||||||
await setSessionTransactionData(
|
await setSessionTransactionData(
|
||||||
socket.id,
|
socket.id,
|
||||||
@@ -299,10 +301,17 @@ async function FortellisSelectedCustomer({ socket, redisHelpers, selectedCustome
|
|||||||
DMSVehHistory,
|
DMSVehHistory,
|
||||||
defaultFortellisTTL
|
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 {
|
} else {
|
||||||
//There was something wrong. Throw an error to trigger clean up.
|
//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 }) {
|
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 client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {});
|
||||||
const currentToken =
|
const currentToken =
|
||||||
|
|||||||
Reference in New Issue
Block a user