From ceec6125d4d8a24efe574ac7b3faabf0ec8de0fe Mon Sep 17 00:00:00 2001 From: John Cruz Date: Wed, 20 Nov 2024 08:21:39 -0700 Subject: [PATCH 01/39] Add Types for notification message for 'message_completion_error' and 'contact_update_progress' --- .../generateChangeOfAddressHelper.ts | 9 +++++++-- .../useCases/user/generateChangeOfAddress.ts | 9 +++++++-- .../notifications/sendNotificationToUser.ts | 20 ++++++++++++++++++- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/web-api/src/business/useCaseHelper/generateChangeOfAddressHelper.ts b/web-api/src/business/useCaseHelper/generateChangeOfAddressHelper.ts index 2b40dfd0a37..66a545aafc1 100644 --- a/web-api/src/business/useCaseHelper/generateChangeOfAddressHelper.ts +++ b/web-api/src/business/useCaseHelper/generateChangeOfAddressHelper.ts @@ -47,7 +47,7 @@ export const generateChangeOfAddressHelper = async ({ jobId: string; user: RawPractitioner; requestUserId?: string; - websocketMessagePrefix: string; + websocketMessagePrefix: 'user' | 'admin'; }) => { try { const newData = contactInfo; @@ -107,10 +107,15 @@ export const generateChangeOfAddressHelper = async ({ applicationContext.logger.error(error); } + const NOTIFICATION_ACTION: + | 'user_contact_update_progress' + | 'admin_contact_update_progress' = + `${websocketMessagePrefix}_contact_update_progress`; + await applicationContext.getNotificationGateway().sendNotificationToUser({ applicationContext, message: { - action: `${websocketMessagePrefix}_contact_update_progress`, + action: NOTIFICATION_ACTION, }, userId: requestUserId || user.userId, }); diff --git a/web-api/src/business/useCases/user/generateChangeOfAddress.ts b/web-api/src/business/useCases/user/generateChangeOfAddress.ts index 695132da6c9..3622c7cf445 100644 --- a/web-api/src/business/useCases/user/generateChangeOfAddress.ts +++ b/web-api/src/business/useCases/user/generateChangeOfAddress.ts @@ -50,7 +50,7 @@ const generateChangeOfAddressForPractitioner = async ({ updatedEmail?: string; updatedName?: string; user: any; - websocketMessagePrefix?: string; + websocketMessagePrefix?: 'user' | 'admin'; authorizedUser: AuthUser; }): Promise => { const associatedUserCases = await applicationContext @@ -65,10 +65,15 @@ const generateChangeOfAddressForPractitioner = async ({ } let completedCases = 0; + const NOTIFICATION_ACTION: + | 'user_contact_update_progress' + | 'admin_contact_update_progress' = + `${websocketMessagePrefix}_contact_update_progress`; + await applicationContext.getNotificationGateway().sendNotificationToUser({ applicationContext, message: { - action: `${websocketMessagePrefix}_contact_update_progress`, + action: NOTIFICATION_ACTION, completedCases, totalCases: associatedUserCases.length, }, diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index ccc37d42e3a..4a5b60e5846 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -1,5 +1,23 @@ import { ServerApplicationContext } from '@web-api/applicationContext'; +type MessageCompletionErrorNotification = { + action: 'message_completion_error'; + alertError: { + message: string; + title: string; + }; +}; + +type ContactUpdateProgressNotification = { + action: 'user_contact_update_progress' | 'admin_contact_update_progress'; + completedCases?: number; + totalCases?: number; +}; + +type NotificationMessage = + | MessageCompletionErrorNotification + | ContactUpdateProgressNotification; + export const sendNotificationToUser = async ({ applicationContext, clientConnectionId, @@ -8,7 +26,7 @@ export const sendNotificationToUser = async ({ }: { applicationContext: ServerApplicationContext; clientConnectionId?: string; - message: any; + message: NotificationMessage; userId: string; }) => { let connections = await applicationContext From 46cb621e2fb0c9724853b0c02154987d36a3e99a Mon Sep 17 00:00:00 2001 From: John Cruz Date: Wed, 20 Nov 2024 08:24:30 -0700 Subject: [PATCH 02/39] TEMP: ignore PR actions for now --- .github/{workflows => IGNORE_TEMP}/api.yml | 0 .github/{workflows => IGNORE_TEMP}/client-integration-public.yml | 0 .github/{workflows => IGNORE_TEMP}/client-integration.yml | 0 .github/{workflows => IGNORE_TEMP}/client.yml | 0 .github/{workflows => IGNORE_TEMP}/e2e-cypress-accessibility.yml | 0 .github/{workflows => IGNORE_TEMP}/e2e-cypress-public.yml | 0 .../{workflows => IGNORE_TEMP}/e2e-cypress-smoketests-local.yml | 0 .github/{workflows => IGNORE_TEMP}/e2e-cypress.yml | 0 .github/{workflows => IGNORE_TEMP}/lint.yml | 0 .github/{workflows => IGNORE_TEMP}/pdfs.yml | 0 .github/{workflows => IGNORE_TEMP}/scripts.yml | 0 .github/{workflows => IGNORE_TEMP}/shared.yml | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => IGNORE_TEMP}/api.yml (100%) rename .github/{workflows => IGNORE_TEMP}/client-integration-public.yml (100%) rename .github/{workflows => IGNORE_TEMP}/client-integration.yml (100%) rename .github/{workflows => IGNORE_TEMP}/client.yml (100%) rename .github/{workflows => IGNORE_TEMP}/e2e-cypress-accessibility.yml (100%) rename .github/{workflows => IGNORE_TEMP}/e2e-cypress-public.yml (100%) rename .github/{workflows => IGNORE_TEMP}/e2e-cypress-smoketests-local.yml (100%) rename .github/{workflows => IGNORE_TEMP}/e2e-cypress.yml (100%) rename .github/{workflows => IGNORE_TEMP}/lint.yml (100%) rename .github/{workflows => IGNORE_TEMP}/pdfs.yml (100%) rename .github/{workflows => IGNORE_TEMP}/scripts.yml (100%) rename .github/{workflows => IGNORE_TEMP}/shared.yml (100%) diff --git a/.github/workflows/api.yml b/.github/IGNORE_TEMP/api.yml similarity index 100% rename from .github/workflows/api.yml rename to .github/IGNORE_TEMP/api.yml diff --git a/.github/workflows/client-integration-public.yml b/.github/IGNORE_TEMP/client-integration-public.yml similarity index 100% rename from .github/workflows/client-integration-public.yml rename to .github/IGNORE_TEMP/client-integration-public.yml diff --git a/.github/workflows/client-integration.yml b/.github/IGNORE_TEMP/client-integration.yml similarity index 100% rename from .github/workflows/client-integration.yml rename to .github/IGNORE_TEMP/client-integration.yml diff --git a/.github/workflows/client.yml b/.github/IGNORE_TEMP/client.yml similarity index 100% rename from .github/workflows/client.yml rename to .github/IGNORE_TEMP/client.yml diff --git a/.github/workflows/e2e-cypress-accessibility.yml b/.github/IGNORE_TEMP/e2e-cypress-accessibility.yml similarity index 100% rename from .github/workflows/e2e-cypress-accessibility.yml rename to .github/IGNORE_TEMP/e2e-cypress-accessibility.yml diff --git a/.github/workflows/e2e-cypress-public.yml b/.github/IGNORE_TEMP/e2e-cypress-public.yml similarity index 100% rename from .github/workflows/e2e-cypress-public.yml rename to .github/IGNORE_TEMP/e2e-cypress-public.yml diff --git a/.github/workflows/e2e-cypress-smoketests-local.yml b/.github/IGNORE_TEMP/e2e-cypress-smoketests-local.yml similarity index 100% rename from .github/workflows/e2e-cypress-smoketests-local.yml rename to .github/IGNORE_TEMP/e2e-cypress-smoketests-local.yml diff --git a/.github/workflows/e2e-cypress.yml b/.github/IGNORE_TEMP/e2e-cypress.yml similarity index 100% rename from .github/workflows/e2e-cypress.yml rename to .github/IGNORE_TEMP/e2e-cypress.yml diff --git a/.github/workflows/lint.yml b/.github/IGNORE_TEMP/lint.yml similarity index 100% rename from .github/workflows/lint.yml rename to .github/IGNORE_TEMP/lint.yml diff --git a/.github/workflows/pdfs.yml b/.github/IGNORE_TEMP/pdfs.yml similarity index 100% rename from .github/workflows/pdfs.yml rename to .github/IGNORE_TEMP/pdfs.yml diff --git a/.github/workflows/scripts.yml b/.github/IGNORE_TEMP/scripts.yml similarity index 100% rename from .github/workflows/scripts.yml rename to .github/IGNORE_TEMP/scripts.yml diff --git a/.github/workflows/shared.yml b/.github/IGNORE_TEMP/shared.yml similarity index 100% rename from .github/workflows/shared.yml rename to .github/IGNORE_TEMP/shared.yml From 62f736f8d9d46f089fc91bb191593cee66c20d9a Mon Sep 17 00:00:00 2001 From: John Cruz Date: Wed, 20 Nov 2024 08:57:13 -0700 Subject: [PATCH 03/39] Add Types for notification message for '_contact_full_update_complete' --- .../useCaseHelper/generateChangeOfAddressHelper.ts | 7 ++++++- web-api/src/notifications/sendNotificationToUser.ts | 11 ++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/web-api/src/business/useCaseHelper/generateChangeOfAddressHelper.ts b/web-api/src/business/useCaseHelper/generateChangeOfAddressHelper.ts index 66a545aafc1..1a313952030 100644 --- a/web-api/src/business/useCaseHelper/generateChangeOfAddressHelper.ts +++ b/web-api/src/business/useCaseHelper/generateChangeOfAddressHelper.ts @@ -143,10 +143,15 @@ export const generateChangeOfAddressHelper = async ({ }); } + const CONTACT_UPDATE_COMPLTET_ACTION: + | 'user_contact_full_update_complete' + | 'admin_contact_full_update_complete' = + `${websocketMessagePrefix}_contact_full_update_complete`; + await applicationContext.getNotificationGateway().sendNotificationToUser({ applicationContext, message: { - action: `${websocketMessagePrefix}_contact_full_update_complete`, + action: CONTACT_UPDATE_COMPLTET_ACTION, user, }, userId: requestUserId || user.userId, diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 4a5b60e5846..7ac1f04a783 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -1,3 +1,4 @@ +import { RawPractitioner } from '@shared/business/entities/Practitioner'; import { ServerApplicationContext } from '@web-api/applicationContext'; type MessageCompletionErrorNotification = { @@ -14,9 +15,17 @@ type ContactUpdateProgressNotification = { totalCases?: number; }; +type ContactUpdateCompleteNotification = { + action: + | 'user_contact_full_update_complete' + | 'admin_contact_full_update_complete'; + user?: RawPractitioner; +}; + type NotificationMessage = | MessageCompletionErrorNotification - | ContactUpdateProgressNotification; + | ContactUpdateProgressNotification + | ContactUpdateCompleteNotification; export const sendNotificationToUser = async ({ applicationContext, From 7ba160ebaec41071ea7e4fae10ca69814fe03468 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Wed, 20 Nov 2024 09:07:04 -0700 Subject: [PATCH 04/39] Add typing to ServeDocumentErrorNotification; --- .../fileAndServeCourtIssuedDocumentInteractor.ts | 2 +- web-api/src/notifications/sendNotificationToUser.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/web-api/src/business/useCases/courtIssuedDocument/fileAndServeCourtIssuedDocumentInteractor.ts b/web-api/src/business/useCases/courtIssuedDocument/fileAndServeCourtIssuedDocumentInteractor.ts index 75ad15952cf..c0cf84946f3 100644 --- a/web-api/src/business/useCases/courtIssuedDocument/fileAndServeCourtIssuedDocumentInteractor.ts +++ b/web-api/src/business/useCases/courtIssuedDocument/fileAndServeCourtIssuedDocumentInteractor.ts @@ -61,7 +61,7 @@ export const fileAndServeCourtIssuedDocument = async ( docketEntryId, }); - let error; + let error: Error | undefined; if (!docketEntryToServe) { error = new NotFoundError(`Docket entry ${docketEntryId} was not found.`); } else if (docketEntryToServe.servedAt) { diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 7ac1f04a783..0549990df4e 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -22,10 +22,16 @@ type ContactUpdateCompleteNotification = { user?: RawPractitioner; }; +type ServeDocumentErrorNotification = { + action: 'serve_document_error'; + error: string; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification - | ContactUpdateCompleteNotification; + | ContactUpdateCompleteNotification + | ServeDocumentErrorNotification; export const sendNotificationToUser = async ({ applicationContext, From 8f9382132128594c35361f9dd59d74ffd38b2185 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:12:43 -0700 Subject: [PATCH 05/39] Add message type for 'ServeDocumentCompleteNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 0549990df4e..4503abf7ad2 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -27,11 +27,21 @@ type ServeDocumentErrorNotification = { error: string; }; +type ServeDocumentCompleteNotification = { + action: 'serve_document_complete'; + alertSuccess: { + message: string; + overwritable: boolean; + }; + pdfUrl?: string; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification | ContactUpdateCompleteNotification - | ServeDocumentErrorNotification; + | ServeDocumentErrorNotification + | ServeDocumentCompleteNotification; export const sendNotificationToUser = async ({ applicationContext, From 5e1397d555caa464b29c2b7da8bff04ea7f6b6f1 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:15:11 -0700 Subject: [PATCH 06/39] Add message type for 'RetryAsyncRequestNotification' --- .../serveCourtIssuedDocumentInteractor.ts | 2 +- web-api/src/notifications/sendNotificationToUser.ts | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/web-api/src/business/useCases/courtIssuedDocument/serveCourtIssuedDocumentInteractor.ts b/web-api/src/business/useCases/courtIssuedDocument/serveCourtIssuedDocumentInteractor.ts index d9aca4768a4..48e73cb70eb 100644 --- a/web-api/src/business/useCases/courtIssuedDocument/serveCourtIssuedDocumentInteractor.ts +++ b/web-api/src/business/useCases/courtIssuedDocument/serveCourtIssuedDocumentInteractor.ts @@ -214,7 +214,7 @@ export const determineEntitiesToLock = ( }); export const handleLockError = async ( - applicationContext, + applicationContext: ServerApplicationContext, originalRequest, authorizedUser: UnknownAuthUser, ) => { diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 4503abf7ad2..c6f7abd5e7d 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -36,12 +36,19 @@ type ServeDocumentCompleteNotification = { pdfUrl?: string; }; +type RetryAsyncRequestNotification = { + action: 'retry_async_request'; + originalRequest: any; + requestToRetry: string; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification | ContactUpdateCompleteNotification | ServeDocumentErrorNotification - | ServeDocumentCompleteNotification; + | ServeDocumentCompleteNotification + | RetryAsyncRequestNotification; export const sendNotificationToUser = async ({ applicationContext, From 08b6ac859cedfd02b38e643c4f3e2cf53c9f719e Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:16:32 -0700 Subject: [PATCH 07/39] Add message type for 'BatchDownloadCsvDataNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index c6f7abd5e7d..a9a102b8cfd 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -42,13 +42,20 @@ type RetryAsyncRequestNotification = { requestToRetry: string; }; +type BatchDownloadCsvDataNotification = { + action: 'batch_download_csv_data'; + filesCompleted: number; + totalFiles: number; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification | ContactUpdateCompleteNotification | ServeDocumentErrorNotification | ServeDocumentCompleteNotification - | RetryAsyncRequestNotification; + | RetryAsyncRequestNotification + | BatchDownloadCsvDataNotification; export const sendNotificationToUser = async ({ applicationContext, From c2c42c56929b812837025e79cb6f61f09d6b8f66 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:17:56 -0700 Subject: [PATCH 08/39] Add message type for 'DownloadCsvFileNotification' --- .../createCsvCustomCaseReportFileInteractor.ts | 2 +- web-api/src/notifications/sendNotificationToUser.ts | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/web-api/src/business/useCases/customCaseReport/createCsvCustomCaseReportFileInteractor.ts b/web-api/src/business/useCases/customCaseReport/createCsvCustomCaseReportFileInteractor.ts index 718e5445ec2..95bb1e8e1c4 100644 --- a/web-api/src/business/useCases/customCaseReport/createCsvCustomCaseReportFileInteractor.ts +++ b/web-api/src/business/useCases/customCaseReport/createCsvCustomCaseReportFileInteractor.ts @@ -118,7 +118,7 @@ export const createCsvCustomCaseReportFileInteractor = async ( const csvBuffer = Buffer.from(csvString); const today = formatNow(FORMATS.MMDDYYYY_UNDERSCORED); - const fileName = 'Custom Case Report - ' + today; + const fileName: string = 'Custom Case Report - ' + today; const fileInfo = await saveFileAndGenerateUrl({ applicationContext, diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index a9a102b8cfd..54098e870e3 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -48,6 +48,14 @@ type BatchDownloadCsvDataNotification = { totalFiles: number; }; +type DownloadCsvFileNotification = { + action: 'download_csv_file'; + csvInfo: { + fileName: string; + url: string; + }; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -55,7 +63,8 @@ type NotificationMessage = | ServeDocumentErrorNotification | ServeDocumentCompleteNotification | RetryAsyncRequestNotification - | BatchDownloadCsvDataNotification; + | BatchDownloadCsvDataNotification + | DownloadCsvFileNotification; export const sendNotificationToUser = async ({ applicationContext, From 699ff5c4df090bc9789ed87aaf9c84cde603489f Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:19:10 -0700 Subject: [PATCH 09/39] Update message type for 'ServeDocumentCompleteNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 54098e870e3..e74f82daf54 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -33,6 +33,8 @@ type ServeDocumentCompleteNotification = { message: string; overwritable: boolean; }; + generateCoversheet?: boolean; + docketEntryId?: string; pdfUrl?: string; }; @@ -56,6 +58,14 @@ type DownloadCsvFileNotification = { }; }; +type SaveDocketEntryForLaterNotification = { + action: 'save_docket_entry_for_later_complete'; + csvInfo: { + fileName: string; + url: string; + }; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification From 9ea32ca7a2272b90e21b8ff9ddce8849dbedcef2 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:20:20 -0700 Subject: [PATCH 10/39] Add message type for 'SaveDocketEntryForLaterCompleteNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index e74f82daf54..db55796705b 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -58,12 +58,13 @@ type DownloadCsvFileNotification = { }; }; -type SaveDocketEntryForLaterNotification = { +type SaveDocketEntryForLaterCompleteNotification = { action: 'save_docket_entry_for_later_complete'; - csvInfo: { - fileName: string; - url: string; + alertSuccess: { + message: string; + overwritable: boolean; }; + docketEntryId: string; }; type NotificationMessage = @@ -74,7 +75,8 @@ type NotificationMessage = | ServeDocumentCompleteNotification | RetryAsyncRequestNotification | BatchDownloadCsvDataNotification - | DownloadCsvFileNotification; + | DownloadCsvFileNotification + | SaveDocketEntryForLaterCompleteNotification; export const sendNotificationToUser = async ({ applicationContext, From 009771cb5c3465fa9be620c51dd451ffd19b476b Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:21:46 -0700 Subject: [PATCH 11/39] Add message type for 'BatchDownloadErrorNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index db55796705b..703fb81ac41 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -67,6 +67,11 @@ type SaveDocketEntryForLaterCompleteNotification = { docketEntryId: string; }; +type BatchDownloadErrorNotification = { + action: 'batch_download_error'; + error: any; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -76,7 +81,8 @@ type NotificationMessage = | RetryAsyncRequestNotification | BatchDownloadCsvDataNotification | DownloadCsvFileNotification - | SaveDocketEntryForLaterCompleteNotification; + | SaveDocketEntryForLaterCompleteNotification + | BatchDownloadErrorNotification; export const sendNotificationToUser = async ({ applicationContext, From 3424ad862934d74d6b60c5568d13d3ccea1078e1 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:22:29 -0700 Subject: [PATCH 12/39] Add message type for 'BatchDownloadProgressNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 703fb81ac41..a6d184a7b98 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -72,6 +72,12 @@ type BatchDownloadErrorNotification = { error: any; }; +type BatchDownloadProgressNotification = { + action: 'batch_download_progress'; + filesCompleted: number; + totalFiles: number; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -82,7 +88,8 @@ type NotificationMessage = | BatchDownloadCsvDataNotification | DownloadCsvFileNotification | SaveDocketEntryForLaterCompleteNotification - | BatchDownloadErrorNotification; + | BatchDownloadErrorNotification + | BatchDownloadProgressNotification; export const sendNotificationToUser = async ({ applicationContext, From 246658998645242b320db154ad047499a893ccdc Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:23:10 -0700 Subject: [PATCH 13/39] Add message type for 'BatchDownloadReadyNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index a6d184a7b98..24297967ed6 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -78,6 +78,11 @@ type BatchDownloadProgressNotification = { totalFiles: number; }; +type BatchDownloadReadyNotification = { + action: 'batch_download_ready'; + url: string; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -89,7 +94,8 @@ type NotificationMessage = | DownloadCsvFileNotification | SaveDocketEntryForLaterCompleteNotification | BatchDownloadErrorNotification - | BatchDownloadProgressNotification; + | BatchDownloadProgressNotification + | BatchDownloadReadyNotification; export const sendNotificationToUser = async ({ applicationContext, From 026244c8e15985c58093fc81f2c35d7ea0c4b606 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:24:27 -0700 Subject: [PATCH 14/39] Add message type for 'AwsBatchDownloadProgressNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 24297967ed6..8a6e9b305de 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -83,6 +83,12 @@ type BatchDownloadReadyNotification = { url: string; }; +type AwsBatchDownloadProgressNotification = { + action: 'aws_batch_download_progress'; + filesCompleted: number; + totalFiles: number; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -95,7 +101,8 @@ type NotificationMessage = | SaveDocketEntryForLaterCompleteNotification | BatchDownloadErrorNotification | BatchDownloadProgressNotification - | BatchDownloadReadyNotification; + | BatchDownloadReadyNotification + | AwsBatchDownloadProgressNotification; export const sendNotificationToUser = async ({ applicationContext, From cc902b98611f342a20043aecaf7a812fcac8f07f Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:29:15 -0700 Subject: [PATCH 15/39] Add message type for 'MessageCompletionSucessNotification' and 'AdminContactInitialUpdateCompleteNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 8a6e9b305de..990055dd92d 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -89,6 +89,15 @@ type AwsBatchDownloadProgressNotification = { totalFiles: number; }; +type MessageCompletionSucessNotification = { + action: 'message_completion_success'; + completedMessageIds: string[]; +}; + +type AdminContactInitialUpdateCompleteNotification = { + action: 'admin_contact_initial_update_complete'; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -102,7 +111,9 @@ type NotificationMessage = | BatchDownloadErrorNotification | BatchDownloadProgressNotification | BatchDownloadReadyNotification - | AwsBatchDownloadProgressNotification; + | AwsBatchDownloadProgressNotification + | MessageCompletionSucessNotification + | AdminContactInitialUpdateCompleteNotification; export const sendNotificationToUser = async ({ applicationContext, From 5fd94dd9415314e46d9b5ae026bc8010537b8a19 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:30:47 -0700 Subject: [PATCH 16/39] Add message type for 'ServeToIrsComplteNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 990055dd92d..5923912e974 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -98,6 +98,11 @@ type AdminContactInitialUpdateCompleteNotification = { action: 'admin_contact_initial_update_complete'; }; +type ServeToIrsComplteNotification = { + action: 'serve_to_irs_complete'; + pdfUrl: string; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -113,7 +118,8 @@ type NotificationMessage = | BatchDownloadReadyNotification | AwsBatchDownloadProgressNotification | MessageCompletionSucessNotification - | AdminContactInitialUpdateCompleteNotification; + | AdminContactInitialUpdateCompleteNotification + | ServeToIrsComplteNotification; export const sendNotificationToUser = async ({ applicationContext, From 3c87bf6b895107ad99149ab3ac55de5f4cfb9d9b Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:31:23 -0700 Subject: [PATCH 17/39] Add message type for 'ServeToIrsErrorNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 5923912e974..cba1c11d3da 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -98,11 +98,15 @@ type AdminContactInitialUpdateCompleteNotification = { action: 'admin_contact_initial_update_complete'; }; -type ServeToIrsComplteNotification = { +type ServeToIrsCompleteNotification = { action: 'serve_to_irs_complete'; pdfUrl: string; }; +type ServeToIrsErrorNotification = { + action: 'serve_to_irs_error'; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -119,7 +123,8 @@ type NotificationMessage = | AwsBatchDownloadProgressNotification | MessageCompletionSucessNotification | AdminContactInitialUpdateCompleteNotification - | ServeToIrsComplteNotification; + | ServeToIrsCompleteNotification + | ServeToIrsErrorNotification; export const sendNotificationToUser = async ({ applicationContext, From ea8cc211f826bd08c833181c31526a3de83e4a72 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:32:52 -0700 Subject: [PATCH 18/39] Add message type for 'BatchDownloadDocketGeneratedNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index cba1c11d3da..c506a4b9089 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -107,6 +107,12 @@ type ServeToIrsErrorNotification = { action: 'serve_to_irs_error'; }; +type BatchDownloadDocketGeneratedNotification = { + action: 'batch_download_docket_generated'; + filesCompleted: number; + totalFiles: number; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -124,7 +130,8 @@ type NotificationMessage = | MessageCompletionSucessNotification | AdminContactInitialUpdateCompleteNotification | ServeToIrsCompleteNotification - | ServeToIrsErrorNotification; + | ServeToIrsErrorNotification + | BatchDownloadDocketGeneratedNotification; export const sendNotificationToUser = async ({ applicationContext, From c1bcf1725dd71c01822bfe7ea3513b2485f776f1 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:33:39 -0700 Subject: [PATCH 19/39] Add message type for 'NoticeGenerationUpdatedNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index c506a4b9089..12d123d468a 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -113,6 +113,10 @@ type BatchDownloadDocketGeneratedNotification = { totalFiles: number; }; +type NoticeGenerationUpdatedNotification = { + action: 'notice_generation_updated'; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -131,7 +135,8 @@ type NotificationMessage = | AdminContactInitialUpdateCompleteNotification | ServeToIrsCompleteNotification | ServeToIrsErrorNotification - | BatchDownloadDocketGeneratedNotification; + | BatchDownloadDocketGeneratedNotification + | NoticeGenerationUpdatedNotification; export const sendNotificationToUser = async ({ applicationContext, From 40c8e84deb709d8e597d7d526b95585a0918f2a6 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:34:20 -0700 Subject: [PATCH 20/39] Add message type for 'PaperServiceStartedNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 12d123d468a..b4cf070303a 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -117,6 +117,11 @@ type NoticeGenerationUpdatedNotification = { action: 'notice_generation_updated'; }; +type PaperServiceStartedNotification = { + action: 'paper_service_started'; + totalPdfs: number; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -136,7 +141,8 @@ type NotificationMessage = | ServeToIrsCompleteNotification | ServeToIrsErrorNotification | BatchDownloadDocketGeneratedNotification - | NoticeGenerationUpdatedNotification; + | NoticeGenerationUpdatedNotification + | PaperServiceStartedNotification; export const sendNotificationToUser = async ({ applicationContext, From 6132819efcbc69f1ed79cf22baaf20ec1003e8ab Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:37:52 -0700 Subject: [PATCH 21/39] Add message type for 'PaperServiceUpdatedNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index b4cf070303a..5489bcd9895 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -122,6 +122,11 @@ type PaperServiceStartedNotification = { totalPdfs: number; }; +type PaperServiceUpdatedNotification = { + action: 'paper_service_updated'; + pdfsAppended: number; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -142,7 +147,8 @@ type NotificationMessage = | ServeToIrsErrorNotification | BatchDownloadDocketGeneratedNotification | NoticeGenerationUpdatedNotification - | PaperServiceStartedNotification; + | PaperServiceStartedNotification + | PaperServiceUpdatedNotification; export const sendNotificationToUser = async ({ applicationContext, From cdf2466a02588282275633fc8e73903644be7baa Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:39:18 -0700 Subject: [PATCH 22/39] Add message type for 'SetTrialCalendarPaperServiceCompleteNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 5489bcd9895..2d4c143f02d 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -127,6 +127,13 @@ type PaperServiceUpdatedNotification = { pdfsAppended: number; }; +type SetTrialCalendarPaperServiceCompleteNotification = { + action: 'set_trial_calendar_paper_service_complete'; + fileId: string; + hasPaper: boolean; + pdfUrl: string; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -148,7 +155,8 @@ type NotificationMessage = | BatchDownloadDocketGeneratedNotification | NoticeGenerationUpdatedNotification | PaperServiceStartedNotification - | PaperServiceUpdatedNotification; + | PaperServiceUpdatedNotification + | SetTrialCalendarPaperServiceCompleteNotification; export const sendNotificationToUser = async ({ applicationContext, From fe12318f45a60e5c88207481d503a83af37d7b5f Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:42:00 -0700 Subject: [PATCH 23/39] Add message type for 'ThirtyDayNoticePaperServiceCompleteNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 2d4c143f02d..628d96a5146 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -134,6 +134,13 @@ type SetTrialCalendarPaperServiceCompleteNotification = { pdfUrl: string; }; +type ThirtyDayNoticePaperServiceCompleteNotification = { + action: 'thirty_day_notice_paper_service_complete'; + pdfUrl?: string; + fileId?: string; + hasPaper?: boolean; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -156,7 +163,8 @@ type NotificationMessage = | NoticeGenerationUpdatedNotification | PaperServiceStartedNotification | PaperServiceUpdatedNotification - | SetTrialCalendarPaperServiceCompleteNotification; + | SetTrialCalendarPaperServiceCompleteNotification + | ThirtyDayNoticePaperServiceCompleteNotification; export const sendNotificationToUser = async ({ applicationContext, From 492350f2288e24ec690a49edd835c1748bc69884 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:43:02 -0700 Subject: [PATCH 24/39] Add message type for 'NoticeGenerationCompleteNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 628d96a5146..25a08090a78 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -141,6 +141,13 @@ type ThirtyDayNoticePaperServiceCompleteNotification = { hasPaper?: boolean; }; +type NoticeGenerationCompleteNotification = { + action: 'notice_generation_complete'; + hasPaper: boolean; + trialNoticePdfsKeys: string[]; + trialSessionId: string; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -164,7 +171,8 @@ type NotificationMessage = | PaperServiceStartedNotification | PaperServiceUpdatedNotification | SetTrialCalendarPaperServiceCompleteNotification - | ThirtyDayNoticePaperServiceCompleteNotification; + | ThirtyDayNoticePaperServiceCompleteNotification + | NoticeGenerationCompleteNotification; export const sendNotificationToUser = async ({ applicationContext, From 1ae2e12efff95d84b5ea32970bd46a3f39c73eb4 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:43:36 -0700 Subject: [PATCH 25/39] Add message type for 'NoticeGenerationStartNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 25a08090a78..479aeefcdf7 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -148,6 +148,11 @@ type NoticeGenerationCompleteNotification = { trialSessionId: string; }; +type NoticeGenerationStartNotification = { + action: 'notice_generation_start'; + totalCases: number; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -172,7 +177,8 @@ type NotificationMessage = | PaperServiceUpdatedNotification | SetTrialCalendarPaperServiceCompleteNotification | ThirtyDayNoticePaperServiceCompleteNotification - | NoticeGenerationCompleteNotification; + | NoticeGenerationCompleteNotification + | NoticeGenerationStartNotification; export const sendNotificationToUser = async ({ applicationContext, From 97e21053191085f8244371f994ea258f105993b6 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:46:40 -0700 Subject: [PATCH 26/39] Updated message type for 'NoticeGenerationCompleteNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 479aeefcdf7..c888440911a 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -143,9 +143,9 @@ type ThirtyDayNoticePaperServiceCompleteNotification = { type NoticeGenerationCompleteNotification = { action: 'notice_generation_complete'; - hasPaper: boolean; + hasPaper?: boolean; trialNoticePdfsKeys: string[]; - trialSessionId: string; + trialSessionId?: string; }; type NoticeGenerationStartNotification = { From 99adb145486928f3e6bdee737db7194bc2c41f3d Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:47:32 -0700 Subject: [PATCH 27/39] Add message type for 'SetTrialSessionCalendarCompleteNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index c888440911a..fa520d35f08 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -153,6 +153,11 @@ type NoticeGenerationStartNotification = { totalCases: number; }; +type SetTrialSessionCalendarCompleteNotification = { + action: 'set_trial_session_calendar_complete'; + trialSessionId: string; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -178,7 +183,8 @@ type NotificationMessage = | SetTrialCalendarPaperServiceCompleteNotification | ThirtyDayNoticePaperServiceCompleteNotification | NoticeGenerationCompleteNotification - | NoticeGenerationStartNotification; + | NoticeGenerationStartNotification + | SetTrialSessionCalendarCompleteNotification; export const sendNotificationToUser = async ({ applicationContext, From 8f034bdfe73e8f9cb544652ea8fad1b5a77e612f Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:47:56 -0700 Subject: [PATCH 28/39] Add message type for 'SetTrialSessionCalendarErrorNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index fa520d35f08..2231042841a 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -158,6 +158,11 @@ type SetTrialSessionCalendarCompleteNotification = { trialSessionId: string; }; +type SetTrialSessionCalendarErrorNotification = { + action: 'set_trial_session_calendar_error'; + message: string; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -184,7 +189,8 @@ type NotificationMessage = | ThirtyDayNoticePaperServiceCompleteNotification | NoticeGenerationCompleteNotification | NoticeGenerationStartNotification - | SetTrialSessionCalendarCompleteNotification; + | SetTrialSessionCalendarCompleteNotification + | SetTrialSessionCalendarErrorNotification; export const sendNotificationToUser = async ({ applicationContext, From 58ac7251797f35820bf2a968082e6db6ac03980c Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:49:25 -0700 Subject: [PATCH 29/39] Add message type for 'UpdateTrialSessionCompleteNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 2231042841a..7e271bc3eb3 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -163,6 +163,14 @@ type SetTrialSessionCalendarErrorNotification = { message: string; }; +type UpdateTrialSessionCompleteNotification = { + action: 'update_trial_session_complete'; + fileId?: string; + hasPaper?: boolean; + pdfUrl?: string; + trialSessionId?: string; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -190,7 +198,8 @@ type NotificationMessage = | NoticeGenerationCompleteNotification | NoticeGenerationStartNotification | SetTrialSessionCalendarCompleteNotification - | SetTrialSessionCalendarErrorNotification; + | SetTrialSessionCalendarErrorNotification + | UpdateTrialSessionCompleteNotification; export const sendNotificationToUser = async ({ applicationContext, From f2902dd19d5417ae90ab3d3fc31cbfd43b668c6e Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:50:34 -0700 Subject: [PATCH 30/39] Add message type for 'UserContactInitialUpdateCompleteNotification' --- web-api/src/notifications/sendNotificationToUser.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 7e271bc3eb3..bd194299e84 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -1,5 +1,6 @@ import { RawPractitioner } from '@shared/business/entities/Practitioner'; import { ServerApplicationContext } from '@web-api/applicationContext'; +import { UserRecord } from '@web-api/persistence/dynamo/dynamoTypes'; type MessageCompletionErrorNotification = { action: 'message_completion_error'; @@ -19,7 +20,7 @@ type ContactUpdateCompleteNotification = { action: | 'user_contact_full_update_complete' | 'admin_contact_full_update_complete'; - user?: RawPractitioner; + user?: RawPractitioner | UserRecord; }; type ServeDocumentErrorNotification = { @@ -171,6 +172,10 @@ type UpdateTrialSessionCompleteNotification = { trialSessionId?: string; }; +type UserContactInitialUpdateCompleteNotification = { + action: 'user_contact_initial_update_complete'; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -199,7 +204,8 @@ type NotificationMessage = | NoticeGenerationStartNotification | SetTrialSessionCalendarCompleteNotification | SetTrialSessionCalendarErrorNotification - | UpdateTrialSessionCompleteNotification; + | UpdateTrialSessionCompleteNotification + | UserContactInitialUpdateCompleteNotification; export const sendNotificationToUser = async ({ applicationContext, From fe011511e02151f2315f15e7fda1a24996fa51aa Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:51:11 -0700 Subject: [PATCH 31/39] Add message type for 'UserContactUpdateErrorNotification' --- .husky/pre-commit | 2 -- web-api/src/notifications/sendNotificationToUser.ts | 8 +++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 146cfdbbc7c..e69de29bb2d 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,2 +0,0 @@ -npx lint-staged -circleci config validate diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index bd194299e84..0dd63bdd279 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -176,6 +176,11 @@ type UserContactInitialUpdateCompleteNotification = { action: 'user_contact_initial_update_complete'; }; +type UserContactUpdateErrorNotification = { + action: 'user_contact_update_error'; + error: string; +}; + type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification @@ -205,7 +210,8 @@ type NotificationMessage = | SetTrialSessionCalendarCompleteNotification | SetTrialSessionCalendarErrorNotification | UpdateTrialSessionCompleteNotification - | UserContactInitialUpdateCompleteNotification; + | UserContactInitialUpdateCompleteNotification + | UserContactUpdateErrorNotification; export const sendNotificationToUser = async ({ applicationContext, From 23b389f7c0093877bbb022b5e039129746efe1d5 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 09:53:36 -0700 Subject: [PATCH 32/39] Update test to take in a real message; --- .husky/pre-commit | 2 ++ .../notifications/sendNotificationToUser.test.ts | 13 +++++++++++-- web-api/src/notifications/sendNotificationToUser.ts | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index e69de29bb2d..146cfdbbc7c 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -0,0 +1,2 @@ +npx lint-staged +circleci config validate diff --git a/web-api/src/notifications/sendNotificationToUser.test.ts b/web-api/src/notifications/sendNotificationToUser.test.ts index b6917ffbd7d..8dfe8365679 100644 --- a/web-api/src/notifications/sendNotificationToUser.test.ts +++ b/web-api/src/notifications/sendNotificationToUser.test.ts @@ -1,5 +1,8 @@ +import { + NotificationMessage, + sendNotificationToUser, +} from './sendNotificationToUser'; import { applicationContext } from '../../../shared/src/business/test/createTestApplicationContext'; -import { sendNotificationToUser } from './sendNotificationToUser'; describe('sendNotificationToUser', () => { const connections = [ @@ -28,7 +31,13 @@ describe('sendNotificationToUser', () => { sk: 'sk-04', }, ]; - const mockMessage = 'hello, computer'; + const mockMessage: NotificationMessage = { + action: 'download_csv_file', + csvInfo: { + fileName: 'TEST NAME', + url: 'SOME URL', + }, + }; const send = jest.fn().mockResolvedValue('ok'); diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 0dd63bdd279..7b17cdec22f 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -181,7 +181,7 @@ type UserContactUpdateErrorNotification = { error: string; }; -type NotificationMessage = +export type NotificationMessage = | MessageCompletionErrorNotification | ContactUpdateProgressNotification | ContactUpdateCompleteNotification From 1b839ffe76691268bbee759cc1ac1b3e3e530710 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 10:00:08 -0700 Subject: [PATCH 33/39] Extract types to separate file; --- .../notifications/sendNotificationToUser.ts | 214 +----------------- .../sendNotificationToUserTypes.ts | 213 +++++++++++++++++ 2 files changed, 214 insertions(+), 213 deletions(-) create mode 100644 web-api/src/notifications/sendNotificationToUserTypes.ts diff --git a/web-api/src/notifications/sendNotificationToUser.ts b/web-api/src/notifications/sendNotificationToUser.ts index 7b17cdec22f..46b41218cf6 100644 --- a/web-api/src/notifications/sendNotificationToUser.ts +++ b/web-api/src/notifications/sendNotificationToUser.ts @@ -1,217 +1,5 @@ -import { RawPractitioner } from '@shared/business/entities/Practitioner'; +import { NotificationMessage } from '@web-api/notifications/sendNotificationToUserTypes'; import { ServerApplicationContext } from '@web-api/applicationContext'; -import { UserRecord } from '@web-api/persistence/dynamo/dynamoTypes'; - -type MessageCompletionErrorNotification = { - action: 'message_completion_error'; - alertError: { - message: string; - title: string; - }; -}; - -type ContactUpdateProgressNotification = { - action: 'user_contact_update_progress' | 'admin_contact_update_progress'; - completedCases?: number; - totalCases?: number; -}; - -type ContactUpdateCompleteNotification = { - action: - | 'user_contact_full_update_complete' - | 'admin_contact_full_update_complete'; - user?: RawPractitioner | UserRecord; -}; - -type ServeDocumentErrorNotification = { - action: 'serve_document_error'; - error: string; -}; - -type ServeDocumentCompleteNotification = { - action: 'serve_document_complete'; - alertSuccess: { - message: string; - overwritable: boolean; - }; - generateCoversheet?: boolean; - docketEntryId?: string; - pdfUrl?: string; -}; - -type RetryAsyncRequestNotification = { - action: 'retry_async_request'; - originalRequest: any; - requestToRetry: string; -}; - -type BatchDownloadCsvDataNotification = { - action: 'batch_download_csv_data'; - filesCompleted: number; - totalFiles: number; -}; - -type DownloadCsvFileNotification = { - action: 'download_csv_file'; - csvInfo: { - fileName: string; - url: string; - }; -}; - -type SaveDocketEntryForLaterCompleteNotification = { - action: 'save_docket_entry_for_later_complete'; - alertSuccess: { - message: string; - overwritable: boolean; - }; - docketEntryId: string; -}; - -type BatchDownloadErrorNotification = { - action: 'batch_download_error'; - error: any; -}; - -type BatchDownloadProgressNotification = { - action: 'batch_download_progress'; - filesCompleted: number; - totalFiles: number; -}; - -type BatchDownloadReadyNotification = { - action: 'batch_download_ready'; - url: string; -}; - -type AwsBatchDownloadProgressNotification = { - action: 'aws_batch_download_progress'; - filesCompleted: number; - totalFiles: number; -}; - -type MessageCompletionSucessNotification = { - action: 'message_completion_success'; - completedMessageIds: string[]; -}; - -type AdminContactInitialUpdateCompleteNotification = { - action: 'admin_contact_initial_update_complete'; -}; - -type ServeToIrsCompleteNotification = { - action: 'serve_to_irs_complete'; - pdfUrl: string; -}; - -type ServeToIrsErrorNotification = { - action: 'serve_to_irs_error'; -}; - -type BatchDownloadDocketGeneratedNotification = { - action: 'batch_download_docket_generated'; - filesCompleted: number; - totalFiles: number; -}; - -type NoticeGenerationUpdatedNotification = { - action: 'notice_generation_updated'; -}; - -type PaperServiceStartedNotification = { - action: 'paper_service_started'; - totalPdfs: number; -}; - -type PaperServiceUpdatedNotification = { - action: 'paper_service_updated'; - pdfsAppended: number; -}; - -type SetTrialCalendarPaperServiceCompleteNotification = { - action: 'set_trial_calendar_paper_service_complete'; - fileId: string; - hasPaper: boolean; - pdfUrl: string; -}; - -type ThirtyDayNoticePaperServiceCompleteNotification = { - action: 'thirty_day_notice_paper_service_complete'; - pdfUrl?: string; - fileId?: string; - hasPaper?: boolean; -}; - -type NoticeGenerationCompleteNotification = { - action: 'notice_generation_complete'; - hasPaper?: boolean; - trialNoticePdfsKeys: string[]; - trialSessionId?: string; -}; - -type NoticeGenerationStartNotification = { - action: 'notice_generation_start'; - totalCases: number; -}; - -type SetTrialSessionCalendarCompleteNotification = { - action: 'set_trial_session_calendar_complete'; - trialSessionId: string; -}; - -type SetTrialSessionCalendarErrorNotification = { - action: 'set_trial_session_calendar_error'; - message: string; -}; - -type UpdateTrialSessionCompleteNotification = { - action: 'update_trial_session_complete'; - fileId?: string; - hasPaper?: boolean; - pdfUrl?: string; - trialSessionId?: string; -}; - -type UserContactInitialUpdateCompleteNotification = { - action: 'user_contact_initial_update_complete'; -}; - -type UserContactUpdateErrorNotification = { - action: 'user_contact_update_error'; - error: string; -}; - -export type NotificationMessage = - | MessageCompletionErrorNotification - | ContactUpdateProgressNotification - | ContactUpdateCompleteNotification - | ServeDocumentErrorNotification - | ServeDocumentCompleteNotification - | RetryAsyncRequestNotification - | BatchDownloadCsvDataNotification - | DownloadCsvFileNotification - | SaveDocketEntryForLaterCompleteNotification - | BatchDownloadErrorNotification - | BatchDownloadProgressNotification - | BatchDownloadReadyNotification - | AwsBatchDownloadProgressNotification - | MessageCompletionSucessNotification - | AdminContactInitialUpdateCompleteNotification - | ServeToIrsCompleteNotification - | ServeToIrsErrorNotification - | BatchDownloadDocketGeneratedNotification - | NoticeGenerationUpdatedNotification - | PaperServiceStartedNotification - | PaperServiceUpdatedNotification - | SetTrialCalendarPaperServiceCompleteNotification - | ThirtyDayNoticePaperServiceCompleteNotification - | NoticeGenerationCompleteNotification - | NoticeGenerationStartNotification - | SetTrialSessionCalendarCompleteNotification - | SetTrialSessionCalendarErrorNotification - | UpdateTrialSessionCompleteNotification - | UserContactInitialUpdateCompleteNotification - | UserContactUpdateErrorNotification; export const sendNotificationToUser = async ({ applicationContext, diff --git a/web-api/src/notifications/sendNotificationToUserTypes.ts b/web-api/src/notifications/sendNotificationToUserTypes.ts new file mode 100644 index 00000000000..baaba5d7ad4 --- /dev/null +++ b/web-api/src/notifications/sendNotificationToUserTypes.ts @@ -0,0 +1,213 @@ +import { RawPractitioner } from '@shared/business/entities/Practitioner'; +import { UserRecord } from '@web-api/persistence/dynamo/dynamoTypes'; + +type MessageCompletionErrorNotification = { + action: 'message_completion_error'; + alertError: { + message: string; + title: string; + }; +}; + +type ContactUpdateProgressNotification = { + action: 'user_contact_update_progress' | 'admin_contact_update_progress'; + completedCases?: number; + totalCases?: number; +}; + +type ContactUpdateCompleteNotification = { + action: + | 'user_contact_full_update_complete' + | 'admin_contact_full_update_complete'; + user?: RawPractitioner | UserRecord; +}; + +type ServeDocumentErrorNotification = { + action: 'serve_document_error'; + error: string; +}; + +type ServeDocumentCompleteNotification = { + action: 'serve_document_complete'; + alertSuccess: { + message: string; + overwritable: boolean; + }; + generateCoversheet?: boolean; + docketEntryId?: string; + pdfUrl?: string; +}; + +type RetryAsyncRequestNotification = { + action: 'retry_async_request'; + originalRequest: any; + requestToRetry: string; +}; + +type BatchDownloadCsvDataNotification = { + action: 'batch_download_csv_data'; + filesCompleted: number; + totalFiles: number; +}; + +type DownloadCsvFileNotification = { + action: 'download_csv_file'; + csvInfo: { + fileName: string; + url: string; + }; +}; + +type SaveDocketEntryForLaterCompleteNotification = { + action: 'save_docket_entry_for_later_complete'; + alertSuccess: { + message: string; + overwritable: boolean; + }; + docketEntryId: string; +}; + +type BatchDownloadErrorNotification = { + action: 'batch_download_error'; + error: any; +}; + +type BatchDownloadProgressNotification = { + action: 'batch_download_progress'; + filesCompleted: number; + totalFiles: number; +}; + +type BatchDownloadReadyNotification = { + action: 'batch_download_ready'; + url: string; +}; + +type AwsBatchDownloadProgressNotification = { + action: 'aws_batch_download_progress'; + filesCompleted: number; + totalFiles: number; +}; + +type MessageCompletionSucessNotification = { + action: 'message_completion_success'; + completedMessageIds: string[]; +}; + +type AdminContactInitialUpdateCompleteNotification = { + action: 'admin_contact_initial_update_complete'; +}; + +type ServeToIrsCompleteNotification = { + action: 'serve_to_irs_complete'; + pdfUrl: string; +}; + +type ServeToIrsErrorNotification = { + action: 'serve_to_irs_error'; +}; + +type BatchDownloadDocketGeneratedNotification = { + action: 'batch_download_docket_generated'; + filesCompleted: number; + totalFiles: number; +}; + +type NoticeGenerationUpdatedNotification = { + action: 'notice_generation_updated'; +}; + +type PaperServiceStartedNotification = { + action: 'paper_service_started'; + totalPdfs: number; +}; + +type PaperServiceUpdatedNotification = { + action: 'paper_service_updated'; + pdfsAppended: number; +}; + +type SetTrialCalendarPaperServiceCompleteNotification = { + action: 'set_trial_calendar_paper_service_complete'; + fileId: string; + hasPaper: boolean; + pdfUrl: string; +}; + +type ThirtyDayNoticePaperServiceCompleteNotification = { + action: 'thirty_day_notice_paper_service_complete'; + pdfUrl?: string; + fileId?: string; + hasPaper?: boolean; +}; + +type NoticeGenerationCompleteNotification = { + action: 'notice_generation_complete'; + hasPaper?: boolean; + trialNoticePdfsKeys: string[]; + trialSessionId?: string; +}; + +type NoticeGenerationStartNotification = { + action: 'notice_generation_start'; + totalCases: number; +}; + +type SetTrialSessionCalendarCompleteNotification = { + action: 'set_trial_session_calendar_complete'; + trialSessionId: string; +}; + +type SetTrialSessionCalendarErrorNotification = { + action: 'set_trial_session_calendar_error'; + message: string; +}; + +type UpdateTrialSessionCompleteNotification = { + action: 'update_trial_session_complete'; + fileId?: string; + hasPaper?: boolean; + pdfUrl?: string; + trialSessionId?: string; +}; + +type UserContactInitialUpdateCompleteNotification = { + action: 'user_contact_initial_update_complete'; +}; + +type UserContactUpdateErrorNotification = { + action: 'user_contact_update_error'; + error: string; +}; + +export type NotificationMessage = + | MessageCompletionErrorNotification + | ContactUpdateProgressNotification + | ContactUpdateCompleteNotification + | ServeDocumentErrorNotification + | ServeDocumentCompleteNotification + | RetryAsyncRequestNotification + | BatchDownloadCsvDataNotification + | DownloadCsvFileNotification + | SaveDocketEntryForLaterCompleteNotification + | BatchDownloadErrorNotification + | BatchDownloadProgressNotification + | BatchDownloadReadyNotification + | AwsBatchDownloadProgressNotification + | MessageCompletionSucessNotification + | AdminContactInitialUpdateCompleteNotification + | ServeToIrsCompleteNotification + | ServeToIrsErrorNotification + | BatchDownloadDocketGeneratedNotification + | NoticeGenerationUpdatedNotification + | PaperServiceStartedNotification + | PaperServiceUpdatedNotification + | SetTrialCalendarPaperServiceCompleteNotification + | ThirtyDayNoticePaperServiceCompleteNotification + | NoticeGenerationCompleteNotification + | NoticeGenerationStartNotification + | SetTrialSessionCalendarCompleteNotification + | SetTrialSessionCalendarErrorNotification + | UpdateTrialSessionCompleteNotification + | UserContactInitialUpdateCompleteNotification + | UserContactUpdateErrorNotification; From f95f80662a2ee39c0bbabe01cf125d587a85a4cb Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 10:00:49 -0700 Subject: [PATCH 34/39] Move github actions back to original folder; --- .github/{IGNORE_TEMP => workflows}/api.yml | 0 .github/{IGNORE_TEMP => workflows}/client-integration-public.yml | 0 .github/{IGNORE_TEMP => workflows}/client-integration.yml | 0 .github/{IGNORE_TEMP => workflows}/client.yml | 0 .github/{IGNORE_TEMP => workflows}/e2e-cypress-accessibility.yml | 0 .github/{IGNORE_TEMP => workflows}/e2e-cypress-public.yml | 0 .../{IGNORE_TEMP => workflows}/e2e-cypress-smoketests-local.yml | 0 .github/{IGNORE_TEMP => workflows}/e2e-cypress.yml | 0 .github/{IGNORE_TEMP => workflows}/lint.yml | 0 .github/{IGNORE_TEMP => workflows}/pdfs.yml | 0 .github/{IGNORE_TEMP => workflows}/scripts.yml | 0 .github/{IGNORE_TEMP => workflows}/shared.yml | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename .github/{IGNORE_TEMP => workflows}/api.yml (100%) rename .github/{IGNORE_TEMP => workflows}/client-integration-public.yml (100%) rename .github/{IGNORE_TEMP => workflows}/client-integration.yml (100%) rename .github/{IGNORE_TEMP => workflows}/client.yml (100%) rename .github/{IGNORE_TEMP => workflows}/e2e-cypress-accessibility.yml (100%) rename .github/{IGNORE_TEMP => workflows}/e2e-cypress-public.yml (100%) rename .github/{IGNORE_TEMP => workflows}/e2e-cypress-smoketests-local.yml (100%) rename .github/{IGNORE_TEMP => workflows}/e2e-cypress.yml (100%) rename .github/{IGNORE_TEMP => workflows}/lint.yml (100%) rename .github/{IGNORE_TEMP => workflows}/pdfs.yml (100%) rename .github/{IGNORE_TEMP => workflows}/scripts.yml (100%) rename .github/{IGNORE_TEMP => workflows}/shared.yml (100%) diff --git a/.github/IGNORE_TEMP/api.yml b/.github/workflows/api.yml similarity index 100% rename from .github/IGNORE_TEMP/api.yml rename to .github/workflows/api.yml diff --git a/.github/IGNORE_TEMP/client-integration-public.yml b/.github/workflows/client-integration-public.yml similarity index 100% rename from .github/IGNORE_TEMP/client-integration-public.yml rename to .github/workflows/client-integration-public.yml diff --git a/.github/IGNORE_TEMP/client-integration.yml b/.github/workflows/client-integration.yml similarity index 100% rename from .github/IGNORE_TEMP/client-integration.yml rename to .github/workflows/client-integration.yml diff --git a/.github/IGNORE_TEMP/client.yml b/.github/workflows/client.yml similarity index 100% rename from .github/IGNORE_TEMP/client.yml rename to .github/workflows/client.yml diff --git a/.github/IGNORE_TEMP/e2e-cypress-accessibility.yml b/.github/workflows/e2e-cypress-accessibility.yml similarity index 100% rename from .github/IGNORE_TEMP/e2e-cypress-accessibility.yml rename to .github/workflows/e2e-cypress-accessibility.yml diff --git a/.github/IGNORE_TEMP/e2e-cypress-public.yml b/.github/workflows/e2e-cypress-public.yml similarity index 100% rename from .github/IGNORE_TEMP/e2e-cypress-public.yml rename to .github/workflows/e2e-cypress-public.yml diff --git a/.github/IGNORE_TEMP/e2e-cypress-smoketests-local.yml b/.github/workflows/e2e-cypress-smoketests-local.yml similarity index 100% rename from .github/IGNORE_TEMP/e2e-cypress-smoketests-local.yml rename to .github/workflows/e2e-cypress-smoketests-local.yml diff --git a/.github/IGNORE_TEMP/e2e-cypress.yml b/.github/workflows/e2e-cypress.yml similarity index 100% rename from .github/IGNORE_TEMP/e2e-cypress.yml rename to .github/workflows/e2e-cypress.yml diff --git a/.github/IGNORE_TEMP/lint.yml b/.github/workflows/lint.yml similarity index 100% rename from .github/IGNORE_TEMP/lint.yml rename to .github/workflows/lint.yml diff --git a/.github/IGNORE_TEMP/pdfs.yml b/.github/workflows/pdfs.yml similarity index 100% rename from .github/IGNORE_TEMP/pdfs.yml rename to .github/workflows/pdfs.yml diff --git a/.github/IGNORE_TEMP/scripts.yml b/.github/workflows/scripts.yml similarity index 100% rename from .github/IGNORE_TEMP/scripts.yml rename to .github/workflows/scripts.yml diff --git a/.github/IGNORE_TEMP/shared.yml b/.github/workflows/shared.yml similarity index 100% rename from .github/IGNORE_TEMP/shared.yml rename to .github/workflows/shared.yml From a2ae77a0170f3840b015e913cda35d29c203a4d4 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 10:11:11 -0700 Subject: [PATCH 35/39] Fix import statement; --- web-api/src/notifications/sendNotificationToUser.test.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/web-api/src/notifications/sendNotificationToUser.test.ts b/web-api/src/notifications/sendNotificationToUser.test.ts index 8dfe8365679..dc37732ffa0 100644 --- a/web-api/src/notifications/sendNotificationToUser.test.ts +++ b/web-api/src/notifications/sendNotificationToUser.test.ts @@ -1,8 +1,6 @@ -import { - NotificationMessage, - sendNotificationToUser, -} from './sendNotificationToUser'; +import { NotificationMessage } from '@web-api/notifications/sendNotificationToUserTypes'; import { applicationContext } from '../../../shared/src/business/test/createTestApplicationContext'; +import { sendNotificationToUser } from './sendNotificationToUser'; describe('sendNotificationToUser', () => { const connections = [ From cc70d8a6dd592ff0a86ada031a3aab6028d0e800 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 12:01:32 -0700 Subject: [PATCH 36/39] Add typing to applicationContext; --- .../fileAndServeCourtIssuedDocumentInteractor.ts | 2 +- .../business/useCases/docketEntry/addPaperFilingInteractor.ts | 2 +- .../business/useCases/docketEntry/editPaperFilingInteractor.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web-api/src/business/useCases/courtIssuedDocument/fileAndServeCourtIssuedDocumentInteractor.ts b/web-api/src/business/useCases/courtIssuedDocument/fileAndServeCourtIssuedDocumentInteractor.ts index c0cf84946f3..42470ac99ce 100644 --- a/web-api/src/business/useCases/courtIssuedDocument/fileAndServeCourtIssuedDocumentInteractor.ts +++ b/web-api/src/business/useCases/courtIssuedDocument/fileAndServeCourtIssuedDocumentInteractor.ts @@ -285,7 +285,7 @@ export const determineEntitiesToLock = ( }); export const handleLockError = async ( - applicationContext, + applicationContext: ServerApplicationContext, originalRequest, authorizedUser: UnknownAuthUser, ) => { diff --git a/web-api/src/business/useCases/docketEntry/addPaperFilingInteractor.ts b/web-api/src/business/useCases/docketEntry/addPaperFilingInteractor.ts index cfe1686cbf6..92769553a3f 100644 --- a/web-api/src/business/useCases/docketEntry/addPaperFilingInteractor.ts +++ b/web-api/src/business/useCases/docketEntry/addPaperFilingInteractor.ts @@ -287,7 +287,7 @@ export const determineEntitiesToLock = ( }); export const handleLockError = async ( - applicationContext, + applicationContext: ServerApplicationContext, originalRequest, authorizedUser: UnknownAuthUser, ) => { diff --git a/web-api/src/business/useCases/docketEntry/editPaperFilingInteractor.ts b/web-api/src/business/useCases/docketEntry/editPaperFilingInteractor.ts index 86e1003bd8a..9941f8efc0c 100644 --- a/web-api/src/business/useCases/docketEntry/editPaperFilingInteractor.ts +++ b/web-api/src/business/useCases/docketEntry/editPaperFilingInteractor.ts @@ -538,7 +538,7 @@ export const determineEntitiesToLock = ( }); export const handleLockError = async ( - applicationContext, + applicationContext: ServerApplicationContext, originalRequest, authorizedUser: UnknownAuthUser, ) => { From f16a157dec3290140d46835b7186b90fd38bcefe Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 13:04:47 -0700 Subject: [PATCH 37/39] Add typing to Maintenance Mode; --- web-client/src/providers/socketRouter.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/web-client/src/providers/socketRouter.ts b/web-client/src/providers/socketRouter.ts index 914c75c56ca..2fe79a5de46 100644 --- a/web-client/src/providers/socketRouter.ts +++ b/web-client/src/providers/socketRouter.ts @@ -1,10 +1,25 @@ +import { NotificationMessage } from '@web-api/notifications/sendNotificationToUserTypes'; + /* eslint-disable complexity */ const noop = () => {}; +type MaintenanceModeEngaged = { + action: 'maintenance_mode_engaged'; +}; + +type MaintenanceModeDisengaged = { + action: 'maintenance_mode_disengaged'; +}; + +type SocketRouterNotificationMessage = + | NotificationMessage + | MaintenanceModeEngaged + | MaintenanceModeDisengaged; + export const socketRouter = (app, onMessageCallbackFn?) => { return async event => { const message = JSON.parse(event.data); - const { action } = message; + const { action } = message as SocketRouterNotificationMessage; switch (action) { case 'paper_service_started': From 48ebe54a08ee2867aa247f32143c0f3b503bee52 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Thu, 21 Nov 2024 13:52:01 -0700 Subject: [PATCH 38/39] Fix Typo; --- .../business/useCaseHelper/generateChangeOfAddressHelper.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web-api/src/business/useCaseHelper/generateChangeOfAddressHelper.ts b/web-api/src/business/useCaseHelper/generateChangeOfAddressHelper.ts index 1a313952030..c5dfac6915e 100644 --- a/web-api/src/business/useCaseHelper/generateChangeOfAddressHelper.ts +++ b/web-api/src/business/useCaseHelper/generateChangeOfAddressHelper.ts @@ -143,7 +143,7 @@ export const generateChangeOfAddressHelper = async ({ }); } - const CONTACT_UPDATE_COMPLTET_ACTION: + const CONTACT_UPDATE_COMPLETE_ACTION: | 'user_contact_full_update_complete' | 'admin_contact_full_update_complete' = `${websocketMessagePrefix}_contact_full_update_complete`; @@ -151,7 +151,7 @@ export const generateChangeOfAddressHelper = async ({ await applicationContext.getNotificationGateway().sendNotificationToUser({ applicationContext, message: { - action: CONTACT_UPDATE_COMPLTET_ACTION, + action: CONTACT_UPDATE_COMPLETE_ACTION, user, }, userId: requestUserId || user.userId, From b70f855cef54e046af42c34a0f1ff63a5b835de6 Mon Sep 17 00:00:00 2001 From: John Cruz Date: Fri, 22 Nov 2024 09:36:53 -0700 Subject: [PATCH 39/39] Move socket router message type to same file --- .../notifications/sendNotificationToUserTypes.ts | 13 +++++++++++++ web-client/src/providers/socketRouter.ts | 15 +-------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/web-api/src/notifications/sendNotificationToUserTypes.ts b/web-api/src/notifications/sendNotificationToUserTypes.ts index baaba5d7ad4..128f42ce6b5 100644 --- a/web-api/src/notifications/sendNotificationToUserTypes.ts +++ b/web-api/src/notifications/sendNotificationToUserTypes.ts @@ -211,3 +211,16 @@ export type NotificationMessage = | UpdateTrialSessionCompleteNotification | UserContactInitialUpdateCompleteNotification | UserContactUpdateErrorNotification; + +type MaintenanceModeEngaged = { + action: 'maintenance_mode_engaged'; +}; + +type MaintenanceModeDisengaged = { + action: 'maintenance_mode_disengaged'; +}; + +export type SocketRouterNotificationMessage = + | NotificationMessage + | MaintenanceModeEngaged + | MaintenanceModeDisengaged; diff --git a/web-client/src/providers/socketRouter.ts b/web-client/src/providers/socketRouter.ts index 2fe79a5de46..727bbf19c19 100644 --- a/web-client/src/providers/socketRouter.ts +++ b/web-client/src/providers/socketRouter.ts @@ -1,21 +1,8 @@ -import { NotificationMessage } from '@web-api/notifications/sendNotificationToUserTypes'; +import { SocketRouterNotificationMessage } from '@web-api/notifications/sendNotificationToUserTypes'; /* eslint-disable complexity */ const noop = () => {}; -type MaintenanceModeEngaged = { - action: 'maintenance_mode_engaged'; -}; - -type MaintenanceModeDisengaged = { - action: 'maintenance_mode_disengaged'; -}; - -type SocketRouterNotificationMessage = - | NotificationMessage - | MaintenanceModeEngaged - | MaintenanceModeDisengaged; - export const socketRouter = (app, onMessageCallbackFn?) => { return async event => { const message = JSON.parse(event.data);