Skip to content

Commit

Permalink
add respondto rai and fix event in changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
thwalker6 committed Jan 16, 2025
1 parent 1e9a63e commit 1e799ae
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
26 changes: 25 additions & 1 deletion lib/lambda/processEmailsHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,33 @@ const withdrawPackage = "withdraw-package";
const contractingInitial = "contracting-initial";
const capitatedInitial = "capitated-initial";
const withdrawRai = "withdraw-rai";

const respondToRai = "respond-to-rai"

Check failure on line 15 in lib/lambda/processEmailsHandler.test.ts

View workflow job for this annotation

GitHub Actions / lint

Insert `;`
describe("process emails Handler", () => {
it.each([
[

Check failure on line 18 in lib/lambda/processEmailsHandler.test.ts

View workflow job for this annotation

GitHub Actions / lint

Delete `····`
`should send an email for ${respondToRai} with ${Authority.MED_SPA}`,
Authority.MED_SPA,
respondToRai,
SIMPLE_ID,
],
[
`should send an email for ${respondToRai} with ${Authority.CHIP_SPA}`,
Authority.CHIP_SPA,
respondToRai,
SIMPLE_ID,
],
[
`should send an email for ${respondToRai} with ${Authority["1915b"]}`,
Authority["1915b"],
respondToRai,
SIMPLE_ID,
],
[
`should send an email for ${respondToRai} with ${Authority["1915c"]}`,
Authority["1915c"],
respondToRai,
SIMPLE_ID,
],
[
`should send an email for ${nms} with ${Authority.MED_SPA}`,
Authority.MED_SPA,
Expand Down
2 changes: 1 addition & 1 deletion lib/libs/email/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export async function getLatestMatchingEvent(
}

// Filter matching events
const events = item.hits.hits.filter((event) => event._source.actionType === actionType);
const events = item.hits.hits.filter((event) => event._source.event === actionType);

// Check if any matching events were found
if (!events.length) {
Expand Down
6 changes: 3 additions & 3 deletions mocks/data/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ const items: Record<string, TestItemResult> = {
_id: `${WITHDRAW_RAI_ITEM_B}-001`,
_source: {
id: `${WITHDRAW_RAI_ITEM_B}-0001`,
actionType: "respond-to-rai",
event: "respond-to-rai",
packageId: WITHDRAW_RAI_ITEM_B,
},
},
Expand Down Expand Up @@ -449,7 +449,7 @@ const items: Record<string, TestItemResult> = {
id: `${WITHDRAW_RAI_ITEM_C}-0001`,
submitterName: "Testmctex",
submitterEmail: "dkjfdkljl;",
actionType: "respond-to-rai",
event: "respond-to-rai",
packageId: WITHDRAW_RAI_ITEM_C,
},
},
Expand All @@ -460,7 +460,7 @@ const items: Record<string, TestItemResult> = {
id: `${WITHDRAW_RAI_ITEM_C}-0002`,
submitterName: "Testmctex",
submitterEmail: "dkjfdkljl;",
actionType: "WithdrawRai",
event: "WithdrawRai",
packageId: WITHDRAW_RAI_ITEM_C,
},
},
Expand Down

0 comments on commit 1e799ae

Please sign in to comment.