IO-233 CDK Updates

This commit is contained in:
Patrick Fic
2021-11-17 14:44:07 -08:00
parent 9eed33b5f2
commit f11a4c93ac
2 changed files with 25 additions and 11 deletions

View File

@@ -37,7 +37,6 @@ exports.default = async function ReloadCdkMakes(req, res) {
const BearerToken = req.headers.authorization;
//Query all CDK Models
const newList = await GetCdkMakes(req, cdk_dealerid);
console.log("🚀 ~ file: cdk-get-makes.js ~ line 40 ~ newList", newList);
//Clear out the existing records
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {
@@ -69,10 +68,6 @@ exports.default = async function ReloadCdkMakes(req, res) {
};
}),
});
console.log(
"🚀 ~ file: cdk-get-makes.js ~ line 66 ~ insertResult",
insertResult
);
logger.log(
"cdk-replace-makes-models-success",
@@ -121,9 +116,28 @@ async function GetCdkMakes(req, cdk_dealerid) {
);
CheckCdkResponseForError(null, soapResponseVehicleSearch);
const [
result, //rawResponse, soapheader, rawRequest
] = soapResponseVehicleSearch;
const [result, rawResponse, , rawRequest] = soapResponseVehicleSearch;
logger.log(
"cdk-replace-makes-models-request",
"ERROR",
req.user.email,
null,
{
cdk_dealerid,
xml: rawRequest,
}
);
logger.log(
"cdk-replace-makes-models-response",
"ERROR",
req.user.email,
null,
{
cdk_dealerid,
xml: rawResponse,
}
);
return result.return;
} catch (error) {

View File

@@ -172,7 +172,7 @@ async function CdkSelectedCustomer(socket, selectedCustomerId) {
`{6} Successfully posted sransaction to DMS.`
);
await MarkJobExported(socket, socket.JobData.id);
//await MarkJobExported(socket, socket.JobData.id);
CdkBase.createLogEvent(
socket,
@@ -856,9 +856,9 @@ async function InsertServiceVehicleHistory(socket) {
roNumber: socket.JobData.ro_number.match(/\d+/g),
mileage: socket.txEnvelope.kmout,
openDate: moment(socket.JobData.actual_in).format("YYYY-MM-DD"),
openTime: moment(socket.JobData.actual_in).format("HH:MM:SS"),
openTime: moment(socket.JobData.actual_in).format("HH:MM:ss"),
closeDate: moment(socket.JobData.invoice_date).format("YYYY-MM-DD"),
closeTime: moment(socket.JobData.invoice_date).format("HH:MM:SS"),
closeTime: moment(socket.JobData.invoice_date).format("HH:MM:ss"),
comments: socket.txEnvelope.story,
cashierID: socket.JobData.bodyshop.cdk_configuration.cashierid,
},