feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration - insert service vehical working

This commit is contained in:
Dave
2025-11-07 16:02:25 -05:00
parent 00e6d31a88
commit c0157454e1

View File

@@ -121,10 +121,13 @@ async function ensureRRServiceVehicle(args = {}) {
}
// --- Attempt insert (idempotent) ---
// IMPORTANT: The current RR lib build validates `vehicleServInfo.customerNo`.
// To be future-proof, we also include top-level `customerNo`.
const insertPayload = {
vin: vinStr,
customerNo: custNoStr,
license: license ? String(license).trim() : undefined
customerNo: custNoStr, // fallback form (some builds accept this)
vehicleServInfo: { customerNo: custNoStr }, // primary form expected by the lib
vehicleDetail: license ? { licNo: String(license).trim() } : undefined
};
const insertOpts = {