feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration - Checkpoint

This commit is contained in:
Dave
2025-10-14 14:26:15 -04:00
parent 5a9381ebdb
commit 6671db1724
4 changed files with 242 additions and 115 deletions

View File

@@ -62,35 +62,45 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
return {
...cdkPayer,
dms_acctnumber: cdkPayer.dms_acctnumber,
controlnumber: job && job[cdkPayer.control_type]
controlnumber: job?.[cdkPayer.control_type]
};
})
});
};
const handleFinish = (values) => {
//TODO: Add this as a split instead.
if (Fortellis.treatment === "on") {
wsssocket.emit("fortellis-export-job", {
jobid: job.id,
txEnvelope: {
...values,
SubscriptionID: bodyshop.cdk_dealerid
}
});
} else {
socket.emit(`${determineDmsType(bodyshop)}-export-job`, {
const dms = determineDmsType(bodyshop);
// 1) RR takes precedence regardless of Fortellis split
if (dms === "rr") {
wsssocket.emit("rr-export-job", {
bodyshopId: bodyshop?.id || bodyshop?.bodyshopid || bodyshop?.uuid,
jobid: job.id,
job,
txEnvelope: values
});
}
console.log(logsRef);
if (logsRef) {
console.log("executing", logsRef);
logsRef.curent &&
logsRef.current.scrollIntoView({
behavior: "smooth"
} else {
// 2) Fallback to existing behavior
// TODO: Add this as a split instead.
if (Fortellis.treatment === "on") {
wsssocket.emit("fortellis-export-job", {
jobid: job.id,
txEnvelope: {
...values,
SubscriptionID: bodyshop.cdk_dealerid
}
});
} else {
socket.emit(`${dms}-export-job`, {
jobid: job.id,
txEnvelope: values
});
}
}
// Keep existing auto-scroll-to-logs behavior (fixing "curent" typo)
if (logsRef?.current) {
logsRef.current.scrollIntoView({ behavior: "smooth" });
}
};