Compare commits

...

7 Commits

Author SHA1 Message Date
Patrick Fic
cafca35500 IO-2957 Resolve task reminders not sending with incorrect references. 2024-09-23 18:02:17 -07:00
Patrick Fic
6e61159608 Merged in feature/IO-2945-intellipaypostbackhandling (pull request #1765)
feature/IO-2945-intellipaypostbackhandling

Approved-by: Patrick Fic
2024-09-23 22:15:51 +00:00
Patrick Fic
3c85de3e34 IO-2945 Resolve no success being sent to intellipay creating triple posting. 2024-09-23 15:04:51 -07:00
Allan Carr
1a4c9faab1 Merged in release/2024-09-20 (pull request #1759)
IO-2782 Adjust to Object for items
2024-09-20 23:46:03 +00:00
Patrick Fic
439d9e7b74 Merged in release/2024-09-20 (pull request #1757)
Further index changes.
2024-09-20 22:58:14 +00:00
Dave Richer
7cde2f64af Merged in release/2024-09-20 (pull request #1755)
IO-2782 - Fix query
2024-09-20 22:54:41 +00:00
Allan Carr
0677712d6e Merged in release/2024-09-20 (pull request #1753)
Release/2024 09 20 IO-2782, IO-2920, IO-2921, IO-2928, IO-2932, IO-2933, IO-2934, IO-2936, IO-2939, IO-2948, IO-2949
2024-09-20 22:27:11 +00:00
2 changed files with 34 additions and 26 deletions

View File

@@ -95,11 +95,11 @@ const formatPriority = (priority) => {
* @returns {{header, body: string, subHeader: string}}
*/
const getEndpoints = () =>
const getEndpoints = (bodyshop) =>
InstanceManager({
imex: process.env?.NODE_ENV === "test" ? "https://test.imex.online" : "https://imex.online",
rome:
bodyshop.convenient_company === "promanager"
bodyshop?.convenient_company === "promanager"
? process.env?.NODE_ENV === "test"
? "https//test.promanager.web-est.com"
: "https://promanager.web-est.com"
@@ -109,7 +109,7 @@ const getEndpoints = () =>
});
const generateTemplateArgs = (title, priority, description, dueDate, bodyshop, job, taskId) => {
const endPoints = getEndpoints();
const endPoints = getEndpoints(bodyshop);
return {
header: title,
subHeader: `Body Shop: ${bodyshop.shopname} | Priority: ${formatPriority(priority)} ${formatDate(dueDate)}`,
@@ -247,7 +247,7 @@ const tasksRemindEmail = async (req, res) => {
const fromEmails = InstanceManager({
imex: "ImEX Online <noreply@imex.online>",
rome:
onlyTask.bodyshop.convenient_company === "promanager"
tasksRequest?.tasks[0].bodyshop.convenient_company === "promanager"
? "ProManager <noreply@promanager.web-est.com>"
: "Rome Online <noreply@romeonline.io>"
});
@@ -283,7 +283,7 @@ const tasksRemindEmail = async (req, res) => {
const endPoints = InstanceManager({
imex: process.env?.NODE_ENV === "test" ? "https://test.imex.online" : "https://imex.online",
rome:
allTasks[0].bodyshop.convenient_company === "promanager"
tasksRequest?.tasks[0].bodyshop.convenient_company === "promanager"
? process.env?.NODE_ENV === "test"
? "https//test.promanager.web-est.com"
: "https://promanager.web-est.com"
@@ -320,7 +320,7 @@ const tasksRemindEmail = async (req, res) => {
tasksEmailQueue.push(taskId);
}
},
allTasks[0].bodyshop.convenient_company
tasksRequest?.tasks[0].bodyshop.convenient_company
);
}
});

View File

@@ -200,31 +200,39 @@ exports.postback = async (req, res) => {
}
}))
});
logger.log("intellipay-postback-app-success", "DEBUG", req.user?.email, null, {
logger.log("intellipay-postback-app-success", "DEBUG", req.user?.email, JSON.stringify(jobs), {
iprequest: values,
paymentResult
});
if (values.origin === "OneLink" && parsedComment.userEmail) {
//Send an email, it was a text to pay link.
const endPoints = getEndpoints();
sendTaskEmail({
to: parsedComment.userEmail,
subject: `New Payment(s) Received - RO ${jobs.jobs.map((j) => j.ro_number).join(", ")}`,
type: "html",
html: generateEmailTemplate({
header: "New Payment(s) Received",
subHeader: "",
body: jobs.jobs
.map(
(job) =>
`Reference: <a href="${endPoints}/manage/jobs/${job.id}">${job.ro_number || "N/A"}</a> | ${job.ownr_co_nm ? job.ownr_co_nm : `${job.ownr_fn || ""} ${job.ownr_ln || ""}`.trim()} | ${`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${job.v_model_desc || ""}`.trim()} | $${partialPayments.find((p) => p.jobid === job.id).amount}`
)
.join("<br/>")
})
});
res.sendStatus(200);
try {
const endPoints = getEndpoints();
sendTaskEmail({
to: parsedComment.userEmail,
subject: `New Payment(s) Received - RO ${jobs.jobs.map((j) => j.ro_number).join(", ")}`,
type: "html",
html: generateEmailTemplate({
header: "New Payment(s) Received",
subHeader: "",
body: jobs.jobs
.map(
(job) =>
`Reference: <a href="${endPoints}/manage/jobs/${job.id}">${job.ro_number || "N/A"}</a> | ${job.ownr_co_nm ? job.ownr_co_nm : `${job.ownr_fn || ""} ${job.ownr_ln || ""}`.trim()} | ${`${job.v_model_yr || ""} ${job.v_make_desc || ""} ${job.v_model_desc || ""}`.trim()} | $${partialPayments.find((p) => p.jobid === job.id).amount}`
)
.join("<br/>")
})
});
} catch (error) {
logger.log("intellipay-postback-app-email-error", "DEBUG", req.user?.email, JSON.stringify(jobs), {
iprequest: values,
paymentResult,
error: error.message
});
}
}
res.sendStatus(200);
} else if (values.invoice) {
//This is a link email that's been sent out.
const job = await gqlClient.request(queries.GET_JOB_BY_PK, {
@@ -255,7 +263,7 @@ exports.postback = async (req, res) => {
}
});
logger.log("intellipay-postback-link-success", "DEBUG", req.user?.email, null, {
logger.log("intellipay-postback-link-success", "DEBUG", req.user?.email, values.invoice, {
iprequest: values,
responseResults,
paymentResult
@@ -263,7 +271,7 @@ exports.postback = async (req, res) => {
res.sendStatus(200);
}
} catch (error) {
logger.log("intellipay-postback-error", "ERROR", req.user?.email, null, {
logger.log("intellipay-postback-total-error", "ERROR", req.user?.email, null, {
error: JSON.stringify(error),
body: req.body
});