feature/IO-3096-GlobalNotifications - Checkpoint, BULLMQ!

This commit is contained in:
Dave Richer
2025-02-13 16:19:36 -05:00
parent 5cfadf7929
commit df13f257db
13 changed files with 887 additions and 747 deletions

View File

@@ -1,4 +1,5 @@
const consoleDir = require("../utils/consoleDir");
const { getJobAssignmentType } = require("./stringHelpers");
const alternateTransportChangedBuilder = (data) => {
consoleDir(data);
@@ -17,7 +18,23 @@ const intakeDeliveryChecklistCompletedBuilder = (data) => {
};
const jobAssignedToMeBuilder = (data) => {
consoleDir(data);
return {
app: {
key: "notifications.job.assigned",
variables: {
type: data.scenarioFields?.[0],
jobId: data.jobId,
bodyShopName: data.bodyShopName
},
recipients: data.scenarioWatchers.map((watcher) => ({ email: watcher.user, employeeId: watcher.employeeId }))
},
email: {
subject: `You have been assigned to [${getJobAssignmentType(data.scenarioFields?.[0])}] on ${data?.jobRoNumber} in ${data.bodyShopName}`,
body: `Hello, a new job has been assigned to you in ${data.bodyShopName}.`,
recipient: data.scenarioWatchers.map((watcher) => watcher.user)
},
fcm: {}
};
};
const jobsAddedToProductionBuilder = (data) => {