IO-3166-Global-Notifications-Part-2 - Checkpoint

This commit is contained in:
Dave Richer
2025-03-04 17:50:58 -05:00
parent 07faa5eec2
commit 76ec755d07
3 changed files with 56 additions and 42 deletions

View File

@@ -29,7 +29,10 @@ const FILTER_SELF_FROM_WATCHERS = process.env?.FILTER_SELF_FROM_WATCHERS !== "fa
*/
const scenarioParser = async (req, jobIdField) => {
const { event, trigger, table } = req.body;
const { logger } = req;
const {
logger,
sessionUtils: { getBodyshopFromRedis }
} = req;
// Step 1: Validate we know what user committed the action that fired the parser
// console.log("Step 1");
@@ -118,12 +121,15 @@ const scenarioParser = async (req, jobIdField) => {
// Step 7: Identify scenarios that match the event data and job context
// console.log("Step 7");
const matchingScenarios = getMatchingScenarios({
...eventData,
jobWatchers,
bodyShopId,
bodyShopName
});
const matchingScenarios = await getMatchingScenarios(
{
...eventData,
jobWatchers,
bodyShopId,
bodyShopName
},
getBodyshopFromRedis
);
// Exit early if no matching scenarios are identified
if (isEmpty(matchingScenarios)) {