feature/IO-3096-GlobalNotifications - Checkpoint

This commit is contained in:
Dave Richer
2025-02-11 13:38:15 -05:00
parent 142617bc3d
commit 72305f91d8
5 changed files with 54 additions and 40 deletions

View File

@@ -2706,6 +2706,8 @@ query GET_JOB_WATCHERS($jobid: uuid!) {
}
job: jobs_by_pk(id: $jobid) {
id,
ro_number
clm_no
bodyshop {
id
shopname

View File

@@ -0,0 +1,6 @@
const consoleDir = require("../../utils/consoleDir");
const jobStatusChangeBuilder = (data) => {
consoleDir(data);
};
module.exports = jobStatusChangeBuilder;

View File

@@ -5,15 +5,25 @@
// Builder: function to handle the scenario
const tasksUpdatedCreatedBuilder = require("../scenarioBuilders/tasksUpdatedCreatedBuilder");
const jobStatusChangeBuilder = require("../scenarioBuilders/jobStatusChangeBuilder");
const jobAssignedToMeBuilder = require("../scenarioBuilders/jobAssignedToMeBuilder");
const notificationScenarios = [
{
key: "job-assigned-to-me",
table: "jobs",
fields: ["employee_pre", "employee_body", "employee_csr", "employee_refinish"],
matchEmployee: true
matchEmployee: true,
builder: jobAssignedToMeBuilder
},
{
key: "bill-posted",
table: "bills"
},
{
key: "new-note-added",
table: "notes",
onNew: true
},
{ key: "bill-posted", table: "bills" },
{ key: "new-note-added", table: "notes", onNew: true },
{
key: "schedule-dates-changed",
table: "jobs",
@@ -26,16 +36,22 @@ const notificationScenarios = [
// onNew: true,
builder: tasksUpdatedCreatedBuilder
},
{
key: "job-status-change",
table: "jobs",
fields: ["status"],
builder: jobStatusChangeBuilder
},
{ key: "job-added-to-production", table: "jobs", fields: ["introduction"] },
{ key: "job-status-change", table: "jobs", fields: ["status"] },
{ key: "alternate-transport-changed", table: "jobs", fields: ["alt_transport"] },
{ key: "payment-collected-completed" },
{ key: "new-media-added-reassigned" },
{ key: "new-time-ticket-posted" },
{ key: "intake-delivery-checklist-completed" },
{ key: "payment-collected-completed", table: "payments", onNew: true },
// MAKE SURE YOU ARE NOT ON A LMS ENVIRONMENT
{ key: "new-media-added-reassigned", table: "documents" },
{ key: "new-time-ticket-posted", table: "timetickets" },
{ key: "intake-delivery-checklist-completed", table: "jobs", fields: ["intakechecklist"] },
{ key: "supplement-imported" },
{ key: "critical-parts-status-changed" },
{ key: "part-marked-back-ordered" }
{ key: "critical-parts-status-changed", table: "joblines" },
{ key: "part-marked-back-ordered", table: "joblines" }
];
/**