IO-1529 Added gateway templates.

This commit is contained in:
Patrick Fic
2021-11-15 17:14:12 -08:00
parent c129b5ba8c
commit 55b7715e1c
6 changed files with 67 additions and 10 deletions

View File

@@ -607,7 +607,7 @@ async function InsertDmsCustomer(socket, newCustomerNumber) {
},
email: {
desc: socket.JobData.ownr_ea ? "Other" : "CustomerDeclined",
value: socket.JobData.ownr_ea ? "Other" : null,
value: socket.JobData.ownr_ea ? socket.JobData.ownr_ea : null,
},
},
demographics: null,
@@ -700,6 +700,7 @@ async function InsertDmsVehicle(socket) {
manufacturer: {},
vehicle: {
deliveryDate: moment().format("YYYYMMDD"),
licensePlateNo: socket.JobData.plate_no,
make: socket.txEnvelope.dms_make,
modelAbrev: socket.txEnvelope.dms_model,
modelYear: socket.JobData.v_model_yr,
@@ -758,6 +759,31 @@ async function UpdateDmsVehicle(socket) {
CdkWsdl.VehicleInsertUpdate
);
let ids = [];
const existingOwnerinVeh = socket.DMSVeh.owners.filter(
(o) => o.id.value === socket.DMSCust.id.value
);
if (existingOwnerinVeh) {
ids = socket.DMSVeh.owners.filter(
(o) => o.id.value === socket.DMSCust.id.value
);
} else {
ids = [
{
assigningPartyId: "CURRENT",
value: socket.DMSCust.id.value,
},
...socket.DMSVeh.owners.map((o) => {
return {
assigningPartyId: "PREVIOUS",
value: o.id.value,
};
}),
];
}
const soapResponseVehicleInsertUpdate =
await soapClientVehicleInsertUpdate.updateAsync({
arg0: CDK_CREDENTIALS,
@@ -776,12 +802,7 @@ async function UpdateDmsVehicle(socket) {
socket.DMSVeh.vehicle.deliveryDate
).toISOString(),
},
owners: {
id: {
assigningPartyId: "CURRENT",
value: socket.DMSCust.id.value,
},
},
owners: { ids: ids },
},
arg3: "VEHICLES",
});