From d2024ce4e515344ca19e27d7a514cb0c70c183f7 Mon Sep 17 00:00:00 2001 From: jen Date: Wed, 23 Aug 2023 14:38:47 +0100 Subject: [PATCH] docs, tidy --- .../workers/processListsBeforeAndDuringStart/helpers.ts | 4 ++++ .../migration.sql | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/scheduler/workers/processListsBeforeAndDuringStart/helpers.ts b/src/scheduler/workers/processListsBeforeAndDuringStart/helpers.ts index 7985d0b31..f43d28c06 100644 --- a/src/scheduler/workers/processListsBeforeAndDuringStart/helpers.ts +++ b/src/scheduler/workers/processListsBeforeAndDuringStart/helpers.ts @@ -37,6 +37,10 @@ export function isEmailSentBefore(event: Audit | undefined, reminderType: Remind return false; } +/** + * Determines whether `emailType` should be sent for `annualReviewReference`. + * All annual review audits or events are recorded with the {@link annualReviewReference} or `reference` from `{@link List.jsonData.currentAnnualReview.reference}`. + */ export async function shouldSend( emailType: AnnualReviewProviderEmailType, listItemId: number, diff --git a/src/server/models/db/migrations/20230725094906_add_email_type_columns_to_tables/migration.sql b/src/server/models/db/migrations/20230725094906_add_email_type_columns_to_tables/migration.sql index ff65eec3f..170ff21ad 100644 --- a/src/server/models/db/migrations/20230725094906_add_email_type_columns_to_tables/migration.sql +++ b/src/server/models/db/migrations/20230725094906_add_email_type_columns_to_tables/migration.sql @@ -41,7 +41,7 @@ select cast("jsonData"->>'itemId' as int) "itemId", jsonb_build_object( 'itemId', "jsonData"->'itemId', 'reference', "jsonData"->'annualReviewRef', - 'annualReviewRef', "jsonData"->'annualReviewRef' + 'annualReviewRef', "jsonData"->'annualReviewRef', 'eventName', "jsonData"->'eventName', 'reminderType', "jsonData"->'reminderType', ),