Merged in feature/IO-3570-Fortellis-Multiple-Veh-Records (pull request #3019)
Feature/IO-3570 Fortellis Multiple Veh Records
This commit is contained in:
@@ -285,7 +285,7 @@ async function FortellisSelectedCustomer({ socket, redisHelpers, selectedCustome
|
|||||||
//something
|
//something
|
||||||
CreateFortellisLogEvent(socket, "DEBUG", `{6} Successfully posted transaction to DMS.`);
|
CreateFortellisLogEvent(socket, "DEBUG", `{6} Successfully posted transaction to DMS.`);
|
||||||
|
|
||||||
await MarkJobExported({ socket, jobid: JobData.id, JobData });
|
await MarkJobExported({ socket, jobid: JobData.id, JobData, redisHelpers });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
CreateFortellisLogEvent(socket, "DEBUG", `{7} Updating Service Vehicle History.`);
|
CreateFortellisLogEvent(socket, "DEBUG", `{7} Updating Service Vehicle History.`);
|
||||||
@@ -427,8 +427,8 @@ async function QueryDmsCustomerByName({ socket, redisHelpers, JobData }) {
|
|||||||
? //? [["firstName", JobData.ownr_co_nm.replace(replaceSpecialRegex, "").toUpperCase()]] // Commented out until we receive direction.
|
? //? [["firstName", JobData.ownr_co_nm.replace(replaceSpecialRegex, "").toUpperCase()]] // Commented out until we receive direction.
|
||||||
[["phone", JobData.ownr_ph1?.replace(replaceSpecialRegex, "")]]
|
[["phone", JobData.ownr_ph1?.replace(replaceSpecialRegex, "")]]
|
||||||
: [
|
: [
|
||||||
["firstName", JobData.ownr_fn?.replace(/[^a-zA-Z-]/g, "").toUpperCase()],
|
["firstName", JobData.ownr_fn?.replace(/[^a-zA-Z0-9-]/g, "").toUpperCase()],
|
||||||
["lastName", JobData.ownr_ln?.replace(/[^a-zA-Z-]/g, "").toUpperCase()]
|
["lastName", JobData.ownr_ln?.replace(/[^a-zA-Z0-9-]/g, "").toUpperCase()]
|
||||||
];
|
];
|
||||||
try {
|
try {
|
||||||
const result = await MakeFortellisCall({
|
const result = await MakeFortellisCall({
|
||||||
@@ -471,9 +471,9 @@ async function InsertDmsCustomer({ socket, redisHelpers, JobData }) {
|
|||||||
: {
|
: {
|
||||||
customerName: {
|
customerName: {
|
||||||
//"suffix": "Mr.",
|
//"suffix": "Mr.",
|
||||||
firstName: JobData.ownr_fn && JobData.ownr_fn.replace(/[^a-zA-Z-]/g, "").toUpperCase(),
|
firstName: JobData.ownr_fn && JobData.ownr_fn.replace(/[^a-zA-Z0-9-]/g, "").toUpperCase(),
|
||||||
//"middleName": "",
|
//"middleName": "",
|
||||||
lastName: JobData.ownr_ln && JobData.ownr_ln.replace(/[^a-zA-Z-]/g, "").toUpperCase()
|
lastName: JobData.ownr_ln && JobData.ownr_ln.replace(/[^a-zA-Z0-9-]/g, "").toUpperCase()
|
||||||
//"title": "",
|
//"title": "",
|
||||||
//"nickName": ""
|
//"nickName": ""
|
||||||
}
|
}
|
||||||
@@ -1295,8 +1295,14 @@ async function DeleteDmsWip({ socket, redisHelpers, JobData }) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function MarkJobExported({ socket, jobid, JobData }) {
|
async function MarkJobExported({ socket, jobid, JobData, redisHelpers }) {
|
||||||
CreateFortellisLogEvent(socket, "DEBUG", `Marking job as exported for id ${jobid}`);
|
CreateFortellisLogEvent(socket, "DEBUG", `Marking job as exported for id ${jobid}`);
|
||||||
|
|
||||||
|
const transwips = await redisHelpers.getSessionTransactionData(
|
||||||
|
socket.id,
|
||||||
|
getTransactionType(JobData.id),
|
||||||
|
FortellisCacheEnums.transWips
|
||||||
|
);
|
||||||
|
|
||||||
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {});
|
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {});
|
||||||
const currentToken =
|
const currentToken =
|
||||||
@@ -1315,7 +1321,7 @@ async function MarkJobExported({ socket, jobid, JobData }) {
|
|||||||
jobid: jobid,
|
jobid: jobid,
|
||||||
successful: true,
|
successful: true,
|
||||||
useremail: socket.user.email,
|
useremail: socket.user.email,
|
||||||
metadata: socket.transWips
|
metadata: transwips
|
||||||
},
|
},
|
||||||
bill: {
|
bill: {
|
||||||
exported: true,
|
exported: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user