From 38bd79d6ac1932fc3c357d93f3a15ac8256a52e0 Mon Sep 17 00:00:00 2001 From: Alex Youssefinia Date: Wed, 22 Jan 2025 15:34:27 -0600 Subject: [PATCH 1/8] removed raiReceivedDate from seatool transform --- .../shared-types/opensearch/main/transforms/seatool.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/packages/shared-types/opensearch/main/transforms/seatool.ts b/lib/packages/shared-types/opensearch/main/transforms/seatool.ts index 605630930..442efeb1b 100644 --- a/lib/packages/shared-types/opensearch/main/transforms/seatool.ts +++ b/lib/packages/shared-types/opensearch/main/transforms/seatool.ts @@ -79,9 +79,9 @@ const compileSrtList = ( ): { name: string; email: string }[] => officers?.length ? officers.map((o) => ({ - name: `${o.FIRST_NAME || ""} ${o.LAST_NAME || ""}`, - email: o.EMAIL || "", - })) + name: `${o.FIRST_NAME || ""} ${o.LAST_NAME || ""}`, + email: o.EMAIL || "", + })) : []; const getFinalDispositionDate = (status: string, record: SeaTool) => { @@ -158,7 +158,6 @@ export const transform = (id: string) => { }; }) || [], proposedDate: getDateStringOrNullFromEpoc(data.STATE_PLAN.PROPOSED_DATE), - raiReceivedDate, raiRequestedDate, raiWithdrawnDate, reviewTeam: compileSrtList(data.ACTION_OFFICERS), From 638c5f7a4eaf33e0e34427f5a127cb0bd41d7f19 Mon Sep 17 00:00:00 2001 From: Alex Youssefinia Date: Thu, 23 Jan 2025 12:12:23 -0600 Subject: [PATCH 2/8] removed raiReceivedDate property from test case --- lib/lambda/sinkMainProcessors.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/lambda/sinkMainProcessors.test.ts b/lib/lambda/sinkMainProcessors.test.ts index 89f011bfc..f12a65b6d 100644 --- a/lib/lambda/sinkMainProcessors.test.ts +++ b/lib/lambda/sinkMainProcessors.test.ts @@ -807,7 +807,6 @@ describe("insertNewSeatoolRecordsFromKafkaIntoMako", () => { leadAnalystOfficerId: 67890, locked: false, proposedDate: null, - raiReceivedDate: null, raiRequestedDate: null, raiWithdrawEnabled: false, raiWithdrawnDate: null, From 6773e7de2b7152e004fc5450de69166d7cf870c6 Mon Sep 17 00:00:00 2001 From: Alex Youssefinia Date: Thu, 23 Jan 2025 14:55:21 -0600 Subject: [PATCH 3/8] removed raiReceivedDate property from test case --- lib/lambda/sinkMainProcessors.test.ts | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/lambda/sinkMainProcessors.test.ts b/lib/lambda/sinkMainProcessors.test.ts index f12a65b6d..ecd3100c8 100644 --- a/lib/lambda/sinkMainProcessors.test.ts +++ b/lib/lambda/sinkMainProcessors.test.ts @@ -581,7 +581,6 @@ describe("insertNewSeatoolRecordsFromKafkaIntoMako", () => { leadAnalystOfficerId: 67890, locked: false, proposedDate: null, - raiReceivedDate: null, raiRequestedDate: null, raiWithdrawEnabled: false, raiWithdrawnDate: null, @@ -694,7 +693,6 @@ describe("insertNewSeatoolRecordsFromKafkaIntoMako", () => { leadAnalystOfficerId: 67890, locked: false, proposedDate: null, - raiReceivedDate: null, raiRequestedDate: null, raiWithdrawEnabled: false, raiWithdrawnDate: null, @@ -921,7 +919,6 @@ describe("insertNewSeatoolRecordsFromKafkaIntoMako", () => { leadAnalystOfficerId: 67890, locked: false, proposedDate: null, - raiReceivedDate: null, raiRequestedDate: null, raiWithdrawEnabled: false, raiWithdrawnDate: null, From 4c290e5ee5f291a8539aa76a89130433ee670204 Mon Sep 17 00:00:00 2001 From: Alex Youssefinia Date: Tue, 28 Jan 2025 15:03:17 -0600 Subject: [PATCH 4/8] fix lint errors --- .../shared-types/opensearch/main/transforms/seatool.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/packages/shared-types/opensearch/main/transforms/seatool.ts b/lib/packages/shared-types/opensearch/main/transforms/seatool.ts index 442efeb1b..de2943da1 100644 --- a/lib/packages/shared-types/opensearch/main/transforms/seatool.ts +++ b/lib/packages/shared-types/opensearch/main/transforms/seatool.ts @@ -79,9 +79,9 @@ const compileSrtList = ( ): { name: string; email: string }[] => officers?.length ? officers.map((o) => ({ - name: `${o.FIRST_NAME || ""} ${o.LAST_NAME || ""}`, - email: o.EMAIL || "", - })) + name: `${o.FIRST_NAME || ""} ${o.LAST_NAME || ""}`, + email: o.EMAIL || "", + })) : []; const getFinalDispositionDate = (status: string, record: SeaTool) => { From 7a95b831e28a18d53a4cd300976c9ff48b8116c8 Mon Sep 17 00:00:00 2001 From: Alex Youssefinia Date: Wed, 29 Jan 2025 14:37:39 -0600 Subject: [PATCH 5/8] make withdraw-rai set recieved date to undefined --- lib/packages/shared-types/opensearch/main/transforms/seatool.ts | 1 + .../opensearch/main/transforms/withdraw-rai-response.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/packages/shared-types/opensearch/main/transforms/seatool.ts b/lib/packages/shared-types/opensearch/main/transforms/seatool.ts index de2943da1..605630930 100644 --- a/lib/packages/shared-types/opensearch/main/transforms/seatool.ts +++ b/lib/packages/shared-types/opensearch/main/transforms/seatool.ts @@ -158,6 +158,7 @@ export const transform = (id: string) => { }; }) || [], proposedDate: getDateStringOrNullFromEpoc(data.STATE_PLAN.PROPOSED_DATE), + raiReceivedDate, raiRequestedDate, raiWithdrawnDate, reviewTeam: compileSrtList(data.ACTION_OFFICERS), diff --git a/lib/packages/shared-types/opensearch/main/transforms/withdraw-rai-response.ts b/lib/packages/shared-types/opensearch/main/transforms/withdraw-rai-response.ts index 380931ba7..c09df9a18 100644 --- a/lib/packages/shared-types/opensearch/main/transforms/withdraw-rai-response.ts +++ b/lib/packages/shared-types/opensearch/main/transforms/withdraw-rai-response.ts @@ -7,6 +7,7 @@ export const transform = () => { id: data.id, raiWithdrawEnabled: false, makoChangedDate: data.timestamp ? new Date(data.timestamp).toISOString() : null, + raiReceivedDate: undefined, cmsStatus, stateStatus, seatoolStatus: SEATOOL_STATUS.RAI_RESPONSE_WITHDRAW_REQUESTED, From ad72d95e160e326b6e1ac5c767aa565625d32400 Mon Sep 17 00:00:00 2001 From: Alex Youssefinia Date: Wed, 29 Jan 2025 15:45:58 -0600 Subject: [PATCH 6/8] fix test cases --- lib/lambda/sinkMainProcessors.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/lambda/sinkMainProcessors.test.ts b/lib/lambda/sinkMainProcessors.test.ts index ecd3100c8..89f011bfc 100644 --- a/lib/lambda/sinkMainProcessors.test.ts +++ b/lib/lambda/sinkMainProcessors.test.ts @@ -581,6 +581,7 @@ describe("insertNewSeatoolRecordsFromKafkaIntoMako", () => { leadAnalystOfficerId: 67890, locked: false, proposedDate: null, + raiReceivedDate: null, raiRequestedDate: null, raiWithdrawEnabled: false, raiWithdrawnDate: null, @@ -693,6 +694,7 @@ describe("insertNewSeatoolRecordsFromKafkaIntoMako", () => { leadAnalystOfficerId: 67890, locked: false, proposedDate: null, + raiReceivedDate: null, raiRequestedDate: null, raiWithdrawEnabled: false, raiWithdrawnDate: null, @@ -805,6 +807,7 @@ describe("insertNewSeatoolRecordsFromKafkaIntoMako", () => { leadAnalystOfficerId: 67890, locked: false, proposedDate: null, + raiReceivedDate: null, raiRequestedDate: null, raiWithdrawEnabled: false, raiWithdrawnDate: null, @@ -919,6 +922,7 @@ describe("insertNewSeatoolRecordsFromKafkaIntoMako", () => { leadAnalystOfficerId: 67890, locked: false, proposedDate: null, + raiReceivedDate: null, raiRequestedDate: null, raiWithdrawEnabled: false, raiWithdrawnDate: null, From 6a601ed64ddfd8dc43747cfec9dbeaaae8aed4fe Mon Sep 17 00:00:00 2001 From: Alex Youssefinia Date: Wed, 29 Jan 2025 18:49:21 -0600 Subject: [PATCH 7/8] try setting null explicitly instead of undefined --- .../opensearch/main/transforms/withdraw-rai-response.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/packages/shared-types/opensearch/main/transforms/withdraw-rai-response.ts b/lib/packages/shared-types/opensearch/main/transforms/withdraw-rai-response.ts index c09df9a18..006870a58 100644 --- a/lib/packages/shared-types/opensearch/main/transforms/withdraw-rai-response.ts +++ b/lib/packages/shared-types/opensearch/main/transforms/withdraw-rai-response.ts @@ -7,7 +7,7 @@ export const transform = () => { id: data.id, raiWithdrawEnabled: false, makoChangedDate: data.timestamp ? new Date(data.timestamp).toISOString() : null, - raiReceivedDate: undefined, + raiReceivedDate: null, cmsStatus, stateStatus, seatoolStatus: SEATOOL_STATUS.RAI_RESPONSE_WITHDRAW_REQUESTED, From 8c28ada03c5116f46f9eb790ae7508189955ce71 Mon Sep 17 00:00:00 2001 From: Alex Youssefinia Date: Mon, 3 Feb 2025 16:05:20 -0600 Subject: [PATCH 8/8] add raiRecieedDate to test case for withdraw rai --- lib/lambda/sinkMainProcessors.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/lambda/sinkMainProcessors.test.ts b/lib/lambda/sinkMainProcessors.test.ts index 89f011bfc..8544277d3 100644 --- a/lib/lambda/sinkMainProcessors.test.ts +++ b/lib/lambda/sinkMainProcessors.test.ts @@ -240,6 +240,7 @@ describe("insertOneMacRecordsFromKafkaIntoMako", () => { "withdraw-rai", withdrawRai, { + raiReceivedDate: null, seatoolStatus: SEATOOL_STATUS.RAI_RESPONSE_WITHDRAW_REQUESTED, cmsStatus: statusToDisplayToCmsUser[SEATOOL_STATUS.RAI_RESPONSE_WITHDRAW_REQUESTED], stateStatus: statusToDisplayToStateUser[SEATOOL_STATUS.RAI_RESPONSE_WITHDRAW_REQUESTED],