feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration - Enhance logging

This commit is contained in:
Dave
2025-11-13 16:38:00 -05:00
parent 4c250f6189
commit 9cb1b25b1d
6 changed files with 66 additions and 15 deletions

View File

@@ -409,6 +409,7 @@ const registerRREvents = ({ socket, redisHelpers }) => {
const rid = resolveJobId(jobid || jobId, { jobid, jobId }, null);
let bodyshop = null;
let job = null;
let createdCustomer = false;
try {
if (!rid) throw new Error("jobid required");
@@ -445,6 +446,8 @@ const registerRREvents = ({ socket, redisHelpers }) => {
if (!selectedCustNo) throw new Error("RR create customer returned no custNo");
createdCustomer = true;
CreateRRLogEvent(socket, "DEBUG", `{3.2} Created customer`, { custNo: selectedCustNo });
}
@@ -594,7 +597,7 @@ const registerRREvents = ({ socket, redisHelpers }) => {
job,
selectedCustomer: { customerNo: effectiveCustNo, custNo: effectiveCustNo },
advisorNo: String(advisorNo),
existing: txEnvelope?.existing,
txEnvelope,
socket
});
@@ -640,8 +643,16 @@ const registerRREvents = ({ socket, redisHelpers }) => {
// Still emit info result if you want
socket.emit("rr-export-job:result", { jobId: rid, bodyshopId: bodyshop?.id, result });
// ACK but indicate it's pending finalize
ack?.({ ok: true, pendingFinalize: true, dmsRoNo, outsdRoNo, result });
// ACK but indicate it's pending finalize + include customer number + created flag
ack?.({
ok: true,
pendingFinalize: true,
dmsRoNo,
outsdRoNo,
result,
custNo: String(effectiveCustNo),
createdCustomer
});
} else {
// classify & fail (no finalize)
const vendorStatusCode = Number(