feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration - Checkpoint
This commit is contained in:
@@ -29,11 +29,11 @@ function buildClientAndOpts(bodyshop) {
|
||||
|
||||
function buildServiceVehiclePayload({ job, custNo, overrides = {} }) {
|
||||
return {
|
||||
custNo: String(custNo), // tie SV to customer
|
||||
customerNo: String(custNo), // tie SV to customer
|
||||
vin: overrides.vin ?? job?.v_vin,
|
||||
year: overrides.year ?? job?.v_model_yr,
|
||||
make: overrides.make ?? job?.dms_make ?? job?.v_make,
|
||||
model: overrides.model ?? job?.dms_model ?? job?.v_model,
|
||||
make: overrides.make ?? job?.v_make_des,
|
||||
model: overrides.model ?? job?.v_model_desc,
|
||||
licensePlate: overrides.plate ?? job?.plate_no
|
||||
// add other safe keys your RR client supports (color, mileage, etc.)
|
||||
};
|
||||
@@ -68,9 +68,6 @@ async function ensureRRServiceVehicle({ bodyshop, custNo, job, overrides = {}, s
|
||||
|
||||
const payload = buildServiceVehiclePayload({ job, custNo, overrides });
|
||||
|
||||
console.log("Inserting RR Service Vehicle with payload:");
|
||||
console.dir({ payload }, { depth: null });
|
||||
|
||||
const res = await client.insertServiceVehicle(payload, opts);
|
||||
const data = res?.data ?? res;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user