IO-3570 Transwip fix

Signed-off-by: Allan Carr <allan@imexsystems.ca>
This commit is contained in:
Allan Carr
2026-02-19 12:04:44 -08:00
parent c7875c7be3
commit f6c5f85a87

View File

@@ -285,7 +285,7 @@ async function FortellisSelectedCustomer({ socket, redisHelpers, selectedCustome
//something //something
CreateFortellisLogEvent(socket, "DEBUG", `{6} Successfully posted transaction to DMS.`); CreateFortellisLogEvent(socket, "DEBUG", `{6} Successfully posted transaction to DMS.`);
await MarkJobExported({ socket, jobid: JobData.id, JobData }); await MarkJobExported({ socket, jobid: JobData.id, JobData, redisHelpers });
try { try {
CreateFortellisLogEvent(socket, "DEBUG", `{7} Updating Service Vehicle History.`); CreateFortellisLogEvent(socket, "DEBUG", `{7} Updating Service Vehicle History.`);
@@ -1295,9 +1295,15 @@ async function DeleteDmsWip({ socket, redisHelpers, JobData }) {
} }
} }
async function MarkJobExported({ socket, jobid, JobData }) { async function MarkJobExported({ socket, jobid, JobData, redisHelpers }) {
CreateFortellisLogEvent(socket, "DEBUG", `Marking job as exported for id ${jobid}`); CreateFortellisLogEvent(socket, "DEBUG", `Marking job as exported for id ${jobid}`);
const transwips = await redisHelpers.getSessionTransactionData(
socket.id,
getTransactionType(JobData.id),
FortellisCacheEnums.transWips
);
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {}); const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {});
const currentToken = const currentToken =
(socket?.data && socket.data.authToken) || (socket?.handshake?.auth && socket.handshake.auth.token); (socket?.data && socket.data.authToken) || (socket?.handshake?.auth && socket.handshake.auth.token);
@@ -1315,7 +1321,7 @@ async function MarkJobExported({ socket, jobid, JobData }) {
jobid: jobid, jobid: jobid,
successful: true, successful: true,
useremail: socket.user.email, useremail: socket.user.email,
metadata: socket.transWips metadata: transwips
}, },
bill: { bill: {
exported: true, exported: true,