From 2c0c871c78e6e4701851da556e346efdd7a20f46 Mon Sep 17 00:00:00 2001 From: akikrahman1 <149579836+akikrahman1@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:54:42 +0100 Subject: [PATCH 1/6] Hotfix/jm 7928 (#761) * Updated made on call a required field. (#755) * Confirm attendance list is taking into account confirmed but returned trial attendances. This should only show the unconfirmed count. (#753) * Added restrictions to confirm attendance so prevent attendances from being confirmed multiple times. * Fixed tests * History stating jury attendance confirmed when return but do not confirm was selected (#752) * Fixed issue where jury attendance history would get created if you returned the panel but did not confirm attendance * Fixed tests * Added additional scheduler metrics (#575) * Added additional scheduler metrics * Added additional scheduler metrics * Added null or blank check when checking if an email / phone number exists * Minor tidy up * Fixed compile issue * Added validating in for invalid phone numbers or email addresses * Applied review comments * hotfix/JM-8102 fix for missing days (#756) * hotfix/JM-8102 fix for missing days * updated flyway migration name to avoid conflict * hotfix/JM-7928 update to utilisation report query --------- Co-authored-by: Ben Edwards <147524406+Ben-Edwards-cgi@users.noreply.github.com> --- build.gradle | 2 +- .../CompleteServiceControllerITest.java | 6 +- .../JurorManagementControllerITest.java | 8 +- .../controller/ManagePoolControllerITest.java | 2 +- .../moj/controller/TrialControllerITest.java | 4 +- ...leteServiceController_InitPoolsAtCourt.sql | 24 +-- ...agementController_poolsAtCourtLocation.sql | 22 +-- .../JurorPaperResponse_initPaperResponse.sql | 2 +- ...orRecordController_bureauDigitalDetail.sql | 2 +- ...estPoolController_poolsAtCourtLocation.sql | 40 ++--- .../UpdateAttendanceDetails.sql | 6 +- ...ontroller_initInformationRequestLetter.sql | 14 +- .../db/mod/reports/AbsencesReportITest.sql | 12 +- .../DailyUtilisationReportsITest_typical.sql | 68 ++++---- .../IncompleteServiceReportITest_typical.sql | 10 +- .../reports/JurySummoningMonitor_typical.sql | 86 +++++----- ...sonAttendingSummaryReportITest_typical.sql | 10 +- .../YieldPerformanceReportITest_typical.sql | 104 ++++++------ .../JurorCommsCronBatchController.java | 9 +- .../scheduler/BureauBatchScheduler.java | 13 +- .../scheduler/UrgentStatusScheduler.java | 9 +- .../service/JurorCommsLetterServiceImpl.java | 49 ++---- .../JurorCommsSentToCourtServiceImpl.java | 119 +++++++------ .../JurorCommsWeeklyInfoServiceImpl.java | 43 ++--- .../JurorDashboardSmartSurveyImportImpl.java | 58 +++---- .../api/juror/notify/NotifyAdapterImpl.java | 9 - ...ExcusedCompletedCourtCommsServiceImpl.java | 159 ++++++++++-------- .../juror/service/MessagesServiceImpl.java | 53 ++++-- .../hmcts/juror/api/moj/domain/JurorPool.java | 2 +- .../repository/IAppearanceRepositoryImpl.java | 21 +-- .../moj/service/JurorRecordServiceImpl.java | 5 +- .../moj/service/trial/TrialServiceImpl.java | 8 +- .../hmcts/juror/api/moj/utils/NotifyUtil.java | 28 +++ .../db/migrationv2/V2_29__on_call_updates.sql | 7 + .../migrationv2/V2_30__util_report_update.sql | 23 +++ .../migrationv2/V2_31__util_report_update.sql | 38 +++++ .../moj/service/JurorRecordServiceTest.java | 4 +- .../service/trial/TrialServiceImplTest.java | 2 +- 38 files changed, 596 insertions(+), 485 deletions(-) create mode 100644 src/main/java/uk/gov/hmcts/juror/api/moj/utils/NotifyUtil.java create mode 100644 src/main/resources/db/migrationv2/V2_29__on_call_updates.sql create mode 100644 src/main/resources/db/migrationv2/V2_30__util_report_update.sql create mode 100644 src/main/resources/db/migrationv2/V2_31__util_report_update.sql diff --git a/build.gradle b/build.gradle index 3d60d8c5f..10419590e 100644 --- a/build.gradle +++ b/build.gradle @@ -287,7 +287,7 @@ pmdTest { maxFailures = 292 } pmdMain { - maxFailures = 763 + maxFailures = 752 } pmd { maxFailures = 0 diff --git a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/CompleteServiceControllerITest.java b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/CompleteServiceControllerITest.java index 7477b394b..e2d10c736 100644 --- a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/CompleteServiceControllerITest.java +++ b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/CompleteServiceControllerITest.java @@ -43,6 +43,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -74,8 +75,7 @@ private void validateJurorWasCompleted(LocalDate completionTime, String jurorNum JurorPool jurorPool = jurorPoolRepository.findByJurorJurorNumberAndPoolPoolNumber(jurorNumber, poolNumber); assertEquals(true, jurorPool.getIsActive(), "Juror pool should be active"); - assertEquals(false, jurorPool.getOnCall(), - "Juror pool should not be on call"); + assertFalse(jurorPool.isOnCall(), "Juror pool should not be on call"); assertEquals(IJurorStatus.COMPLETED, jurorPool.getStatus().getStatus(), "Juror pool status should be completed"); Juror juror = jurorPool.getJuror(); @@ -85,7 +85,7 @@ private void validateJurorWasCompleted(LocalDate completionTime, String jurorNum if (isDismissal) { assertThat(jurorPool.getNextDate()).isNull(); - assertThat(jurorPool.getOnCall()).isFalse(); + assertThat(jurorPool.isOnCall()).isFalse(); } List jurorHistories = jurorHistoryRepository.findByJurorNumberOrderById(jurorNumber); assertEquals(1, jurorHistories.size(), "Should only be one history entry"); diff --git a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/JurorManagementControllerITest.java b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/JurorManagementControllerITest.java index 065df049d..9924f413f 100644 --- a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/JurorManagementControllerITest.java +++ b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/JurorManagementControllerITest.java @@ -607,7 +607,7 @@ void updateAttendanceCheckOutAllJurors() { AttendanceDetailsResponse.Summary summary = response.getBody().getSummary(); assertThat(summary) .extracting(AttendanceDetailsResponse.Summary::getCheckedOut) - .isEqualTo(3L); + .isEqualTo(5L); assertThat(summary) .extracting(AttendanceDetailsResponse.Summary::getPanelled) @@ -1032,7 +1032,7 @@ void updateAttendanceNoShow() { AttendanceDetailsResponse.Summary summary = response.getBody().getSummary(); assertThat(summary) .extracting(AttendanceDetailsResponse.Summary::getCheckedIn) - .isEqualTo(4L); + .isEqualTo(5L); assertThat(summary) .extracting(AttendanceDetailsResponse.Summary::getAbsent) @@ -1282,7 +1282,7 @@ void updateAttendanceDateOnCallFlagUpdated() { // check the on-call flag before invoking the api Boolean onCallFlagBefore = - jurorPoolRepository.findByJurorJurorNumberAndPoolPoolNumber(JUROR6, POOL_NUMBER_415230101).getOnCall(); + jurorPoolRepository.findByJurorJurorNumberAndPoolPoolNumber(JUROR6, POOL_NUMBER_415230101).isOnCall(); assertThat(onCallFlagBefore).as("On-call flag should be True").isEqualTo(Boolean.TRUE); ResponseEntity responseEntity = @@ -1296,7 +1296,7 @@ void updateAttendanceDateOnCallFlagUpdated() { // verify the on-call flag was updated successfully Boolean onCallFlagAfter = - jurorPoolRepository.findByJurorJurorNumberAndPoolPoolNumber(JUROR6, POOL_NUMBER_415230101).getOnCall(); + jurorPoolRepository.findByJurorJurorNumberAndPoolPoolNumber(JUROR6, POOL_NUMBER_415230101).isOnCall(); assertThat(onCallFlagAfter).as("On-call flag should be False").isEqualTo(Boolean.FALSE); } diff --git a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/ManagePoolControllerITest.java b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/ManagePoolControllerITest.java index 4b14b9255..75aba4561 100644 --- a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/ManagePoolControllerITest.java +++ b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/ManagePoolControllerITest.java @@ -2147,7 +2147,7 @@ private void transferJurorPoolValidateNewlyCreatedJurorPool(String jurorNumber, assertThat(targetJurorPool.getEditTag()) .as(EXPECT_PROPERTY_TO_BE_USE_A_DEFAULT_VALUE) .isNull(); - assertThat(targetJurorPool.getOnCall()) + assertThat(targetJurorPool.isOnCall()) .as(EXPECT_PROPERTY_TO_BE_USE_A_DEFAULT_VALUE) .isFalse(); assertThat(targetJurorPool.getSmartCard()) diff --git a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/TrialControllerITest.java b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/TrialControllerITest.java index be3ee9a23..4fd238027 100644 --- a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/TrialControllerITest.java +++ b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/TrialControllerITest.java @@ -800,8 +800,8 @@ void testReturnJuryNoConfirmAttendance() { "Expect status to be Responded").isEqualTo(IJurorStatus.RESPONDED); assertThat( jurorHistoryRepository.findByJurorNumberOrderById(panel.getJurorNumber()).size()) - .as("Expect two history item for juror " + panel.getJurorNumber()) - .isEqualTo(2); + .as("Expect one history item for juror " + panel.getJurorNumber()) + .isEqualTo(1); Appearance appearance = appearanceRepository.findByLocCodeAndJurorNumberAndAttendanceDate("415", panel.getJurorNumber(), diff --git a/src/integration-test/resources/db/CompleteServiceController_InitPoolsAtCourt.sql b/src/integration-test/resources/db/CompleteServiceController_InitPoolsAtCourt.sql index 6b710503e..1195d3d14 100644 --- a/src/integration-test/resources/db/CompleteServiceController_InitPoolsAtCourt.sql +++ b/src/integration-test/resources/db/CompleteServiceController_InitPoolsAtCourt.sql @@ -105,18 +105,18 @@ INSERT INTO juror_mod.juror (juror_number, last_name, first_name, dob, address_l ('641800002', 'PERSON', 'TEST', '1990-05-16', '542 STREET NAME', 'ANYTOWN', 'CH1 2AN', true, null), ('641800003', 'PERSON', 'TEST', '1990-05-16', '542 STREET NAME', 'ANYTOWN', 'CH1 2AN', true, '2023-10-24'); -INSERT INTO juror_mod.juror_pool (owner, juror_number, pool_number, is_active, next_date, status, on_call) VALUES -('400', '641600001', '416230101', true, '2023-01-23', 2, null), -('416', '641600002', '416230103', true, '2023-01-23', 13, null), -('417', '641700001', '417230101', true, '2023-01-09', 13, null), -('417', '641700002', '417230101', true, '2023-01-09', 7, null), -('417', '641700003', '417230101', true, '2023-01-09', 2, null), -('417', '641700004', '417230101', true, '2023-01-09', 2, true), -('417', '641700005', '417230101', true, '2023-01-09', 4, null), -('417', '641700006', '417230101', true, '2023-01-09', 2, null), -('418', '641800001', '418230101', true, '2023-10-25', 2, null), -('418', '641800002', '418230102', true, '2023-10-23', 2, null), -('418', '641800003', '418230103', true, '2023-10-23', 13, null); +INSERT INTO juror_mod.juror_pool (owner, juror_number, pool_number, is_active, next_date, status) VALUES +('400', '641600001', '416230101', true, '2023-01-23', 2), +('416', '641600002', '416230103', true, '2023-01-23', 13), +('417', '641700001', '417230101', true, '2023-01-09', 13), +('417', '641700002', '417230101', true, '2023-01-09', 7), +('417', '641700003', '417230101', true, '2023-01-09', 2), +('417', '641700004', '417230101', true, '2023-01-09', 2), +('417', '641700005', '417230101', true, '2023-01-09', 4), +('417', '641700006', '417230101', true, '2023-01-09', 2), +('418', '641800001', '418230101', true, '2023-10-25', 2), +('418', '641800002', '418230102', true, '2023-10-23', 2), +('418', '641800003', '418230103', true, '2023-10-23', 13); INSERT INTO juror_mod.appearance (attendance_date,juror_number,pool_number,loc_code,f_audit,time_in,time_out,travel_time,appearance_stage,non_attendance) VALUES diff --git a/src/integration-test/resources/db/JurorManagementController_poolsAtCourtLocation.sql b/src/integration-test/resources/db/JurorManagementController_poolsAtCourtLocation.sql index 42acc10dd..a48472d56 100644 --- a/src/integration-test/resources/db/JurorManagementController_poolsAtCourtLocation.sql +++ b/src/integration-test/resources/db/JurorManagementController_poolsAtCourtLocation.sql @@ -112,18 +112,18 @@ INSERT INTO juror_mod.juror (juror_number, last_name, first_name, dob, address_l ('641800003', 'PERSON', 'TEST', '1990-05-16', '542 STREET NAME', 'ANYTOWN', 'CH1 2AN', true, '2023-10-24'); INSERT INTO juror_mod.juror_pool (owner, juror_number, pool_number, is_active, next_date, status, on_call) VALUES -('400', '641600001', '416230101', true, '2023-01-23', 2, null), -('416', '641600002', '416230103', true, '2023-01-23', 13, null), -('415', '641500001', '415230101', true, current_date - 10, 13, null), -('415', '641500002', '415230101', true, current_date - 10, 7, null), -('415', '641500003', '415230101', true, current_date - 10, 2, null), +('400', '641600001', '416230101', true, '2023-01-23', 2, false), +('416', '641600002', '416230103', true, '2023-01-23', 13, false), +('415', '641500001', '415230101', true, current_date - 10, 13, false), +('415', '641500002', '415230101', true, current_date - 10, 7, false), +('415', '641500003', '415230101', true, current_date - 10, 2, false), ('415', '641500004', '415230101', true, current_date - 10, 2, true), -('415', '641500005', '415230101', true, current_date - 10, 4, null), -('415', '641500006', '415230101', true, current_date - 10, 2, null), -('415', '641500007', '415230101', true, current_date - 10, 2, null), -('418', '641800001', '418230101', true, '2023-10-25', 2, null), -('418', '641800002', '418230102', true, '2023-10-23', 2, null), -('418', '641800003', '418230103', true, '2023-10-23', 13, null); +('415', '641500005', '415230101', true, current_date - 10, 4, false), +('415', '641500006', '415230101', true, current_date - 10, 2, false), +('415', '641500007', '415230101', true, current_date - 10, 2, false), +('418', '641800001', '418230101', true, '2023-10-25', 2, false), +('418', '641800002', '418230102', true, '2023-10-23', 2, false), +('418', '641800003', '418230103', true, '2023-10-23', 13, false); INSERT INTO juror_mod.appearance (attendance_date,juror_number,pool_number,loc_code,f_audit,time_in,time_out,travel_time,appearance_stage,non_attendance) VALUES (current_date,'641500003','415230101','415',123456789,'09:30:00',null,'01:12','CHECKED_IN',false); diff --git a/src/integration-test/resources/db/JurorPaperResponse_initPaperResponse.sql b/src/integration-test/resources/db/JurorPaperResponse_initPaperResponse.sql index 2ddb8b748..15d913dd8 100644 --- a/src/integration-test/resources/db/JurorPaperResponse_initPaperResponse.sql +++ b/src/integration-test/resources/db/JurorPaperResponse_initPaperResponse.sql @@ -50,7 +50,7 @@ VALUES ('415', '111111111', '415220502', true, CURRENT_DATE + interval '6 weeks' ('400', '121314151', '415220502', true, CURRENT_DATE + interval '6 weeks', 2); INSERT INTO juror_mod.juror_pool(juror_number, pool_number, "owner", user_edtq, is_active, status, times_sel, def_date, "location", no_attendances, no_attended, no_fta, no_awol, pool_seq, edit_tag, next_date, on_call, smart_card, was_deferred, deferral_code, id_checked, postpone, paid_cash, scan_code, last_update, reminder_sent, transfer_date, date_created) VALUES -('641500001', '415240601', '415', 'court-southwark', true, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0002', NULL, '2024-06-11', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-09 15:07:32.570', NULL, NULL, '2024-04-09 15:06:58.069'); +('641500001', '415240601', '415', 'court-southwark', true, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0002', NULL, '2024-06-11', false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-09 15:07:32.570', NULL, NULL, '2024-04-09 15:06:58.069'); INSERT INTO juror_mod.juror_pool(juror_number, pool_number, "owner", user_edtq, is_active, status, times_sel, def_date, "location", no_attendances, no_attended, no_fta, no_awol, pool_seq, edit_tag, next_date, on_call, smart_card, was_deferred, deferral_code, id_checked, postpone, paid_cash, scan_code, last_update, reminder_sent, transfer_date, date_created) VALUES ('641500001', '471240401', '471', 'court-southwark', true, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0001', NULL, '2024-04-29', false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-09 15:12:48.674', NULL, NULL, '2024-04-09 15:12:48.674'); diff --git a/src/integration-test/resources/db/JurorRecordController_bureauDigitalDetail.sql b/src/integration-test/resources/db/JurorRecordController_bureauDigitalDetail.sql index f896adb92..1498d7fbb 100644 --- a/src/integration-test/resources/db/JurorRecordController_bureauDigitalDetail.sql +++ b/src/integration-test/resources/db/JurorRecordController_bureauDigitalDetail.sql @@ -56,7 +56,7 @@ INSERT INTO juror_mod.juror_pool (owner, juror_number, pool_number, is_active, n ('400', '555555555', '457230801', true, '2022-05-03', 2); INSERT INTO juror_mod.juror_pool(juror_number, pool_number, "owner", user_edtq, is_active, status, times_sel, def_date, "location", no_attendances, no_attended, no_fta, no_awol, pool_seq, edit_tag, next_date, on_call, smart_card, was_deferred, deferral_code, id_checked, postpone, paid_cash, scan_code, last_update, reminder_sent, transfer_date, date_created) VALUES -('641500001', '415240601', '415', 'court-southwark', true, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0002', NULL, '2024-06-11', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-09 15:07:32.570', NULL, NULL, '2024-04-09 15:06:58.069'); +('641500001', '415240601', '415', 'court-southwark', true, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0002', NULL, '2024-06-11', false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-09 15:07:32.570', NULL, NULL, '2024-04-09 15:06:58.069'); INSERT INTO juror_mod.juror_pool(juror_number, pool_number, "owner", user_edtq, is_active, status, times_sel, def_date, "location", no_attendances, no_attended, no_fta, no_awol, pool_seq, edit_tag, next_date, on_call, smart_card, was_deferred, deferral_code, id_checked, postpone, paid_cash, scan_code, last_update, reminder_sent, transfer_date, date_created) VALUES ('641500001', '471240401', '471', 'court-southwark', true, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0001', NULL, '2024-04-29', false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-09 15:12:48.674', NULL, NULL, '2024-04-09 15:12:48.674'); diff --git a/src/integration-test/resources/db/RequestPoolController_poolsAtCourtLocation.sql b/src/integration-test/resources/db/RequestPoolController_poolsAtCourtLocation.sql index 8ed90e210..48fbae21e 100644 --- a/src/integration-test/resources/db/RequestPoolController_poolsAtCourtLocation.sql +++ b/src/integration-test/resources/db/RequestPoolController_poolsAtCourtLocation.sql @@ -98,27 +98,27 @@ INSERT INTO juror_mod.juror (juror_number, last_name, first_name, dob, address_l ('641900001', 'PERSON1', 'TEST', '1990-05-16', '542 STREET NAME', 'ANYTOWN', 'CH1 2AN', true, null); INSERT INTO juror_mod.juror_pool (owner, juror_number, pool_number, is_active, next_date, status, on_call) VALUES -('400', '641600001', '416230101', true, '2023-01-23', 2, null), -('416', '641600002', '416230103', true, '2023-01-23', 13, null), -('417', '641700001', '417230101', true, '2023-01-09', 13, null), -('417', '641700002', '417230101', true, '2023-01-09', 7, null), -('417', '641700003', '417230101', true, '2023-01-09', 2, null), +('400', '641600001', '416230101', true, '2023-01-23', 2, false), +('416', '641600002', '416230103', true, '2023-01-23', 13, false), +('417', '641700001', '417230101', true, '2023-01-09', 13, false), +('417', '641700002', '417230101', true, '2023-01-09', 7, false), +('417', '641700003', '417230101', true, '2023-01-09', 2, false), ('417', '641700004', '417230101', true, '2023-01-09', 2, true), -('417', '641700005', '417230101', true, '2023-01-09', 4, null), -('417', '641700006', '417230101', true, '2023-01-09', 2, null), -('417', '641700007', '417230101', true, '2023-01-09', 2, null), -('417', '641700008', '417230101', true, '2023-01-09', 2, null), -('417', '641700009', '417230101', true, '2023-01-09', 3, null), -('417', '641700010', '417230101', true, '2023-01-09', 3, null), -('417', '641700011', '417230101', true, '2023-01-09', 4, null), -('417', '641700012', '417230101', true, '2023-01-09', 4, null), -('417', '641700013', '417230101', true, '2023-01-09', 4, null), -('417', '641700014', '417230101', true, '2023-01-09', 3, null), -('418', '641800001', '418230101', true, '2023-10-25', 2, null), -('418', '641800002', '418230102', true, '2023-10-23', 2, null), -('418', '641800003', '418230103', true, '2023-10-23', 2, null), -('418', '641800004', '418230102', true, '2023-10-23', 3, null), -('418', '641800005', '418230103', true, '2023-10-23', 4, null), +('417', '641700005', '417230101', true, '2023-01-09', 4, false), +('417', '641700006', '417230101', true, '2023-01-09', 2, false), +('417', '641700007', '417230101', true, '2023-01-09', 2, false), +('417', '641700008', '417230101', true, '2023-01-09', 2, false), +('417', '641700009', '417230101', true, '2023-01-09', 3, false), +('417', '641700010', '417230101', true, '2023-01-09', 3, false), +('417', '641700011', '417230101', true, '2023-01-09', 4, false), +('417', '641700012', '417230101', true, '2023-01-09', 4, false), +('417', '641700013', '417230101', true, '2023-01-09', 4, false), +('417', '641700014', '417230101', true, '2023-01-09', 3, false), +('418', '641800001', '418230101', true, '2023-10-25', 2, false), +('418', '641800002', '418230102', true, '2023-10-23', 2, false), +('418', '641800003', '418230103', true, '2023-10-23', 2, false), +('418', '641800004', '418230102', true, '2023-10-23', 3, false), +('418', '641800005', '418230103', true, '2023-10-23', 4, false), ('419', '641900001', '419230101', true, '2023-10-23', 2, true); INSERT INTO juror_mod.appearance (attendance_date,juror_number,pool_number,loc_code,f_audit,time_in,time_out,travel_time,appearance_stage,non_attendance) VALUES diff --git a/src/integration-test/resources/db/jurormanagement/UpdateAttendanceDetails.sql b/src/integration-test/resources/db/jurormanagement/UpdateAttendanceDetails.sql index d1b96e63d..c04625dd0 100644 --- a/src/integration-test/resources/db/jurormanagement/UpdateAttendanceDetails.sql +++ b/src/integration-test/resources/db/jurormanagement/UpdateAttendanceDetails.sql @@ -31,10 +31,10 @@ insert into juror_mod.juror_pool (owner, juror_number, pool_number, next_date, d --JUROR_MOD.APPEARANCE insert into juror_mod.appearance (attendance_date,juror_number,loc_code,time_in,time_out,non_attendance,appearance_stage,attendance_type) values -(current_date - interval '1 day','111111111','415','09:31:00',null,false,null,'FULL_DAY'), -(current_date - interval '2 days','111111111','415','09:30:00',null,false,null,'FULL_DAY'), +(current_date - interval '1 day','111111111','415','09:31:00',null,false,'CHECKED_IN','FULL_DAY'), +(current_date - interval '2 days','111111111','415','09:30:00',null,false,'CHECKED_IN','FULL_DAY'), (current_date - interval '2 days','222222222','415','09:30:00',null,false,'CHECKED_IN','FULL_DAY'), (current_date - interval '2 days','333333333','415','09:30:00',null,false,'CHECKED_IN','FULL_DAY'), -(current_date - interval '2 days','555555555','415',null,null,false,null,'FULL_DAY'), +(current_date - interval '2 days','555555555','415','06:30:00',null,false,'CHECKED_IN','FULL_DAY'), (current_date - interval '2 days','666666666','415','09:30:00',null,false,'CHECKED_IN','FULL_DAY'), (current_date - interval '2 days','777777777','415','15:53','12:30',false,'CHECKED_IN','FULL_DAY'); \ No newline at end of file diff --git a/src/integration-test/resources/db/letter/LetterController_initInformationRequestLetter.sql b/src/integration-test/resources/db/letter/LetterController_initInformationRequestLetter.sql index 0bffccdea..8705226aa 100644 --- a/src/integration-test/resources/db/letter/LetterController_initInformationRequestLetter.sql +++ b/src/integration-test/resources/db/letter/LetterController_initInformationRequestLetter.sql @@ -21,13 +21,13 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name ('641500216','216',NULL,'LNAMEONESIXT','FNAMEONESIX',NULL,'16 STREET NAME','ANYTOWN',NULL,NULL,NULL,'CH1 2AN',NULL,NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,'NOT_CHECKED','2024-06-11 13:57:15',NULL,NULL,NULL,NULL,0,'2024-06-03 15:33:11.314842',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false,NULL); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500017','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0015',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:14:27.130294',true,NULL,'2024-06-03 12:00:23.127317'), - ('641500212','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0019',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.348805',NULL,NULL,'2024-06-03 15:33:11.348805'), - ('641500211','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0023',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.357346',NULL,NULL,'2024-06-03 15:33:11.357346'), - ('641500216','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0025',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.361174',NULL,NULL,'2024-06-03 15:33:11.361174'), - ('641500316','415240801','400','ADMINUSER',true,2,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',true,NULL,'2024-06-03 12:00:23.10279'), - ('641500316','415240804','400','ADMINUSER',false,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'), - ('641500223','415240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0020',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-11 13:55:51.432707',true,NULL,'2024-06-03 15:33:11.351721'); + ('641500017','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0015',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:14:27.130294',true,NULL,'2024-06-03 12:00:23.127317'), + ('641500212','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0019',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.348805',NULL,NULL,'2024-06-03 15:33:11.348805'), + ('641500211','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0023',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.357346',NULL,NULL,'2024-06-03 15:33:11.357346'), + ('641500216','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0025',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.361174',NULL,NULL,'2024-06-03 15:33:11.361174'), + ('641500316','415240801','400','ADMINUSER',true,2,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',true,NULL,'2024-06-03 12:00:23.10279'), + ('641500316','415240804','400','ADMINUSER',false,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'), + ('641500223','415240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0020',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-11 13:55:51.432707',true,NULL,'2024-06-03 15:33:11.351721'); INSERT INTO juror_mod.bulk_print_data (juror_no,creation_date,form_type,detail_rec,extracted_flag,digital_comms) VALUES ('641500017',current_date - 1,'5227','14 JUNE 2024 THE CROWN COURT AT CHESTER JURY CENTRAL SUMMONING BUREAU THE COURT SERVICE FREEPOST LON 19669 POCOCK STREET LONDON SE1 0YG 0845 3555567 PART 2 SECTION D FNAMEONESEVEN LNAMEONESEVEN 17 STREET NAME ANYTOWN CH3 2AR 641500017JURY MANAGER ',false,false), diff --git a/src/integration-test/resources/db/mod/reports/AbsencesReportITest.sql b/src/integration-test/resources/db/mod/reports/AbsencesReportITest.sql index 40d333fd1..190c7f8c5 100644 --- a/src/integration-test/resources/db/mod/reports/AbsencesReportITest.sql +++ b/src/integration-test/resources/db/mod/reports/AbsencesReportITest.sql @@ -19,17 +19,17 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name -- create juror_pool associative records INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES ('641500021','415240601','415','MODTESTBUREAU',true,4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL, - current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.702989',NULL,NULL,'2024-04-22 12:26:40.702987'), + current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.702989',NULL,NULL,'2024-04-22 12:26:40.702987'), ('641500011','415240601','415','MODTESTBUREAU',true,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL, - current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.757378',NULL,NULL,'2024-04-22 12:26:40.757376'), + current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.757378',NULL,NULL,'2024-04-22 12:26:40.757376'), ('641500003','415240601','415','MODTESTCOURT',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL, - current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), + current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), ('641500009','415240602','415','MODTESTCOURT',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL, - current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), + current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), ('641500004','417240601','417','MODTESTCOURT',true,1,NULL,current_date+30,NULL,NULL,NULL,NULL,NULL,'0004',NULL, - current_date+2,NULL,NULL,NULL,'DC',NULL,NULL,NULL,NULL,'2024-04-22 12:30:25.628652',NULL,NULL,'2024-04-22 12:26:40.819485'), + current_date+2,false,NULL,NULL,'DC',NULL,NULL,NULL,NULL,'2024-04-22 12:30:25.628652',NULL,NULL,'2024-04-22 12:26:40.819485'), ('641500007','415240601','415','MODTESTCOURT',true,4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL, - current_date+2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 15:14:10.871528',NULL,NULL,'2024-04-22 12:26:40.848865'); + current_date+2,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 15:14:10.871528',NULL,NULL,'2024-04-22 12:26:40.848865'); INSERT INTO juror_mod.appearance (attendance_date,juror_number,pool_number,loc_code,f_audit,time_in,time_out,travel_time,appearance_stage,non_attendance,no_show,attendance_type) VALUES diff --git a/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql b/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql index 30dfb012b..a8c1b2577 100644 --- a/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql +++ b/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql @@ -43,41 +43,43 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name ('415000029',NULL,NULL,'LNAME29','FNAME29',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), ('415000030',NULL,NULL,'LNAME30','FNAME30',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), ('415000031',NULL,NULL,'LNAME31','FNAME31',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), - ('415000032',NULL,NULL,'LNAME32','FNAME32',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false); + ('415000032',NULL,NULL,'LNAME32','FNAME32',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), + ('415000033',NULL,NULL,'LNAME33','FNAME33',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), + ('415000034',NULL,NULL,'LNAME34','FNAME34',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false); -INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('415000001','415231101','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000002','415231101','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000003','415231101','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000004','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000005','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000006','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000007','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000008','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000009','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000010','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000011','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000012','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000013','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000014','415231104','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000015','415231104','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000016','415231104','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000017','415231104','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000018','415231104','415',NULL,true,1,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000020','415231105','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000021','415231105','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000022','415231106','415',NULL,true,2,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000023','415231106','415',NULL,true,2,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000024','415231105','415',NULL,true,5,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000025','415231105','415',NULL,true,6,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000026','415231106','415',NULL,true,7,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000027','415231106','415',NULL,true,8,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000028','415231106','415',NULL,true,9,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000029','415231106','415',NULL,true,10,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000030','415231106','415',NULL,true,11,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000031','415231106','415',NULL,true,12,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000032','415231106','415',NULL,true,13,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location") VALUES + ('415000001','415231101','415',NULL,true,3,NULL,NULL,'415'), + ('415000002','415231101','415',NULL,true,3,NULL,NULL,'415'), + ('415000003','415231101','415',NULL,true,3,NULL,NULL,'415'), + ('415000004','415231102','415',NULL,true,3,NULL,NULL,'415'), + ('415000005','415231102','415',NULL,true,3,NULL,NULL,'415'), + ('415000006','415231102','415',NULL,true,3,NULL,NULL,'415'), + ('415000007','415231102','415',NULL,true,3,NULL,NULL,'415'), + ('415000008','415231102','415',NULL,true,3,NULL,NULL,'415'), + ('415000009','415231103','415',NULL,true,3,NULL,NULL,'415'), + ('415000010','415231103','415',NULL,true,3,NULL,NULL,'415'), + ('415000011','415231103','415',NULL,true,3,NULL,NULL,'415'), + ('415000012','415231103','415',NULL,true,3,NULL,NULL,'415'), + ('415000013','415231103','415',NULL,true,3,NULL,NULL,'415'), + ('415000014','415231104','415',NULL,true,4,NULL,NULL,'415'), + ('415000015','415231104','415',NULL,true,4,NULL,NULL,'415'), + ('415000016','415231104','415',NULL,true,4,NULL,NULL,'415'), + ('415000017','415231104','415',NULL,true,4,NULL,NULL,'415'), + ('415000018','415231104','415',NULL,true,1,NULL,NULL,'415'), + ('415000020','415231105','415',NULL,true,4,NULL,NULL,'415'), + ('415000021','415231105','415',NULL,true,4,NULL,NULL,'415'), + ('415000022','415231106','415',NULL,true,2,NULL,NULL,'415'), + ('415000023','415231106','415',NULL,true,2,NULL,NULL,'415'), + ('415000024','415231105','415',NULL,true,5,NULL,NULL,'415'), + ('415000025','415231105','415',NULL,true,6,NULL,NULL,'415'), + ('415000026','415231106','415',NULL,true,7,NULL,NULL,'415'), + ('415000027','415231106','415',NULL,true,8,NULL,NULL,'415'), + ('415000028','415231106','415',NULL,true,9,NULL,NULL,'415'), + ('415000029','415231106','415',NULL,true,10,NULL,NULL,'415'), + ('415000030','415231106','415',NULL,true,11,NULL,NULL,'415'), + ('415000031','415231106','415',NULL,true,12,NULL,NULL,'415'), + ('415000032','415231106','415',NULL,true,13,NULL,NULL,'415'); INSERT INTO juror_mod.appearance (attendance_date,juror_number,loc_code,time_in,time_out,trial_number,non_attendance,no_show,misc_description,pay_cash,last_updated_by,created_by,public_transport_total_due,public_transport_total_paid,hired_vehicle_total_due,hired_vehicle_total_paid,motorcycle_total_due,motorcycle_total_paid,car_total_due,car_total_paid,pedal_cycle_total_due,pedal_cycle_total_paid,childcare_total_due,childcare_total_paid,parking_total_due,parking_total_paid,misc_total_due,misc_total_paid,smart_card_due,is_draft_expense,f_audit,sat_on_jury,pool_number,appearance_stage,loss_of_earnings_due,loss_of_earnings_paid,subsistence_due,subsistence_paid,attendance_type,smart_card_paid,travel_time,travel_jurors_taken_by_car,travel_by_car,travel_jurors_taken_by_motorcycle,travel_by_motorcycle,travel_by_bicycle,miles_traveled,food_and_drink_claim_type,"version",expense_rates_id,attendance_audit_number) VALUES diff --git a/src/integration-test/resources/db/mod/reports/IncompleteServiceReportITest_typical.sql b/src/integration-test/resources/db/mod/reports/IncompleteServiceReportITest_typical.sql index 496704db3..4db81340d 100644 --- a/src/integration-test/resources/db/mod/reports/IncompleteServiceReportITest_typical.sql +++ b/src/integration-test/resources/db/mod/reports/IncompleteServiceReportITest_typical.sql @@ -14,15 +14,15 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name -- create juror_pool associative records INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES ('641500021','415240601','415','MODTESTBUREAU',true,4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL, - current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.702989',NULL,NULL,'2024-04-22 12:26:40.702987'), + current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.702989',NULL,NULL,'2024-04-22 12:26:40.702987'), ('641500011','415240601','415','MODTESTBUREAU',true,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL, - current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.757378',NULL,NULL,'2024-04-22 12:26:40.757376'), + current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.757378',NULL,NULL,'2024-04-22 12:26:40.757376'), ('641500003','415240601','415','MODTESTCOURT',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL, - current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), + current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), ('641500004','415240601','415','MODTESTCOURT',true,7,NULL,current_date+30,NULL,NULL,NULL,NULL,NULL,'0004',NULL, - NULL,NULL,NULL,NULL,'DC',NULL,NULL,NULL,NULL,'2024-04-22 12:30:25.628652',NULL,NULL,'2024-04-22 12:26:40.819485'), + NULL,false,NULL,NULL,'DC',NULL,NULL,NULL,NULL,'2024-04-22 12:30:25.628652',NULL,NULL,'2024-04-22 12:26:40.819485'), ('641500007','415240601','415','MODTESTCOURT',true,13,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL, - current_date-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 15:14:10.871528',NULL,NULL,'2024-04-22 12:26:40.848865'); + current_date-1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 15:14:10.871528',NULL,NULL,'2024-04-22 12:26:40.848865'); insert into juror_mod.appearance (attendance_date,juror_number,pool_number,loc_code,time_in,time_out,non_attendance,appearance_stage,attendance_type) values (current_date - interval '1 day','641500021','415240601','415',null,null,false,null,'ABSENT'), diff --git a/src/integration-test/resources/db/mod/reports/JurySummoningMonitor_typical.sql b/src/integration-test/resources/db/mod/reports/JurySummoningMonitor_typical.sql index 60b868a11..61c9e5961 100644 --- a/src/integration-test/resources/db/mod/reports/JurySummoningMonitor_typical.sql +++ b/src/integration-test/resources/db/mod/reports/JurySummoningMonitor_typical.sql @@ -59,53 +59,53 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500001','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:03:06.182449',NULL,NULL,'2024-06-03 12:00:23.099129'), - ('641500002','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:04:02.042',NULL,NULL,'2024-06-03 12:00:23.112002'), - ('641500003','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:43:17.407033',NULL,NULL,'2024-06-03 12:00:23.109013'), - ('641500004','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0011',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:48:07.182596',NULL,NULL,'2024-06-03 12:00:23.120384'), - ('641500006','415240801','400','ADMINUSER',false,7,NULL,'2024-08-27',NULL,NULL,NULL,NULL,NULL,'0014',NULL,NULL,NULL,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990034',NULL,NULL,'2024-06-03 12:00:23.125644'), - ('641500006','415240803','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-27',NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990177',NULL,NULL,'2024-06-03 12:00:23.125644'), - ('641500007','415240801','400','ADMINUSER',true,7,NULL,'2024-10-29',NULL,NULL,NULL,NULL,NULL,'0012',NULL,NULL,NULL,NULL,NULL,'P',NULL,true,NULL,NULL,'2024-06-03 15:16:19.119732',NULL,NULL,'2024-06-03 12:00:23.122108'), - ('641500008','415240803','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-27',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:02:08.187452',NULL,NULL,'2024-06-03 12:02:08.187451'), - ('641500010','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.08775',NULL,NULL,'2024-06-03 12:00:23.087748'), - ('641500011','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:50:04.734274',NULL,NULL,'2024-06-03 12:00:23.105914'); + ('641500001','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:03:06.182449',NULL,NULL,'2024-06-03 12:00:23.099129'), + ('641500002','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:04:02.042',NULL,NULL,'2024-06-03 12:00:23.112002'), + ('641500003','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:43:17.407033',NULL,NULL,'2024-06-03 12:00:23.109013'), + ('641500004','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0011',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:48:07.182596',NULL,NULL,'2024-06-03 12:00:23.120384'), + ('641500006','415240801','400','ADMINUSER',false,7,NULL,'2024-08-27',NULL,NULL,NULL,NULL,NULL,'0014',NULL,NULL,false,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990034',NULL,NULL,'2024-06-03 12:00:23.125644'), + ('641500006','415240803','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-27',false,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990177',NULL,NULL,'2024-06-03 12:00:23.125644'), + ('641500007','415240801','400','ADMINUSER',true,7,NULL,'2024-10-29',NULL,NULL,NULL,NULL,NULL,'0012',NULL,NULL,false,NULL,NULL,'P',NULL,true,NULL,NULL,'2024-06-03 15:16:19.119732',NULL,NULL,'2024-06-03 12:00:23.122108'), + ('641500008','415240803','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-27',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:02:08.187452',NULL,NULL,'2024-06-03 12:02:08.187451'), + ('641500010','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.08775',NULL,NULL,'2024-06-03 12:00:23.087748'), + ('641500011','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:50:04.734274',NULL,NULL,'2024-06-03 12:00:23.105914'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500012','415240801','400','ADMINUSER',true,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'), - ('641500013','415240801','400','ADMINUSER',true,9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 10:32:33.668674',NULL,NULL,'2024-06-03 12:00:23.115231'), - ('641500016','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0010',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.118577',NULL,NULL,'2024-06-03 12:00:23.118576'), - ('641500017','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0015',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:14:27.130294',true,NULL,'2024-06-03 12:00:23.127317'), - ('641500018','415240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0013',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:16:26.744714',NULL,NULL,'2024-06-03 12:00:23.123845'), - ('641500019','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0016',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.129403',NULL,NULL,'2024-06-03 12:00:23.129402'), - ('641500021','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:17:15.312749',NULL,NULL,'2024-06-03 12:00:23.091738'), - ('641500023','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.095433',NULL,NULL,'2024-06-03 12:00:23.095431'), - ('641500201','415240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0018',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:29:39.953446',NULL,NULL,'2024-06-03 15:33:11.346417'), - ('641500202','415240801','400','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0024',NULL,NULL,NULL,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:34:46.391861',NULL,NULL,'2024-06-03 15:33:11.359236'); + ('641500012','415240801','400','ADMINUSER',true,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'), + ('641500013','415240801','400','ADMINUSER',true,9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 10:32:33.668674',NULL,NULL,'2024-06-03 12:00:23.115231'), + ('641500016','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0010',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.118577',NULL,NULL,'2024-06-03 12:00:23.118576'), + ('641500017','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0015',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:14:27.130294',true,NULL,'2024-06-03 12:00:23.127317'), + ('641500018','415240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0013',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:16:26.744714',NULL,NULL,'2024-06-03 12:00:23.123845'), + ('641500019','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0016',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.129403',NULL,NULL,'2024-06-03 12:00:23.129402'), + ('641500021','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:17:15.312749',NULL,NULL,'2024-06-03 12:00:23.091738'), + ('641500023','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.095433',NULL,NULL,'2024-06-03 12:00:23.095431'), + ('641500201','415240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0018',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:29:39.953446',NULL,NULL,'2024-06-03 15:33:11.346417'), + ('641500202','415240801','400','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0024',NULL,NULL,false,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:34:46.391861',NULL,NULL,'2024-06-03 15:33:11.359236'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500203','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0022',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.35552',NULL,NULL,'2024-06-03 15:33:11.35552'), - ('641500204','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0026',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.362183',NULL,NULL,'2024-06-03 15:33:11.362182'), - ('641500210','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0017',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.343885',NULL,NULL,'2024-06-03 15:33:11.343885'), - ('641500211','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0021',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.353662',NULL,NULL,'2024-06-03 15:33:11.353662'), - ('641500212','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0019',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.348805',NULL,NULL,'2024-06-03 15:33:11.348805'), - ('641500213','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0023',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.357346',NULL,NULL,'2024-06-03 15:33:11.357346'), - ('641500216','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0025',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.361174',NULL,NULL,'2024-06-03 15:33:11.361174'), - ('641500223','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0020',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.351721',NULL,NULL,'2024-06-03 15:33:11.351721'), - ('641500316','415240801','400','ADMINUSER',true,2,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',true,NULL,'2024-06-03 12:00:23.10279'), - ('641500316','415240804','400','ADMINUSER',false,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'); + ('641500203','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0022',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.35552',NULL,NULL,'2024-06-03 15:33:11.35552'), + ('641500204','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0026',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.362183',NULL,NULL,'2024-06-03 15:33:11.362182'), + ('641500210','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0017',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.343885',NULL,NULL,'2024-06-03 15:33:11.343885'), + ('641500211','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0021',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.353662',NULL,NULL,'2024-06-03 15:33:11.353662'), + ('641500212','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0019',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.348805',NULL,NULL,'2024-06-03 15:33:11.348805'), + ('641500213','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0023',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.357346',NULL,NULL,'2024-06-03 15:33:11.357346'), + ('641500216','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0025',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.361174',NULL,NULL,'2024-06-03 15:33:11.361174'), + ('641500223','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0020',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.351721',NULL,NULL,'2024-06-03 15:33:11.351721'), + ('641500316','415240801','400','ADMINUSER',true,2,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',true,NULL,'2024-06-03 12:00:23.10279'), + ('641500316','415240804','400','ADMINUSER',false,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641600045','416240801','416','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0001',NULL,NULL,NULL,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:43:59.388',NULL,'2024-06-04','2024-06-04 11:42:42.328'), - ('641600050','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), - ('641600051','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), - ('641600054','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), - ('641600057','416240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:58:18.554',NULL,'2024-06-04','2024-06-04 11:42:42.331'), - ('641600058','416240801','400','MODTESTBUREAU',true,7,NULL,'2024-09-16',NULL,NULL,NULL,NULL,NULL,'0010',NULL,NULL,NULL,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-04 11:59:20.157',NULL,'2024-06-04','2024-06-04 11:42:42.354'), - ('641600062','416240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:59:44.483',NULL,'2024-06-04','2024-06-04 11:42:42.349'), - ('641600065','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.337',NULL,'2024-06-04','2024-06-04 11:42:42.337'), - ('641600066','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.341',NULL,'2024-06-04','2024-06-04 11:42:42.341'), - ('641600070','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.351',NULL,'2024-06-04','2024-06-04 11:42:42.351'); + ('641600045','416240801','416','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0001',NULL,NULL,false,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:43:59.388',NULL,'2024-06-04','2024-06-04 11:42:42.328'), + ('641600050','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), + ('641600051','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), + ('641600054','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), + ('641600057','416240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:58:18.554',NULL,'2024-06-04','2024-06-04 11:42:42.331'), + ('641600058','416240801','400','MODTESTBUREAU',true,7,NULL,'2024-09-16',NULL,NULL,NULL,NULL,NULL,'0010',NULL,NULL,false,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-04 11:59:20.157',NULL,'2024-06-04','2024-06-04 11:42:42.354'), + ('641600062','416240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:59:44.483',NULL,'2024-06-04','2024-06-04 11:42:42.349'), + ('641600065','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.337',NULL,'2024-06-04','2024-06-04 11:42:42.337'), + ('641600066','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.341',NULL,'2024-06-04','2024-06-04 11:42:42.341'), + ('641600070','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.351',NULL,'2024-06-04','2024-06-04 11:42:42.351'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('677400941','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.647878',NULL,NULL,'2024-06-06 12:07:51.647877'), - ('677400928','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.652351',NULL,NULL,'2024-06-06 12:07:51.65235'), - ('677400923','774240802','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:08:33.268403',NULL,NULL,'2024-06-06 12:07:51.640718'); + ('677400941','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-08',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.647878',NULL,NULL,'2024-06-06 12:07:51.647877'), + ('677400928','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-08',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.652351',NULL,NULL,'2024-06-06 12:07:51.65235'), + ('677400923','774240802','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-08',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:08:33.268403',NULL,NULL,'2024-06-06 12:07:51.640718'); insert into juror_mod.bureau_snapshot (juror_number,pool_number,"owner",user_edtq,is_active,status,def_date,pool_seq,edit_tag,next_date,was_deferred,deferral_code,postpone,scan_code,last_update,reminder_sent,transfer_date,date_created,excusal_code,acc_exc,police_check) VALUES diff --git a/src/integration-test/resources/db/mod/reports/PersonAttendingSummaryReportITest_typical.sql b/src/integration-test/resources/db/mod/reports/PersonAttendingSummaryReportITest_typical.sql index 306326e8e..46cfaefe1 100644 --- a/src/integration-test/resources/db/mod/reports/PersonAttendingSummaryReportITest_typical.sql +++ b/src/integration-test/resources/db/mod/reports/PersonAttendingSummaryReportITest_typical.sql @@ -14,12 +14,12 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name -- create juror_pool associative records INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES ('641500021','415240601','415','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL, - current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.702989',NULL,NULL,'2024-04-22 12:26:40.702987'), + current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.702989',NULL,NULL,'2024-04-22 12:26:40.702987'), ('641500011','415240601','415','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL, - current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.757378',NULL,NULL,'2024-04-22 12:26:40.757376'), + current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.757378',NULL,NULL,'2024-04-22 12:26:40.757376'), ('641500003','415240601','415','MODTESTCOURT',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL, - current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), + current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), ('641500004','415240601','415','MODTESTCOURT',true,1,NULL,current_date+30,NULL,NULL,NULL,NULL,NULL,'0004',NULL, - current_date+2,NULL,NULL,NULL,'DC',NULL,NULL,NULL,NULL,'2024-04-22 12:30:25.628652',NULL,NULL,'2024-04-22 12:26:40.819485'), + current_date+2,false,NULL,NULL,'DC',NULL,NULL,NULL,NULL,'2024-04-22 12:30:25.628652',NULL,NULL,'2024-04-22 12:26:40.819485'), ('641500007','415240601','415','MODTESTCOURT',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL, - current_date+2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 15:14:10.871528',NULL,NULL,'2024-04-22 12:26:40.848865'); \ No newline at end of file + current_date+2,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 15:14:10.871528',NULL,NULL,'2024-04-22 12:26:40.848865'); \ No newline at end of file diff --git a/src/integration-test/resources/db/mod/reports/YieldPerformanceReportITest_typical.sql b/src/integration-test/resources/db/mod/reports/YieldPerformanceReportITest_typical.sql index 68e4036ec..4ee515d96 100644 --- a/src/integration-test/resources/db/mod/reports/YieldPerformanceReportITest_typical.sql +++ b/src/integration-test/resources/db/mod/reports/YieldPerformanceReportITest_typical.sql @@ -69,62 +69,62 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500001','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:03:06.182449',NULL,NULL,'2024-06-03 12:00:23.099129'), - ('641500002','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:04:02.042',NULL,NULL,'2024-06-03 12:00:23.112002'), - ('641500003','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:43:17.407033',NULL,NULL,'2024-06-03 12:00:23.109013'), - ('641500004','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0011',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:48:07.182596',NULL,NULL,'2024-06-03 12:00:23.120384'), - ('641500006','415240801','400','ADMINUSER',false,7,NULL,'2024-08-27',NULL,NULL,NULL,NULL,NULL,'0014',NULL,NULL,NULL,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990034',NULL,NULL,'2024-06-03 12:00:23.125644'), - ('641500006','415240803','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-27',NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990177',NULL,NULL,'2024-06-03 12:00:23.125644'), - ('641500007','415240801','400','ADMINUSER',true,7,NULL,'2024-10-29',NULL,NULL,NULL,NULL,NULL,'0012',NULL,NULL,NULL,NULL,NULL,'P',NULL,true,NULL,NULL,'2024-06-03 15:16:19.119732',NULL,NULL,'2024-06-03 12:00:23.122108'), - ('641500008','415240803','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-27',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:02:08.187452',NULL,NULL,'2024-06-03 12:02:08.187451'), - ('641500010','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.08775',NULL,NULL,'2024-06-03 12:00:23.087748'), - ('641500011','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:50:04.734274',NULL,NULL,'2024-06-03 12:00:23.105914'); + ('641500001','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:03:06.182449',NULL,NULL,'2024-06-03 12:00:23.099129'), + ('641500002','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:04:02.042',NULL,NULL,'2024-06-03 12:00:23.112002'), + ('641500003','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:43:17.407033',NULL,NULL,'2024-06-03 12:00:23.109013'), + ('641500004','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0011',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:48:07.182596',NULL,NULL,'2024-06-03 12:00:23.120384'), + ('641500006','415240801','400','ADMINUSER',false,7,NULL,'2024-08-27',NULL,NULL,NULL,NULL,NULL,'0014',NULL,NULL,false,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990034',NULL,NULL,'2024-06-03 12:00:23.125644'), + ('641500006','415240803','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-27',false,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990177',NULL,NULL,'2024-06-03 12:00:23.125644'), + ('641500007','415240801','400','ADMINUSER',true,7,NULL,'2024-10-29',NULL,NULL,NULL,NULL,NULL,'0012',NULL,NULL,false,NULL,NULL,'P',NULL,true,NULL,NULL,'2024-06-03 15:16:19.119732',NULL,NULL,'2024-06-03 12:00:23.122108'), + ('641500008','415240803','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-27',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:02:08.187452',NULL,NULL,'2024-06-03 12:02:08.187451'), + ('641500010','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.08775',NULL,NULL,'2024-06-03 12:00:23.087748'), + ('641500011','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:50:04.734274',NULL,NULL,'2024-06-03 12:00:23.105914'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500012','415240801','400','ADMINUSER',true,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'), - ('641500013','415240801','400','ADMINUSER',true,9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 10:32:33.668674',NULL,NULL,'2024-06-03 12:00:23.115231'), - ('641500016','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0010',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.118577',NULL,NULL,'2024-06-03 12:00:23.118576'), - ('641500017','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0015',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:14:27.130294',true,NULL,'2024-06-03 12:00:23.127317'), - ('641500018','415240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0013',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:16:26.744714',NULL,NULL,'2024-06-03 12:00:23.123845'), - ('641500019','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0016',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.129403',NULL,NULL,'2024-06-03 12:00:23.129402'), - ('641500021','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:17:15.312749',NULL,NULL,'2024-06-03 12:00:23.091738'), - ('641500023','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.095433',NULL,NULL,'2024-06-03 12:00:23.095431'), - ('641500201','415240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0018',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:29:39.953446',NULL,NULL,'2024-06-03 15:33:11.346417'), - ('641500202','415240801','400','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0024',NULL,NULL,NULL,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:34:46.391861',NULL,NULL,'2024-06-03 15:33:11.359236'); + ('641500012','415240801','400','ADMINUSER',true,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'), + ('641500013','415240801','400','ADMINUSER',true,9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 10:32:33.668674',NULL,NULL,'2024-06-03 12:00:23.115231'), + ('641500016','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0010',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.118577',NULL,NULL,'2024-06-03 12:00:23.118576'), + ('641500017','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0015',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:14:27.130294',true,NULL,'2024-06-03 12:00:23.127317'), + ('641500018','415240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0013',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:16:26.744714',NULL,NULL,'2024-06-03 12:00:23.123845'), + ('641500019','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0016',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.129403',NULL,NULL,'2024-06-03 12:00:23.129402'), + ('641500021','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:17:15.312749',NULL,NULL,'2024-06-03 12:00:23.091738'), + ('641500023','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.095433',NULL,NULL,'2024-06-03 12:00:23.095431'), + ('641500201','415240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0018',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:29:39.953446',NULL,NULL,'2024-06-03 15:33:11.346417'), + ('641500202','415240801','400','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0024',NULL,NULL,false,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:34:46.391861',NULL,NULL,'2024-06-03 15:33:11.359236'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500203','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0022',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.35552',NULL,NULL,'2024-06-03 15:33:11.35552'), - ('641500204','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0026',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.362183',NULL,NULL,'2024-06-03 15:33:11.362182'), - ('641500210','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0017',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.343885',NULL,NULL,'2024-06-03 15:33:11.343885'), - ('641500211','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0021',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.353662',NULL,NULL,'2024-06-03 15:33:11.353662'), - ('641500212','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0019',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.348805',NULL,NULL,'2024-06-03 15:33:11.348805'), - ('641500213','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0023',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.357346',NULL,NULL,'2024-06-03 15:33:11.357346'), - ('641500216','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0025',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.361174',NULL,NULL,'2024-06-03 15:33:11.361174'), - ('641500223','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0020',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.351721',NULL,NULL,'2024-06-03 15:33:11.351721'), - ('641500316','415240801','400','ADMINUSER',true,2,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',true,NULL,'2024-06-03 12:00:23.10279'), - ('641500316','415240804','400','ADMINUSER',false,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'); + ('641500203','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0022',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.35552',NULL,NULL,'2024-06-03 15:33:11.35552'), + ('641500204','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0026',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.362183',NULL,NULL,'2024-06-03 15:33:11.362182'), + ('641500210','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0017',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.343885',NULL,NULL,'2024-06-03 15:33:11.343885'), + ('641500211','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0021',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.353662',NULL,NULL,'2024-06-03 15:33:11.353662'), + ('641500212','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0019',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.348805',NULL,NULL,'2024-06-03 15:33:11.348805'), + ('641500213','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0023',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.357346',NULL,NULL,'2024-06-03 15:33:11.357346'), + ('641500216','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0025',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.361174',NULL,NULL,'2024-06-03 15:33:11.361174'), + ('641500223','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0020',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.351721',NULL,NULL,'2024-06-03 15:33:11.351721'), + ('641500316','415240801','400','ADMINUSER',true,2,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',true,NULL,'2024-06-03 12:00:23.10279'), + ('641500316','415240804','400','ADMINUSER',false,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641600045','416240801','416','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0001',NULL,NULL,NULL,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:43:59.388',NULL,'2024-06-04','2024-06-04 11:42:42.328'), - ('641600050','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), - ('641600051','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), - ('641600054','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), - ('641600057','416240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:58:18.554',NULL,'2024-06-04','2024-06-04 11:42:42.331'), - ('641600058','416240801','400','MODTESTBUREAU',true,7,NULL,'2024-09-16',NULL,NULL,NULL,NULL,NULL,'0010',NULL,NULL,NULL,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-04 11:59:20.157',NULL,'2024-06-04','2024-06-04 11:42:42.354'), - ('641600062','416240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:59:44.483',NULL,'2024-06-04','2024-06-04 11:42:42.349'), - ('641600065','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.337',NULL,'2024-06-04','2024-06-04 11:42:42.337'), - ('641600066','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.341',NULL,'2024-06-04','2024-06-04 11:42:42.341'), - ('641600070','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.351',NULL,'2024-06-04','2024-06-04 11:42:42.351'); + ('641600045','416240801','416','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0001',NULL,NULL,false,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:43:59.388',NULL,'2024-06-04','2024-06-04 11:42:42.328'), + ('641600050','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), + ('641600051','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), + ('641600054','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), + ('641600057','416240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:58:18.554',NULL,'2024-06-04','2024-06-04 11:42:42.331'), + ('641600058','416240801','400','MODTESTBUREAU',true,7,NULL,'2024-09-16',NULL,NULL,NULL,NULL,NULL,'0010',NULL,NULL,false,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-04 11:59:20.157',NULL,'2024-06-04','2024-06-04 11:42:42.354'), + ('641600062','416240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:59:44.483',NULL,'2024-06-04','2024-06-04 11:42:42.349'), + ('641600065','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.337',NULL,'2024-06-04','2024-06-04 11:42:42.337'), + ('641600066','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.341',NULL,'2024-06-04','2024-06-04 11:42:42.341'), + ('641600070','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.351',NULL,'2024-06-04','2024-06-04 11:42:42.351'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('677400941','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.647878',NULL,NULL,'2024-06-06 12:07:51.647877'), - ('677400928','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.652351',NULL,NULL,'2024-06-06 12:07:51.65235'), - ('677400923','774240802','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:08:33.268403',NULL,NULL,'2024-06-06 12:07:51.640718'), - ('641700050','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), - ('641700051','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), - ('641700052','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), - ('641700053','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), - ('641700054','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), - ('641700055','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), - ('641700056','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), - ('641700057','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), - ('641700058','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'); + ('677400941','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-08',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.647878',NULL,NULL,'2024-06-06 12:07:51.647877'), + ('677400928','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-08',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.652351',NULL,NULL,'2024-06-06 12:07:51.65235'), + ('677400923','774240802','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-08',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:08:33.268403',NULL,NULL,'2024-06-06 12:07:51.640718'), + ('641700050','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), + ('641700051','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), + ('641700052','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), + ('641700053','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), + ('641700054','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), + ('641700055','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), + ('641700056','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), + ('641700057','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), + ('641700058','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'); insert into juror_mod.bureau_snapshot (juror_number,pool_number,"owner",user_edtq,is_active,status,def_date,pool_seq,edit_tag,next_date,was_deferred,deferral_code,postpone,scan_code,last_update,reminder_sent,transfer_date,date_created,excusal_code,acc_exc,police_check) VALUES diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/controller/JurorCommsCronBatchController.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/controller/JurorCommsCronBatchController.java index f1ffa8df9..08801c332 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/controller/JurorCommsCronBatchController.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/controller/JurorCommsCronBatchController.java @@ -2,11 +2,11 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.util.Assert; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; @@ -21,16 +21,11 @@ @RequestMapping(value = "/api/v1/bureau/cron", produces = MediaType.APPLICATION_JSON_VALUE) @Slf4j @Tag(name = "Cron API", description = "Bureau Cron API") +@RequiredArgsConstructor(onConstructor_ = {@Autowired}) public class JurorCommsCronBatchController { private final BureauBatchScheduler bureauBatchScheduler; - @Autowired - public JurorCommsCronBatchController(final BureauBatchScheduler bureauBatchScheduler) { - Assert.notNull(bureauBatchScheduler, "BureauAuthenticationService cannot be null."); - this.bureauBatchScheduler = bureauBatchScheduler; - } - @GetMapping @Operation(summary = "/bureau/cron", description = "BureauBatchScheduler is called") diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/BureauBatchScheduler.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/BureauBatchScheduler.java index ba178a09c..2033e3f1f 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/BureauBatchScheduler.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/BureauBatchScheduler.java @@ -1,11 +1,11 @@ package uk.gov.hmcts.juror.api.bureau.scheduler; +import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; -import org.springframework.util.Assert; import uk.gov.hmcts.juror.api.bureau.service.ScheduledService; import uk.gov.hmcts.juror.api.moj.client.contracts.SchedulerServiceClient; @@ -16,21 +16,12 @@ @Component @Slf4j +@RequiredArgsConstructor(onConstructor_ = {@Autowired}) public class BureauBatchScheduler { private final BureauBatchProcessFactory bureauBatchProcessFactory; private final SchedulerServiceClient schedulerServiceClient; - @Autowired - public BureauBatchScheduler( - final BureauBatchProcessFactory bureauBatchProcessFactory, - final SchedulerServiceClient schedulerServiceClient) { - Assert.notNull(bureauBatchProcessFactory, "BureauBatchProcessFactory cannot be null."); - this.bureauBatchProcessFactory = bureauBatchProcessFactory; - this.schedulerServiceClient = schedulerServiceClient; - - } - /** * General Entry point for externally hosted cron jobs. ( server crontab and not via springboot). */ diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/UrgentStatusScheduler.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/UrgentStatusScheduler.java index 26491ea2b..1ddc01fc0 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/UrgentStatusScheduler.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/UrgentStatusScheduler.java @@ -73,7 +73,8 @@ public SchedulerServiceClient.Result process() { SecurityUtil.BUREAU_OWNER); if (jurorDetails == null) { - log.error("Can not find active bureau owned juror pool for juror: " + backlogItem.getJurorNumber()); + log.error("Can not find active bureau owned juror pool for juror: {}", + backlogItem.getJurorNumber()); failedToFindJurorCount++; continue; } @@ -104,9 +105,9 @@ public SchedulerServiceClient.Result process() { ? SchedulerServiceClient.Result.Status.SUCCESS : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, null, Map.of( - "TOTAL_PROCESSED", "" + totalResponsesProcessed, - "TOTAL_MARKED_URGENT", "" + totalUrgentResponses, - "TOTAL_FAILED_TO_FIND", "" + failedToFindJurorCount + "TOTAL_PROCESSED", String.valueOf(totalResponsesProcessed), + "TOTAL_MARKED_URGENT", String.valueOf(totalUrgentResponses), + "TOTAL_FAILED_TO_FIND", String.valueOf(failedToFindJurorCount) )); } diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsLetterServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsLetterServiceImpl.java index c2eede774..98d11e69a 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsLetterServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsLetterServiceImpl.java @@ -1,7 +1,7 @@ package uk.gov.hmcts.juror.api.bureau.service; import com.google.common.collect.Lists; -import io.jsonwebtoken.lang.Assert; +import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -15,6 +15,7 @@ import uk.gov.hmcts.juror.api.moj.domain.JurorPool; import uk.gov.hmcts.juror.api.moj.repository.BulkPrintDataRepository; import uk.gov.hmcts.juror.api.moj.repository.JurorPoolRepository; +import uk.gov.hmcts.juror.api.moj.utils.NotifyUtil; import uk.gov.hmcts.juror.api.moj.utils.SecurityUtil; import java.text.SimpleDateFormat; @@ -27,6 +28,7 @@ */ @Slf4j @Service +@AllArgsConstructor(onConstructor = @__(@Autowired)) public class JurorCommsLetterServiceImpl implements BureauProcessService { @@ -35,24 +37,6 @@ public class JurorCommsLetterServiceImpl implements BureauProcessService { private final BulkPrintDataRepository bulkPrintDataRepository; private final JurorPoolRepository jurorRepository; - @Autowired - public JurorCommsLetterServiceImpl( - final JurorCommsNotificationService jurorCommsNotificationService, - final BulkPrintDataNotifyCommsRepository bulkPrintDataNotifyCommsRepository, - final BulkPrintDataRepository bulkPrintDataRepository, - final JurorPoolRepository jurorRepository) { - Assert.notNull(jurorCommsNotificationService, "JurorCommsNotificationService cannot be null."); - Assert.notNull(bulkPrintDataRepository, "BulkPrintDataRepository cannot be null."); - Assert.notNull(bulkPrintDataNotifyCommsRepository, "BulkPrintDataNotifyCommsRepository cannot be null."); - Assert.notNull(jurorRepository, "JurorRepository cannot be null."); - - this.jurorCommsNotificationService = jurorCommsNotificationService; - this.bulkPrintDataRepository = bulkPrintDataRepository; - this.bulkPrintDataNotifyCommsRepository = bulkPrintDataNotifyCommsRepository; - this.jurorRepository = jurorRepository; - - } - /** * Implements a specific job execution. * Processes entries in the Juror.print_files table and sends the appropriate email notifications to @@ -71,9 +55,8 @@ public SchedulerServiceClient.Result process() { log.debug("jurorCommsPrintFiles {}", bulkPrintDataNotifyCommsList.size()); int commsSent = 0; int commsfailed = 0; + int invalidEmailAddress = 0; if (!bulkPrintDataNotifyCommsList.isEmpty()) { - - for (BulkPrintDataNotifyComms printFile : bulkPrintDataNotifyCommsList) { try { log.trace("LetterService : jurorNumber {}", printFile.getJurorNo()); @@ -93,18 +76,19 @@ public SchedulerServiceClient.Result process() { updatePrintFiles(printFile); commsSent++; } catch (JurorCommsNotificationServiceException e) { - log.error( - "Unable to send Letter comms for {} : {} {}", - printFile.getJurorNo(), - e.getMessage(), - e.getCause().toString() - ); - commsfailed++; + if (NotifyUtil.isInvalidEmailAddressError(e.getCause())) { + invalidEmailAddress++; + } else { + log.error( + "Unable to send Letter comms for {}", + printFile.getJurorNo(), e + ); + commsfailed++; + } } catch (Exception e) { commsfailed++; log.error("Letter Comms Processing : Juror Comms failed : {}", e.getMessage()); } - } log.info("LetterService : Summary, identified:{}, sent:{}, failed:{},", bulkPrintDataNotifyCommsList.size(), commsSent, commsfailed @@ -118,8 +102,11 @@ public SchedulerServiceClient.Result process() { commsfailed == 0 ? SchedulerServiceClient.Result.Status.SUCCESS : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, null, - Map.of("COMMS_FAILED", "" + commsfailed, - "COMMNS_SENT", "" + commsSent)); + Map.of( + "COMMS_FAILED", String.valueOf(commsfailed), + "COMMNS_SENT", String.valueOf(commsSent), + "INVALID_EMAIL_ADDRESS", String.valueOf(invalidEmailAddress) + )); } /** diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsSentToCourtServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsSentToCourtServiceImpl.java index 42e714b5a..f40aa98ca 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsSentToCourtServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsSentToCourtServiceImpl.java @@ -3,7 +3,7 @@ import com.google.common.collect.Lists; import com.querydsl.core.types.dsl.BooleanExpression; -import io.jsonwebtoken.lang.Assert; +import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -16,17 +16,20 @@ import uk.gov.hmcts.juror.api.moj.repository.JurorPoolQueries; import uk.gov.hmcts.juror.api.moj.repository.JurorPoolRepository; import uk.gov.hmcts.juror.api.moj.service.AppSettingService; +import uk.gov.hmcts.juror.api.moj.utils.NotifyUtil; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.Objects; /** * Implementation of {@link BureauProcessService}. */ @Slf4j @Service +@AllArgsConstructor(onConstructor = @__(@Autowired)) public class JurorCommsSentToCourtServiceImpl implements BureauProcessService { @@ -37,19 +40,6 @@ public class JurorCommsSentToCourtServiceImpl implements BureauProcessService { private final JurorPoolRepository jurorRepository; private final AppSettingService appSetting; - @Autowired - public JurorCommsSentToCourtServiceImpl( - final JurorCommsNotificationService jurorCommsNotificationService, - final AppSettingService appSetting, - final JurorPoolRepository jurorRepository) { - Assert.notNull(jurorCommsNotificationService, "JurorCommsNotificationService cannot be null."); - Assert.notNull(jurorRepository, "JurorRepository cannot be null."); - Assert.notNull(appSetting, "AppSettingService cannot be null."); - this.jurorCommsNotificationService = jurorCommsNotificationService; - this.appSetting = appSetting; - this.jurorRepository = jurorRepository; - } - /** * Implements a specific job execution. * Processes entries in the Juror table and sends the appropriate email notifications to @@ -70,26 +60,36 @@ public SchedulerServiceClient.Result process() { Integer notificationsSent; int errorCount = 0; + int errorInvalidEmailCount = 0; + int errorInvalidPhoneCount = 0; + int successCountEmail = 0; + int successCountSms = 0; + int errorCountEmail = 0; + int errorCountSms = 0; + int successCount = 0; for (JurorPool jurorDetail : jurordetailList) { notificationsSent = jurorDetail.getJuror().getNotifications(); log.trace("Sent To Court Comms Service : jurorNumber {}", jurorDetail.getJurorNumber()); + boolean isEmail = false; + boolean isSms = false; try { //Email if (jurorDetail.getJuror().getEmail() != null && !notificationsSent.equals(EMAIL_NOTIFICATION_SENT)) { + isEmail = true; jurorCommsNotificationService.sendJurorComms(jurorDetail, JurorCommsNotifyTemplateType.SENT_TO_COURT, null, null, false ); notificationsSent = EMAIL_NOTIFICATION_SENT; + successCountEmail++; } //Send SMS only if there has not been an email sent - if (jurorDetail.getJuror().getAltPhoneNumber() != null && !notificationsSent.equals( - EMAIL_NOTIFICATION_SENT) - && appSetting.getSendEmailOrSms() == SEND_EMAIL_OR_SMS) { - - + if (jurorDetail.getJuror().getAltPhoneNumber() != null + && !notificationsSent.equals(EMAIL_NOTIFICATION_SENT) + && Objects.equals(appSetting.getSendEmailOrSms(), SEND_EMAIL_OR_SMS)) { + isSms = true; jurorCommsNotificationService.sendJurorCommsSms( jurorDetail, JurorCommsNotifyTemplateType.SENT_TO_COURT, @@ -97,13 +97,13 @@ public SchedulerServiceClient.Result process() { null, true ); + successCountSms++; } // Send SMS if (jurorDetail.getJuror().getAltPhoneNumber() != null - && appSetting.getSendEmailOrSms() != SEND_EMAIL_OR_SMS) { - - + && !Objects.equals(appSetting.getSendEmailOrSms(), SEND_EMAIL_OR_SMS)) { + isSms = true; jurorCommsNotificationService.sendJurorCommsSms( jurorDetail, JurorCommsNotifyTemplateType.SENT_TO_COURT, @@ -111,29 +111,53 @@ public SchedulerServiceClient.Result process() { null, true ); - + successCountSms++; } //update regardless - stop processing next time. jurorDetail.getJuror().setNotifications(ALL_NOTIFICATION_SENT); notificationsSent = ALL_NOTIFICATION_SENT; update(jurorDetail); + successCount++; } catch (JurorCommsNotificationServiceException e) { - log.error( - "Unable to send sent to court comms for {} : {} {}", - jurorDetail.getJurorNumber(), - e.getMessage(), - e.getCause().toString() - ); - errorCount++; + boolean isError = false; + if (isEmail) { + if (NotifyUtil.isInvalidEmailAddressError(e.getCause())) { + errorInvalidEmailCount++; + } else { + isError = true; + errorCountEmail++; + } + } + if (isSms) { + if (NotifyUtil.isInvalidPhoneNumberError(e.getCause())) { + errorInvalidPhoneCount++; + } else { + isError = true; + errorCountSms++; + } + } + if (isError) { + errorCount++; + log.error( + "Unable to send sent to court comms for {}", + jurorDetail.getJurorNumber(), e + ); + } if (notificationsSent.equals(EMAIL_NOTIFICATION_SENT)) { jurorDetail.getJuror().setNotifications(notificationsSent); update(jurorDetail); } } catch (Exception e) { - log.error("Sent To Court Comms Processing : Juror Comms failed : {}", e.getMessage()); + log.error("Sent To Court Comms Processing : Juror Comms failed : {}", e.getMessage(), e); errorCount++; + if (isEmail) { + errorCountEmail++; + } + if (isSms) { + errorCountSms++; + } } } log.info("Sent To Court Comms Processing : Finished - {}", dateFormat.format(new Date())); @@ -141,7 +165,17 @@ public SchedulerServiceClient.Result process() { errorCount == 0 ? SchedulerServiceClient.Result.Status.SUCCESS : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, null, - Map.of("ERROR_COUNT", "" + errorCount)); + Map.of( + "SUCCESS_COUNT_EMAIL", String.valueOf(successCountEmail), + "SUCCESS_COUNT_SMS", String.valueOf(successCountSms), + "ERROR_COUNT_EMAIL", String.valueOf(errorCountEmail), + "ERROR_COUNT_SMS", String.valueOf(errorCountSms), + "COUNT_INVALID_EMAIL", String.valueOf(errorInvalidEmailCount), + "COUNT_INVALID_PHONE", String.valueOf(errorInvalidPhoneCount), + "SUCCESS_COUNT", String.valueOf(successCount), + "ERROR_COUNT", String.valueOf(errorCount), + "TOTAL_JURORS", String.valueOf(jurordetailList.size()) + )); } /** @@ -149,26 +183,15 @@ public SchedulerServiceClient.Result process() { */ private void update(JurorPool jurorDetails) { try { - log.trace("Inside update ....."); jurorRepository.save(jurorDetails); log.trace("Updating Juror notification as sent ({})... ", jurorDetails.getJuror().getNotifications()); } catch (TransactionSystemException e) { Throwable cause = e.getRootCause(); - // if (poolDetails.getNotifications().equals(EMAIL_NOTIFICATION_SENT)) { - if (jurorDetails.getJuror().getNotifications() == (EMAIL_NOTIFICATION_SENT)) { - log.trace("notifications is : {} - logging error", jurorDetails.getJuror().getNotifications()); - log.error("Failed to update db to {}. Manual update required. {}", - jurorDetails.getJuror().getNotifications(), - cause.toString() - ); - } else { - log.trace("notifications is : {} - throwing excep", jurorDetails.getJuror().getNotifications()); - throw new JurorCommsNotificationServiceException( - "Failed to update db to " - + jurorDetails.getJuror().getNotifications() + ". Manual update required. ", - cause - ); - } + throw new JurorCommsNotificationServiceException( + "Failed to update db to " + + jurorDetails.getJuror().getNotifications() + ". Manual update required. ", + cause + ); } } diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsWeeklyInfoServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsWeeklyInfoServiceImpl.java index 6a93fbec2..b8121d96e 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsWeeklyInfoServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsWeeklyInfoServiceImpl.java @@ -3,7 +3,7 @@ import com.google.common.collect.Lists; import com.querydsl.core.types.dsl.BooleanExpression; -import io.jsonwebtoken.lang.Assert; +import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -15,6 +15,7 @@ import uk.gov.hmcts.juror.api.moj.domain.JurorPool; import uk.gov.hmcts.juror.api.moj.repository.JurorPoolQueries; import uk.gov.hmcts.juror.api.moj.repository.JurorPoolRepository; +import uk.gov.hmcts.juror.api.moj.utils.NotifyUtil; import java.text.SimpleDateFormat; import java.util.Date; @@ -26,26 +27,14 @@ */ @Slf4j @Service +@AllArgsConstructor(onConstructor = @__(@Autowired)) public class JurorCommsWeeklyInfoServiceImpl implements BureauProcessService { private static final Integer NOTIFICATION_SENT = 1; private final JurorCommsNotificationService jurorCommsNotificationService; - - private final JurorPoolRepository jurorRepository; - @Autowired - public JurorCommsWeeklyInfoServiceImpl( - final JurorCommsNotificationService jurorCommsNotificationService, - final JurorPoolRepository jurorRepository) { - Assert.notNull(jurorCommsNotificationService, "JurorCommsNotificationService cannot be null."); - Assert.notNull(jurorRepository, "JurorRepository cannot be null."); - this.jurorCommsNotificationService = jurorCommsNotificationService; - this.jurorRepository = jurorRepository; - - } - /** * Implements a specific job execution. * Processes entries in the Juror table and sends the appropriate email notifications to @@ -66,6 +55,7 @@ public SchedulerServiceClient.Result process() { int infoCommsSent = 0; int noEmailAddress = 0; + int invalidEmailAddress = 0; int infoCommsfailed = 0; for (JurorPool jurorDetail : jurordetailList) { @@ -87,15 +77,17 @@ public SchedulerServiceClient.Result process() { update(jurorDetail); } catch (JurorCommsNotificationServiceException e) { - log.error( - "Unable to send Informational comms for " - + jurorDetail.getJurorNumber() - + " : " + e.getMessage() - + " " + e.getCause().toString(), e - ); - infoCommsfailed++; + if (NotifyUtil.isInvalidEmailAddressError(e.getCause())) { + invalidEmailAddress++; + } else { + log.error( + "Unable to send Informational comms for {}", + jurorDetail.getJurorNumber(), e + ); + infoCommsfailed++; + } } catch (Exception e) { - log.error("Informational Comms Processing : Juror Comms failed : " + e.getMessage(), e); + log.error("Informational Comms Processing : Juror Comms failed", e); infoCommsfailed++; } } @@ -108,9 +100,10 @@ public SchedulerServiceClient.Result process() { ? SchedulerServiceClient.Result.Status.SUCCESS : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, null, Map.of( - "INFO_COMMS_SENT", "" + infoCommsSent, - "INFO_COMMS_FAILED", "" + infoCommsfailed, - "NO_EMAIL_ADDRESS", "" + noEmailAddress + "INFO_COMMS_SENT", String.valueOf(infoCommsSent), + "INFO_COMMS_FAILED", String.valueOf(infoCommsfailed), + "NO_EMAIL_ADDRESS", String.valueOf(noEmailAddress), + "INVALID_EMAIL_ADDRESS", String.valueOf(invalidEmailAddress) )); } diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorDashboardSmartSurveyImportImpl.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorDashboardSmartSurveyImportImpl.java index 2362eef5f..760521fc4 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorDashboardSmartSurveyImportImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorDashboardSmartSurveyImportImpl.java @@ -79,6 +79,7 @@ public SchedulerServiceClient.Result process() { List surveyResponseList; int dbInsertCount = 0; int dbSkipCount = 0; + int errorCount = 0; SmartSurveyConfigurationProperties.Proxy proxyProperties = smartSurveyConfigurationProperties.getProxy(); @@ -86,8 +87,6 @@ public SchedulerServiceClient.Result process() { // these settings are required for the process to continue log.info("Smart Survey config enabled: {}", smartSurveyEnabled); log.info("Smart Survey config exports url: {}", smartSurveyExportsUrl); - //log.info("Smart Survey config token: {}", smartSurveyToken); - //log.info("Smart Survey config secret: {}", smartSurveyTokenSecret); if (!smartSurveyEnabled) { log.info("Smart Survey data import disabled in application settings"); @@ -115,20 +114,16 @@ public SchedulerServiceClient.Result process() { log.info("Smart Survey proxy port: {}", proxyPort); log.info("Smart Survey proxy type: {}", proxyType); - proxy = new Proxy(proxyType, new InetSocketAddress(proxyHost, Integer.valueOf(proxyPort))); + proxy = new Proxy(proxyType, new InetSocketAddress(proxyHost, Integer.parseInt(proxyPort))); } else { - - proxyHost = null; - proxyPort = null; - proxyType = null; proxy = null; - log.info("Smart Survey proxy settings ignored"); } } catch (Exception e) { log.error("Smart Survey unable to create proxy using application settings"); proxy = null; + errorCount++; } // Output settings retrieved from APP_SETTINGS table @@ -149,22 +144,17 @@ public SchedulerServiceClient.Result process() { log.error("Unable to obtain export download url from smart survey api"); throw new IllegalStateException("unable to obtain export download url from smart survey api"); } else { - exportUrl = exportUrl + smartSurveyCredentials; - surveyResponseList = getExportData(exportUrl, vars, startDate, surveyId); } // Add records to table SURVEY_RESPONSE if not existing - if (surveyResponseList.size() > 0) { + if (!surveyResponseList.isEmpty()) { log.info("Smart Survey records parsed (excluding header): {}", surveyResponseList.size()); - for (int i = 0; - i < surveyResponseList.size(); - i++) { + for (SurveyResponse objSurveyResponse : surveyResponseList) { - SurveyResponse objSurveyResponse = surveyResponseList.get(i); SurveyResponseKey objSurveyResponseKey = new SurveyResponseKey(); objSurveyResponseKey.setId(objSurveyResponse.getId()); objSurveyResponseKey.setSurveyId(objSurveyResponse.getSurveyId()); @@ -174,8 +164,8 @@ public SchedulerServiceClient.Result process() { this.surveyResponseRepository.save(objSurveyResponse); dbInsertCount++; } catch (Exception e) { - log.error("Error inserting survey record: {}", e.getMessage()); - log.error("Error inserting survey record: {}", objSurveyResponse); + errorCount++; + log.error("Error inserting survey record: {} - {}", e.getMessage(), objSurveyResponse); } } else { // record already exists @@ -186,6 +176,7 @@ public SchedulerServiceClient.Result process() { log.info("Records inserted: {}", dbInsertCount); log.info("Records skipped: {}", dbSkipCount); + log.info("Records with error: {}", errorCount); } @@ -193,11 +184,16 @@ public SchedulerServiceClient.Result process() { log.info("Smart Survey Processing : FINISHED- {}", dateFormatSurvey.format(new Date())); - return new SchedulerServiceClient.Result(SchedulerServiceClient.Result.Status.SUCCESS, - "Successfully loaded survey records", + return new SchedulerServiceClient.Result(errorCount == 0 + ? SchedulerServiceClient.Result.Status.SUCCESS + : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, + errorCount == 0 + ? "Successfully loaded survey records" + : "Error loading some survey records", Map.of( "RECORDS_INSERTED", String.valueOf(dbInsertCount), - "RECORDS_SKIPPED", String.valueOf(dbSkipCount) + "RECORDS_SKIPPED", String.valueOf(dbSkipCount), + "ERROR_COUNT", String.valueOf(errorCount) )); } @@ -211,9 +207,9 @@ private String getExportDownloadUrl(String smartSurveyUrl, Map v // Get the latest survey export URL from the smart survey API final String configExportName = this.appSetting.getSmartSurveySummonsResponseExportName(); - String smartSurveyExportList = null; - RestTemplate restTemplate = null; - HttpHeaders headers = null; + String smartSurveyExportList; + RestTemplate restTemplate; + HttpHeaders headers; log.info("Smart Survey request url: {}", smartSurveyUrl); log.info("Smart Survey config export name: {}", configExportName); @@ -252,9 +248,7 @@ private String getExportDownloadUrl(String smartSurveyUrl, Map v // Find the latest survey export matching the name set in the config List jsonList = new ArrayList(); - for (int i = 0; - i < jsonArr.length(); - i++) { + for (int i = 0; i < jsonArr.length(); i++) { JSONObject obj = jsonArr.getJSONObject(i); String exportName = obj.getString("name"); @@ -265,7 +259,7 @@ private String getExportDownloadUrl(String smartSurveyUrl, Map v } String exportUrl = null; //Get the Url for the latest export record - first item in list - if (jsonList.size() > 0) { + if (!jsonList.isEmpty()) { JSONObject obj = jsonList.get(0); log.debug("Smart Survey export details: {}", obj); exportUrl = obj.getString("href_download"); @@ -283,9 +277,9 @@ private List getExportData(String smartSurveyUrl, Map surveyResponseList = new ArrayList(); - String smartSurveyExportData = null; - RestTemplate restTemplate = null; - HttpHeaders headers = null; + String smartSurveyExportData; + RestTemplate restTemplate; + HttpHeaders headers; // get export data from Smart Survey API log.info("Smart Survey request url: {}", smartSurveyUrl); @@ -331,9 +325,7 @@ private List getExportData(String smartSurveyUrl, Map 1) { - for (int i = 1; - i < arrCsvRows.length; - i++) { + for (int i = 1; i < arrCsvRows.length; i++) { String csvRow = arrCsvRows[i]; String[] csvCols = csvRow.split(","); diff --git a/src/main/java/uk/gov/hmcts/juror/api/juror/notify/NotifyAdapterImpl.java b/src/main/java/uk/gov/hmcts/juror/api/juror/notify/NotifyAdapterImpl.java index 9bf7f74dd..28a6edd92 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/juror/notify/NotifyAdapterImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/juror/notify/NotifyAdapterImpl.java @@ -9,14 +9,12 @@ import uk.gov.service.notify.NotificationClientException; import uk.gov.service.notify.SendEmailResponse; import uk.gov.service.notify.SendSmsResponse; -//import uk.gov.service.notify.NotificationClient; @Component @Slf4j public class NotifyAdapterImpl implements NotifyAdapter { private final NotifyConfigurationProperties notifyProperties; private final NotificationClientApi notifyClient; - // private final NotificationClient notificationClient; private static final String MESSAGE_1 = "Notify send is disabled? {}"; private static final String MESSAGE_2 = "Notify http response code: {}"; @@ -24,15 +22,12 @@ public class NotifyAdapterImpl implements NotifyAdapter { @Autowired public NotifyAdapterImpl(final NotifyConfigurationProperties notifyProperties, - // final NotificationClient notificationClient, final NotificationClientApi notifyClient) { Assert.notNull(notifyProperties, "NotifyConfigurationProperties cannot be null"); Assert.notNull(notifyClient, "NotificationClient cannot be null"); - // Assert.notNull(notificationClient, "NotificationClient cannot be null"); this.notifyProperties = notifyProperties; this.notifyClient = notifyClient; - // this.notificationClient = notificationClient; } @Override @@ -115,7 +110,6 @@ public EmailNotificationReceipt sendCommsEmail(final EmailNotification notificat log.warn("Juror Comms Notify response was null!"); } } catch (NotificationClientException e) { - //log.error("Failed to send via Notify: {}", e); log.trace(MESSAGE_2, e.getHttpResult()); throw new NotifyApiException("Failed to send Juror Comms via Notify: {}", e); } catch (Exception e) { @@ -152,8 +146,6 @@ public SmsNotificationReceipt sendCommsSms(final SmsNotification notification) t notification.getPayload(), notification.getReferenceNumber() ); - //final SendEmailResponse sendEmailResponse = notifyClient.sendEmail(notification.getTemplateId(), - // notification.getRecipientEmail(), notification.getPayload(), notification.getReferenceNumber()); if (log.isTraceEnabled()) { log.trace("Juror Comms SMS Notify responded: {}", sendSmsResponse); } @@ -164,7 +156,6 @@ public SmsNotificationReceipt sendCommsSms(final SmsNotification notification) t log.warn("Juror Comms SMS Notify response was null!"); } } catch (NotificationClientException e) { - //log.error("Failed to send via Notify: {}", e); log.trace(MESSAGE_2, e.getHttpResult()); throw new NotifyApiException("Failed to send Juror Comms SMS via Notify: {}", e); } catch (Exception e) { diff --git a/src/main/java/uk/gov/hmcts/juror/api/juror/service/ExcusedCompletedCourtCommsServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/juror/service/ExcusedCompletedCourtCommsServiceImpl.java index 9d815d52a..09309fbcf 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/juror/service/ExcusedCompletedCourtCommsServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/juror/service/ExcusedCompletedCourtCommsServiceImpl.java @@ -2,7 +2,6 @@ import com.google.common.collect.Lists; import com.querydsl.core.types.dsl.BooleanExpression; -import io.jsonwebtoken.lang.Assert; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -21,7 +20,7 @@ import uk.gov.hmcts.juror.api.moj.repository.JurorPoolRepository; import uk.gov.hmcts.juror.api.moj.repository.RegionNotifyTemplateQueriesMod; import uk.gov.hmcts.juror.api.moj.repository.RegionNotifyTemplateRepositoryMod; -import uk.gov.hmcts.juror.api.moj.service.AppSettingService; +import uk.gov.hmcts.juror.api.moj.utils.NotifyUtil; import uk.gov.service.notify.NotificationClient; import uk.gov.service.notify.NotificationClientException; import uk.gov.service.notify.SendEmailResponse; @@ -43,40 +42,27 @@ public class ExcusedCompletedCourtCommsServiceImpl implements BureauProcessService { private final JurorPoolRepository jurorRepository; - private final CourtRegionModRepository courtRegionModRepository; private final RegionNotifyTemplateRepositoryMod regionNotifyTemplateRepositoryMod; - private Proxy proxy; + private final NotifyConfigurationProperties notifyConfigurationProperties; + private final NotifyRegionsConfigurationProperties notifyRegionsConfigurationProperties; private final String messagePlaceHolderJurorNumber = "JURORNUMBER"; private final String messagePlaceHolderlocationCode = "lOCATIONCODE"; private final String updateMessageStatusSent = "SENTNOTIFY"; private final String updateMessageStatusNotSent = "NOTSENT"; - private final NotifyConfigurationProperties notifyConfigurationProperties; - private final NotifyRegionsConfigurationProperties notifyRegionsConfigurationProperties; + private Proxy proxy; @Autowired public ExcusedCompletedCourtCommsServiceImpl( - - final AppSettingService appSetting, - final JurorPoolRepository jurorRepository, final CourtRegionModRepository courtRegionModRepository, final NotifyConfigurationProperties notifyConfigurationProperties, final NotifyRegionsConfigurationProperties notifyRegionsConfigurationProperties, - final RegionNotifyTemplateRepositoryMod regionNotifyTemplateRepositoryMod) { - Assert.notNull(jurorRepository, "JurorPoolRepository cannot be null."); - Assert.notNull(appSetting, "AppSettingService cannot be null."); - Assert.notNull(courtRegionModRepository, "CourtRegionModRepository cannot be null."); - Assert.notNull(notifyConfigurationProperties, "NotifyConfigurationProperties cannot be null."); - Assert.notNull(notifyRegionsConfigurationProperties, "NotifyRegionsConfigurationProperties cannot be null."); - - Assert.notNull(regionNotifyTemplateRepositoryMod, "RegionNotifyTemplateRepositoryMod cannot be null."); this.jurorRepository = jurorRepository; this.courtRegionModRepository = courtRegionModRepository; this.notifyConfigurationProperties = notifyConfigurationProperties; this.notifyRegionsConfigurationProperties = notifyRegionsConfigurationProperties; - this.regionNotifyTemplateRepositoryMod = regionNotifyTemplateRepositoryMod; } @@ -99,8 +85,6 @@ public SchedulerServiceClient.Result process() { Map myRegionMap = new HashMap<>(); - @SuppressWarnings("PMD.VariableDeclarationUsageDistance") - int errorCount = 0; List regionIds = setUpRegionIds(); List notifyRegionIds = setUpNotifyRegionKeys(); for (int i = 0; i < notifyRegionIds.size(); i++) { @@ -108,23 +92,40 @@ public SchedulerServiceClient.Result process() { } log.debug("Display myRegionMap {}", myRegionMap); - errorCount += processExcusalList(gotProxy, myRegionMap); - errorCount += processCompleted(gotProxy, myRegionMap); - + final Metrics excusalMetrics = processExcusalList(gotProxy, myRegionMap); + final Metrics completedMetrics = processCompleted(gotProxy, myRegionMap); log.info("Excused Completed Court Comms Processing : Finished - {}", dateFormat.format(new Date())); return new SchedulerServiceClient.Result( - errorCount == 0 + excusalMetrics.errorCount == 0 && completedMetrics.errorCount == 0 ? SchedulerServiceClient.Result.Status.SUCCESS : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, null, - Map.of("ERROR_COUNT", "" + errorCount)); + getMetaData(excusalMetrics, completedMetrics)); + } + + private static Map getMetaData(Metrics excusalMetrics, Metrics completedMetrics) { + Map metaData = new HashMap<>(); + metaData.put("EXCUSAL_IDENTIFIED", String.valueOf(excusalMetrics.jurorPoolsIdentified)); + metaData.put("EXCUSAL_ERROR_COUNT", String.valueOf(excusalMetrics.errorCount)); + metaData.put("EXCUSAL_INVALID_PHONE_COUNT", String.valueOf(excusalMetrics.invalidPhoneCount)); + metaData.put("EXCUSAL_INVALID_EMAIL_COUNT", String.valueOf(excusalMetrics.invalidEmailAddressCount)); + metaData.put("EXCUSAL_SUCCESS_COUNT", String.valueOf(excusalMetrics.successCount)); + metaData.put("EXCUSAL_MISSING_EMAIL_PHONE", String.valueOf(excusalMetrics.missingEmailAndPhone)); + + metaData.put("COMPLETED_IDENTIFIED", String.valueOf(completedMetrics.jurorPoolsIdentified)); + metaData.put("COMPLETED_ERROR_COUNT", String.valueOf(completedMetrics.errorCount)); + metaData.put("COMPLETED_INVALID_PHONE_COUNT", String.valueOf(completedMetrics.invalidPhoneCount)); + metaData.put("COMPLETED_INVALID_EMAIL_COUNT", String.valueOf(completedMetrics.invalidEmailAddressCount)); + metaData.put("COMPLETED_SUCCESS_COUNT", String.valueOf(completedMetrics.successCount)); + metaData.put("COMPLETED_MISSING_EMAIL_PHONE", String.valueOf(completedMetrics.missingEmailAndPhone)); + return metaData; } public Proxy setUpConnection() { final NotifyConfigurationProperties.Proxy setUpProxy = notifyConfigurationProperties.getProxy(); if (setUpProxy != null && setUpProxy.isEnabled()) { String setupHost = setUpProxy.getHost(); - Integer setupPort = Integer.valueOf(setUpProxy.getPort()); + int setupPort = Integer.parseInt(setUpProxy.getPort()); Proxy.Type setupType = setUpProxy.getType(); final InetSocketAddress socketAddress = new InetSocketAddress(setupHost, setupPort); proxy = new Proxy(setupType, socketAddress); @@ -142,14 +143,6 @@ private void updateCommsStatusFlagCompleted(JurorPool poolCourtDetailCompletedLi } catch (TransactionSystemException e) { Throwable cause = e.getRootCause(); if (poolCourtDetailCompletedList.getJuror().getServiceCompCommsStatus() == null) { - log.trace( - "ServiceCompCommsStatus is : {} - logging error", - poolCourtDetailCompletedList.getJuror().getServiceCompCommsStatus() - ); - log.info( - "ServiceCompCommsStatus is : {} - logging error", - poolCourtDetailCompletedList.getJuror().getServiceCompCommsStatus() - ); log.error( "Failed to update db to {}. Manual update required. {}", poolCourtDetailCompletedList.getJuror().getServiceCompCommsStatus(), @@ -178,14 +171,6 @@ private void updateCommsStatusFlagExcusal(JurorPool poolCourtDetailExcusalList) } catch (TransactionSystemException e) { Throwable cause = e.getRootCause(); if (poolCourtDetailExcusalList.getJuror().getServiceCompCommsStatus() == null) { - log.trace( - "ServiceCompCommsStatus is : {} - logging error", - poolCourtDetailExcusalList.getJuror().getServiceCompCommsStatus() - ); - log.info( - "ServiceCompCommsStatus is : {} - logging error", - poolCourtDetailExcusalList.getJuror().getServiceCompCommsStatus() - ); log.error( "Failed to update db to {}. Manual update required. {}", poolCourtDetailExcusalList.getJuror().getServiceCompCommsStatus(), @@ -220,7 +205,6 @@ public List setUpRegionIds() { for (CourtRegionMod courtRegion : courtRegions) { String courtregionIds = courtRegion.getRegionId(); regionIds.add(courtregionIds); - log.info("CourtRegions {}", courtRegion.getRegionId()); } @@ -228,7 +212,7 @@ public List setUpRegionIds() { return regionIds; } - public int processExcusalList(Proxy gotProxy, Map myRegionMap) { + public Metrics processExcusalList(Proxy gotProxy, Map myRegionMap) { final List jurorCourtDetailListExcusal = Lists.newLinkedList(jurorRepository.findAll( JurorPoolQueries.recordsForExcusalComms())); @@ -238,6 +222,12 @@ public int processExcusalList(Proxy gotProxy, Map myRegionMap) { ); int errorCount = 0; + int invalidPhoneCount = 0; + int invalidEmailCount = 0; + int successCount = 0; + int missingEmailAndPhone = 0; + int missingApiKeyCount = 0; + for (JurorPool jurorCourtDetailExcusalList : jurorCourtDetailListExcusal) { log.info("poolCourtDetailExcusalList PART_NO : {}", jurorCourtDetailExcusalList.getJurorNumber()); log.info("Excusal Date: {}", jurorCourtDetailExcusalList.getJuror().getExcusalDate()); @@ -272,12 +262,11 @@ public int processExcusalList(Proxy gotProxy, Map myRegionMap) { if (regionApikey == null || regionApikey.isEmpty()) { - log.error("Missing Notify Api Account key Cannot send notify communication: "); - log.info("Missing Notify Api Account key Cannot send notify communication: "); + log.error("Missing Notify Api Account key Cannot send notify communication"); jurorCourtDetailExcusalList.getJuror().setServiceCompCommsStatus(updateMessageStatusNotSent); updateCommsStatusFlagExcusal(jurorCourtDetailExcusalList); - + missingApiKeyCount++; continue; } @@ -345,13 +334,13 @@ public int processExcusalList(Proxy gotProxy, Map myRegionMap) { } } else { log.info("No Email or phone"); + missingEmailAndPhone++; continue; } for (RegionNotifyTemplateMod regionNotifyTemplateMod : regionNotifyTriggeredExcusalTemplateList) { UUID notificationId; if (hasEmail) { - String emailExcusalTemplateId = regionNotifyTemplateMod.getNotifyTemplateId(); SendEmailResponse emailResponse = notificationClient.sendEmail( emailExcusalTemplateId, @@ -374,26 +363,36 @@ public int processExcusalList(Proxy gotProxy, Map myRegionMap) { if (notificationId != null) { jurorCourtDetailExcusalList.getJuror().setServiceCompCommsStatus(updateMessageStatusSent); updateCommsStatusFlagExcusal(jurorCourtDetailExcusalList); + successCount++; + } else { + errorCount++; } } } catch (NotificationClientException e) { - log.error("Failed to send via Notify: {}", e); - log.trace("Unable to send notify: {}", e.getHttpResult()); - log.info("Unable to send notify: {}", e.getHttpResult()); + log.info("Unable to send notify: {}", e.getMessage()); jurorCourtDetailExcusalList.getJuror().setServiceCompCommsStatus(updateMessageStatusNotSent); updateCommsStatusFlagExcusal(jurorCourtDetailExcusalList); - errorCount++; + if (NotifyUtil.isInvalidPhoneNumberError(e)) { + invalidPhoneCount++; + } else if (NotifyUtil.isInvalidEmailAddressError(e)) { + invalidEmailCount++; + } else { + log.error("Failed to send via Notify: {}", e.getMessage(), e); + errorCount++; + } } catch (Exception e) { - log.info("Unexpected exception: {}", e); + log.error("Unexpected exception: {}", e.getMessage(), e); errorCount++; } } - return errorCount; + return new Metrics(jurorCourtDetailListExcusal.size(), errorCount, successCount, + missingEmailAndPhone, missingApiKeyCount, + invalidPhoneCount, invalidEmailCount); } - private int processCompleted(Proxy gotProxy, Map myRegionMap) { - int errorCount = 0; + private Metrics processCompleted(Proxy gotProxy, Map myRegionMap) { + final List jurorCourtDetailListCompleted = Lists.newLinkedList(jurorRepository.findAll( JurorPoolQueries.recordsForServiceCompletedComms())); @@ -401,7 +400,12 @@ private int processCompleted(Proxy gotProxy, Map myRegionMap) { "jurorCourtDetailListCompleted Number of Completed Records to process {}", jurorCourtDetailListCompleted.size() ); - + int errorCount = 0; + int invalidPhoneCount = 0; + int invalidEmailCount = 0; + int successCount = 0; + int missingEmailAndPhone = 0; + int missingApiKeyCount = 0; for (JurorPool jurorCourtDetailCompletedList : jurorCourtDetailListCompleted) { log.info("jurorCourtDetailListCompleted PART_NO {}", jurorCourtDetailCompletedList.getJurorNumber()); @@ -416,19 +420,13 @@ private int processCompleted(Proxy gotProxy, Map myRegionMap) { final int emailLength = (email != null ? email.length() : 0); if (emailLength == 1) { - jurorCourtDetailCompletedList.getJuror().setEmail(null); - updateCommsStatusFlagCompleted(jurorCourtDetailCompletedList); - } final String locCode = jurorCourtDetailCompletedList.getCourt().getLocCode(); final String jurorNumber = jurorCourtDetailCompletedList.getJurorNumber(); final String reference = jurorCourtDetailCompletedList.getJurorNumber(); - - // String apiKey = (poolCourtDetailCompletedList != null ? poolCourtDetailCompletedList.getCourt() - // .getCourtRegion().getNotifyAccountKey() : null); final String regionId = jurorCourtDetailCompletedList.getCourt().getCourtRegion().getRegionId(); final String regionApikey = myRegionMap.get(regionId); log.debug("regionApikey {} ", regionApikey); @@ -436,10 +434,9 @@ private int processCompleted(Proxy gotProxy, Map myRegionMap) { if (regionApikey == null || regionApikey.isEmpty()) { log.error("Missing Notify Api Account key Cannot send notify communication: "); - log.info("Missing Notify Api Account key Cannot send notify communication: "); jurorCourtDetailCompletedList.getJuror().setServiceCompCommsStatus(updateMessageStatusNotSent); updateCommsStatusFlagCompleted(jurorCourtDetailCompletedList); - + missingApiKeyCount++; continue; } @@ -501,6 +498,8 @@ private int processCompleted(Proxy gotProxy, Map myRegionMap) { regionNotifyTemplateRepositoryMod.findAll(regionNotifyTriggeredCompleteTemplateSmsFilter)); } } else { + log.info("No Email or phone"); + missingEmailAndPhone++; continue; } @@ -534,22 +533,38 @@ private int processCompleted(Proxy gotProxy, Map myRegionMap) { if (notificationId != null) { jurorCourtDetailCompletedList.getJuror().setServiceCompCommsStatus(updateMessageStatusSent); updateCommsStatusFlagCompleted(jurorCourtDetailCompletedList); + successCount++; + } else { + errorCount++; } } } catch (NotificationClientException e) { - - log.error("Failed to send via Notify: {}", e); - log.trace("Unable to send notify: {}", e.getHttpResult()); - log.info("Unable to send notify: {}", e.getHttpResult()); + log.info("Unable to send notify: {}", e.getMessage()); jurorCourtDetailCompletedList.getJuror().setServiceCompCommsStatus(updateMessageStatusNotSent); - updateCommsStatusFlagCompleted(jurorCourtDetailCompletedList); errorCount++; + if (NotifyUtil.isInvalidPhoneNumberError(e)) { + invalidPhoneCount++; + } else if (NotifyUtil.isInvalidEmailAddressError(e)) { + invalidEmailCount++; + } else { + log.error("Failed to send via Notify: {}", e.getMessage(), e); + errorCount++; + } + } catch (Exception e) { - log.info("Unexpected exception: {}", e); + log.error("Unexpected exception:", e); errorCount++; } } - return errorCount; + return new Metrics(jurorCourtDetailListCompleted.size(), errorCount, successCount, + missingEmailAndPhone, missingApiKeyCount, + invalidPhoneCount, invalidEmailCount); + } + + public record Metrics(int jurorPoolsIdentified, int errorCount, int successCount, + int missingEmailAndPhone, int missingApiKeyCount, + int invalidPhoneCount, int invalidEmailAddressCount) { + } } \ No newline at end of file diff --git a/src/main/java/uk/gov/hmcts/juror/api/juror/service/MessagesServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/juror/service/MessagesServiceImpl.java index 0dabd8fc3..378424657 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/juror/service/MessagesServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/juror/service/MessagesServiceImpl.java @@ -5,6 +5,7 @@ import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -21,6 +22,7 @@ import uk.gov.hmcts.juror.api.moj.repository.RegionNotifyTemplateQueriesMod; import uk.gov.hmcts.juror.api.moj.repository.RegionNotifyTemplateRepositoryMod; import uk.gov.hmcts.juror.api.moj.service.AppSettingService; +import uk.gov.hmcts.juror.api.moj.utils.NotifyUtil; import uk.gov.service.notify.NotificationClient; import uk.gov.service.notify.NotificationClientException; import uk.gov.service.notify.SendEmailResponse; @@ -45,7 +47,6 @@ public class MessagesServiceImpl implements BureauProcessService { private static final String MESSAGE_PLACEHOLDER_JUROR = "JURORNUMBER"; private static final String MESSAGE_READ = "SN"; private static final String MESSAGE_READ_APP_ERROR = "NS"; - private static final String MESSAGE_NOT_READ = "NR"; private static final int CHECK_NUM = 1; private static final String LOG_ERROR_MESSAGE_TEMPLATE_ID = " Missing templateId. Cannot send notify " @@ -78,14 +79,10 @@ public SchedulerServiceClient.Result process() { // keys as values Map myRegionMap = new HashMap<>(); - @SuppressWarnings("PMD.VariableDeclarationUsageDistance") - int errorCount = 0; List notifyRegionKeys = setUpNotifyRegionKeys(); List regionIds = setUpRegionIds(); - for (int i = 0; - i < notifyRegionKeys.size(); - i++) { + for (int i = 0; i < notifyRegionKeys.size(); i++) { myRegionMap.put(regionIds.get(i), notifyRegionKeys.get(i)); } @@ -102,6 +99,13 @@ public SchedulerServiceClient.Result process() { Map templateDetailsMap = new HashMap<>(); + int errorCount = 0; + int invalidPhoneCount = 0; + int invalidEmailCount = 0; + int missingApiKeyCount = 0; + int missingEmailAndPhone = 0; + int emailSuccess = 0; + int smsSuccess = 0; for (Message messagesDetail : messageDetailList) { log.info("messagesDetail Juror number : {}", messagesDetail.getJurorNumber()); @@ -124,9 +128,6 @@ public SchedulerServiceClient.Result process() { final String textMessage = messagesDetail.getMessageText(); final String reference = (messagesDetail.getJurorNumber()); - - // String apiKey = (messagesDetail != null ? messagesDetail.getLocationCode().getCourtRegion() - // .getNotifyAccountKey() : null); final String regionId = messagesDetail.getLocationCode().getCourtRegion().getRegionId(); final String regionApikey = myRegionMap.get(regionId); log.debug("regionApikey {} ", regionApikey); @@ -137,7 +138,7 @@ public SchedulerServiceClient.Result process() { regionId); messagesDetail.setMessageRead(MESSAGE_READ_APP_ERROR); updateMessageFlag(messagesDetail); - + missingApiKeyCount++; continue; } @@ -146,10 +147,13 @@ public SchedulerServiceClient.Result process() { personalisation.put(MESSAGE_PLACEHOLDER_JUROR, jurorNumber); - final boolean isEmail = messagesDetail.getEmail() != null; - final boolean isPhone = messagesDetail.getPhone() != null; + final boolean isEmail = StringUtils.isNotBlank(email); + final boolean isPhone = StringUtils.isNotBlank(phoneNumber); if (!isEmail && !isPhone) { + messagesDetail.setMessageRead(MESSAGE_READ_APP_ERROR); + updateMessageFlag(messagesDetail); + missingEmailAndPhone++; continue; } @@ -184,11 +188,13 @@ public SchedulerServiceClient.Result process() { smsTemplateId, email, personalisation, reference); response = emailResponse; notificationId = emailResponse.getNotificationId(); + emailSuccess++; } else if (isPhone) { SendSmsResponse smsResponse = notifyClient.sendSms(smsTemplateId, phoneNumber, personalisation, reference); response = smsResponse; notificationId = smsResponse.getNotificationId(); + smsSuccess++; } if (notificationId != null) { @@ -198,10 +204,17 @@ public SchedulerServiceClient.Result process() { log.trace("Court Comms sms messaging Service : response {}", response); } } catch (NotificationClientException e) { - log.error("Failed to send via Notify", e); + log.info("Failed to send via Notify - {}", e.getMessage()); messagesDetail.setMessageRead(MESSAGE_READ_APP_ERROR); updateMessageFlag(messagesDetail); - errorCount++; + if (NotifyUtil.isInvalidPhoneNumberError(e)) { + invalidPhoneCount++; + } else if (NotifyUtil.isInvalidEmailAddressError(e)) { + invalidEmailCount++; + } else { + log.error("Failed to send via Notify", e); + errorCount++; + } } catch (Exception e) { log.error("Unexpected exception when sending details to notify", e); errorCount++; @@ -213,7 +226,17 @@ public SchedulerServiceClient.Result process() { errorCount == 0 ? SchedulerServiceClient.Result.Status.SUCCESS : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, null, - Map.of("ERROR_COUNT", "" + errorCount)); + Map.of( + "TOTAL_MESSAGES_TO_SEND", String.valueOf(messageDetailList.size()), + "ERROR_COUNT", String.valueOf(errorCount), + "MISSING_API_KEY_COUNT", String.valueOf(missingApiKeyCount), + "MISSING_EMAIL_AND_PHONE", String.valueOf(missingEmailAndPhone), + "EMAIL_SUCCESS", String.valueOf(emailSuccess), + "SMS_SUCCESS", String.valueOf(smsSuccess), + + "INVALID_PHONE_COUNT", String.valueOf(invalidPhoneCount), + "INVALID_EMAIL_COUNT", String.valueOf(invalidEmailCount) + )); } private TemplateDetails createTemplateDetails(Message messagesDetail) { diff --git a/src/main/java/uk/gov/hmcts/juror/api/moj/domain/JurorPool.java b/src/main/java/uk/gov/hmcts/juror/api/moj/domain/JurorPool.java index f2b7be85b..f7931fb30 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/moj/domain/JurorPool.java +++ b/src/main/java/uk/gov/hmcts/juror/api/moj/domain/JurorPool.java @@ -98,7 +98,7 @@ public class JurorPool implements Serializable { private LocalDate nextDate; @Column(name = "on_call") - private Boolean onCall; + private boolean onCall; @Length(max = 20) @Column(name = "smart_card") diff --git a/src/main/java/uk/gov/hmcts/juror/api/moj/repository/IAppearanceRepositoryImpl.java b/src/main/java/uk/gov/hmcts/juror/api/moj/repository/IAppearanceRepositoryImpl.java index e97749033..29f0d5fdb 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/moj/repository/IAppearanceRepositoryImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/moj/repository/IAppearanceRepositoryImpl.java @@ -93,9 +93,10 @@ public List retrieveAttendanceDetails(RetrieveAttendanceDetailsDto reques || commonData.getTag().equals(RetrieveAttendanceDetailsTag.PANELLED)) { query = query.where(APPEARANCE.appearanceStage.eq(AppearanceStage.CHECKED_IN)); } else if (commonData.getTag().equals(RetrieveAttendanceDetailsTag.CONFIRM_ATTENDANCE)) { - // a confirmed juror can have appStage of CheckedIn or CheckedOut therefore cannot rely on appStage. A - // confirmed juror will always have TimeIn. - query = query.where(APPEARANCE.timeIn.isNotNull()); + query = query.where(APPEARANCE.timeIn.isNotNull()) + .where(APPEARANCE.appearanceStage.in(AppearanceStage.CHECKED_IN, AppearanceStage.CHECKED_OUT)) + .where(APPEARANCE.attendanceAuditNumber.isNull()) + .where(APPEARANCE.appearanceConfirmed.isFalse()); } // execute the query and return the results @@ -294,13 +295,13 @@ public Optional findByJurorNumberAndLocCodeAndAttendanceDateAndVersi try { return Optional.ofNullable((Appearance) AuditReaderFactory.get(entityManager) - .createQuery() - .forRevisionsOfEntity(Appearance.class, true, false) - .add(AuditEntity.property("jurorNumber").eq(jurorNumber)) - .add(AuditEntity.property("locCode").eq(locCode)) - .add(AuditEntity.property("attendanceDate").eq(attendanceDate)) - .add(AuditEntity.property("version").eq(appearanceVersion)) - .getSingleResult()); + .createQuery() + .forRevisionsOfEntity(Appearance.class, true, false) + .add(AuditEntity.property("jurorNumber").eq(jurorNumber)) + .add(AuditEntity.property("locCode").eq(locCode)) + .add(AuditEntity.property("attendanceDate").eq(attendanceDate)) + .add(AuditEntity.property("version").eq(appearanceVersion)) + .getSingleResult()); } catch (NoResultException e) { return Optional.empty(); } diff --git a/src/main/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceImpl.java index d4f717687..1528729b2 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceImpl.java @@ -5,7 +5,6 @@ import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.text.WordUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.history.Revision; @@ -602,7 +601,7 @@ public void updateAttendance(UpdateAttendanceRequestDto dto) { private void validateOnCall(JurorPool jurorPool) { - if (jurorPool.getOnCall() != null && jurorPool.getOnCall().equals(true)) { + if (jurorPool.isOnCall()) { throw new MojException.BadRequest("Juror status is already on call", null); } } @@ -1197,7 +1196,7 @@ public JurorAttendanceDetailsResponseDto getJurorAttendanceDetails(String locCod responseDto.setNonAttendances((int) jurorAttendanceDetails.stream() .filter(p -> AttendanceType.NON_ATTENDANCE.equals(p.getAttendanceType())).count()); - responseDto.setOnCall(ObjectUtils.defaultIfNull(jurorPool.getOnCall(), false)); + responseDto.setOnCall(jurorPool.isOnCall()); responseDto.setNextDate(jurorPool.getNextDate()); return responseDto; diff --git a/src/main/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImpl.java index 45ba28f1d..2a93fb584 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImpl.java @@ -269,13 +269,15 @@ public void returnJury(BureauJwtPayload payload, String trialNumber, String loca appearance.setTimeOut(LocalTime.parse(returnJuryDto.getCheckOut())); log.debug("setting time out for juror %s".formatted(jurorNumber)); } - //Only give them an attendance number if they were checked out via this process - appearance.setAttendanceAuditNumber("J" + attendanceAuditNumber); + if (appearance.getAttendanceAuditNumber() == null) { + //Only give them an attendance number if they were checked out via this process + appearance.setAttendanceAuditNumber("J" + attendanceAuditNumber); + jurorHistoryService.createJuryAttendanceHistory(jurorPool, appearance, panel); + } } appearance.setTrialNumber(trialNumber); appearance.setSatOnJury(true); jurorAppearanceService.realignAttendanceType(appearance); - jurorHistoryService.createJuryAttendanceHistory(jurorPool, appearance, panel); } panel.setResult(PanelResult.RETURNED); diff --git a/src/main/java/uk/gov/hmcts/juror/api/moj/utils/NotifyUtil.java b/src/main/java/uk/gov/hmcts/juror/api/moj/utils/NotifyUtil.java new file mode 100644 index 000000000..bc764fcc4 --- /dev/null +++ b/src/main/java/uk/gov/hmcts/juror/api/moj/utils/NotifyUtil.java @@ -0,0 +1,28 @@ +package uk.gov.hmcts.juror.api.moj.utils; + +import uk.gov.service.notify.NotificationClientException; + +public final class NotifyUtil { + + private NotifyUtil() { + + } + + public static boolean isInvalidPhoneNumberError(Throwable e) { + return doesMessageContain(e, "phone_number is a required property") + || doesMessageContain(e, "InvalidPhoneError"); + } + + public static boolean isInvalidEmailAddressError(Throwable e) { + return doesMessageContain(e, "email_address is a required property") + || doesMessageContain(e, "InvalidEmailAddressError"); + } + + public static boolean doesMessageContain(Throwable e, String message) { + if (e instanceof NotificationClientException notificationClientException) { + return notificationClientException.getMessage() != null + && notificationClientException.getMessage().contains(message); + } + return false; + } +} diff --git a/src/main/resources/db/migrationv2/V2_29__on_call_updates.sql b/src/main/resources/db/migrationv2/V2_29__on_call_updates.sql new file mode 100644 index 000000000..ee1002833 --- /dev/null +++ b/src/main/resources/db/migrationv2/V2_29__on_call_updates.sql @@ -0,0 +1,7 @@ +update juror_mod.juror_pool jp +set on_call = false +where jp.on_call is null; + +alter table juror_mod.juror_pool + ALTER COLUMN on_call SET DEFAULT false, + ALTER COLUMN on_call SET NOT NULL; \ No newline at end of file diff --git a/src/main/resources/db/migrationv2/V2_30__util_report_update.sql b/src/main/resources/db/migrationv2/V2_30__util_report_update.sql new file mode 100644 index 000000000..ec6aedf16 --- /dev/null +++ b/src/main/resources/db/migrationv2/V2_30__util_report_update.sql @@ -0,0 +1,23 @@ + +-- utility function to return list of all days within the report window and holiday flag +-- updated to correctly handle no trial days added by a court and multiple holidays on the same day +CREATE OR REPLACE FUNCTION juror_mod.util_report_report_days_list(p_loc_code text, p_start_date date, p_end_date date) + RETURNS TABLE(report_date date, holiday boolean) + LANGUAGE plpgsql +AS $function$ +begin + +return query + +with report_days as ( +select generate_series(p_start_date, p_end_date, '1 day'::interval)::date as report_day) + +select distinct(report_days.report_day) as report_date, + case when h.holiday is not null then true else false end as holiday +from report_days + left join juror_mod.holiday h on (report_days.report_day = h.holiday and (h.loc_code is null or h.loc_code = p_loc_code)) +order by report_days.report_day; + + END; +$function$ +; diff --git a/src/main/resources/db/migrationv2/V2_31__util_report_update.sql b/src/main/resources/db/migrationv2/V2_31__util_report_update.sql new file mode 100644 index 000000000..1c126fe38 --- /dev/null +++ b/src/main/resources/db/migrationv2/V2_31__util_report_update.sql @@ -0,0 +1,38 @@ + +-- This function is used to generate a list of jurors who are in a pool during a given date range. +-- Updated the query to only count genuine appearances rather than non-attendance or no-shows. +CREATE OR REPLACE FUNCTION juror_mod.util_report_pool_members_list(p_loc_code text, p_start_date date, p_end_date date) + RETURNS TABLE(juror_number character varying, attendance_date date, return_date date, service_start_date date, service_end_date date, min_status integer) + LANGUAGE plpgsql +AS $function$ +begin + + return query select + jp.juror_number, + min(a.attendance_date) attendance_date, + min(case when jp.is_active = true then p.return_date else to_date('01/12/2099', 'dd/mm/yyyy') end ) return_date, + greatest(least(coalesce(min(a.attendance_date), min(case when jp.is_active = true then p.return_date else to_date('01/12/2099', 'dd/mm/yyyy') end )), + min(case when jp.is_active = true then p.return_date else to_date('01/12/2099','dd/mm/yyyy') end )), p_start_date) service_start, + -- figure out if an appearance occurred before service start date and use that if applicable + least(min(coalesce(case when jp.status = 10 then jp.transfer_date else date(j.completion_date) end, p_end_date)),p_end_date) service_end, + min(status) min_status + from juror_mod.juror_pool jp + join juror_mod.juror j + on jp.juror_number = j.juror_number + join juror_mod.pool p + on jp.pool_number = p.pool_no + left join juror_mod.appearance a + on jp.juror_number = a.juror_number + where p.loc_code = a.loc_code + and (((jp.status in (2,3,4,10,13) or (jp.status = 7 and a.attendance_date is not null)) and jp.is_active = true) + or (jp.status = 8 and a.attendance_date is not null and j.completion_date is not null)) + and (a.non_attendance is null or a.non_attendance = false) and (a.no_show is null or a.no_show = false) + and p.loc_code = p_loc_code + and ((jp.status = 10 and jp.transfer_date >= p_start_date) + or (jp.status <> 10 and (j.completion_date is null or j.completion_date >= p_start_date))) + group by jp.juror_number + having (least(coalesce(min(a.attendance_date), min(case when jp.is_active = true then p.return_date else to_date('01/12/2099', 'dd/mm/yyyy') end)), + min(case when jp.is_active = true then p.return_date else to_date('01/12/2099', 'dd/mm/yyyy') end)) <= p_end_date); +END; +$function$ +; diff --git a/src/test/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceTest.java b/src/test/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceTest.java index d28840f9c..d3a763345 100644 --- a/src/test/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceTest.java +++ b/src/test/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceTest.java @@ -2276,7 +2276,7 @@ void updateAttendanceHappyPathOnCall() { verify(jurorPoolRepository, times(1)).save(jurorPool); - assertThat(jurorPool.getOnCall()).isTrue(); + assertThat(jurorPool.isOnCall()).isTrue(); assertThat(jurorPool.getNextDate()).isNull(); } @@ -2303,7 +2303,7 @@ void updateAttendanceHappyPathChangeNextDate() { verify(jurorPoolRepository, times(1)).save(jurorPool); assertThat(jurorPool.getNextDate()).isEqualTo(dto.getNextDate()); - assertThat(jurorPool.getOnCall()).isFalse(); + assertThat(jurorPool.isOnCall()).isFalse(); } diff --git a/src/test/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImplTest.java b/src/test/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImplTest.java index 2a2206550..4d2978c85 100644 --- a/src/test/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImplTest.java +++ b/src/test/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImplTest.java @@ -447,7 +447,7 @@ void testReturnJuryNoConfirmAttendanceNullTimes() { verify(panelRepository, times(1)) .findByTrialTrialNumberAndTrialCourtLocationLocCode(trialNumber, "415"); verify(panelRepository, times(panelMembers.size())).saveAndFlush(any()); - verify(jurorHistoryService, times(panelMembers.size())).createJuryAttendanceHistory(any(), any(), any()); + verify(jurorHistoryService, never()).createJuryAttendanceHistory(any(), any(), any()); verify(jurorAppearanceService, times(panelMembers.size())).realignAttendanceType(any(Appearance.class)); } From 42f36c709ed9ea328a29d0874c0f437f596d573b Mon Sep 17 00:00:00 2001 From: akikrahman1 <149579836+akikrahman1@users.noreply.github.com> Date: Mon, 9 Sep 2024 15:56:32 +0100 Subject: [PATCH 2/6] Hotfix/jm 8102 (#760) * hotfix/JM-8102 fix for missing days * updated flyway migration name to avoid conflict From 02420aa4c63bd5cab77052c5d9c22c688fb1b426 Mon Sep 17 00:00:00 2001 From: akikrahman1 Date: Mon, 9 Sep 2024 17:26:06 +0100 Subject: [PATCH 3/6] Revert "Hotfix/jm 7928 (#761)" This reverts commit 2c0c871c78e6e4701851da556e346efdd7a20f46. --- build.gradle | 2 +- .../CompleteServiceControllerITest.java | 6 +- .../JurorManagementControllerITest.java | 8 +- .../controller/ManagePoolControllerITest.java | 2 +- .../moj/controller/TrialControllerITest.java | 4 +- ...leteServiceController_InitPoolsAtCourt.sql | 24 +-- ...agementController_poolsAtCourtLocation.sql | 22 +-- .../JurorPaperResponse_initPaperResponse.sql | 2 +- ...orRecordController_bureauDigitalDetail.sql | 2 +- ...estPoolController_poolsAtCourtLocation.sql | 40 ++--- .../UpdateAttendanceDetails.sql | 6 +- ...ontroller_initInformationRequestLetter.sql | 14 +- .../db/mod/reports/AbsencesReportITest.sql | 12 +- .../DailyUtilisationReportsITest_typical.sql | 68 ++++---- .../IncompleteServiceReportITest_typical.sql | 10 +- .../reports/JurySummoningMonitor_typical.sql | 86 +++++----- ...sonAttendingSummaryReportITest_typical.sql | 10 +- .../YieldPerformanceReportITest_typical.sql | 104 ++++++------ .../JurorCommsCronBatchController.java | 9 +- .../scheduler/BureauBatchScheduler.java | 13 +- .../scheduler/UrgentStatusScheduler.java | 9 +- .../service/JurorCommsLetterServiceImpl.java | 49 ++++-- .../JurorCommsSentToCourtServiceImpl.java | 119 ++++++------- .../JurorCommsWeeklyInfoServiceImpl.java | 43 +++-- .../JurorDashboardSmartSurveyImportImpl.java | 58 ++++--- .../api/juror/notify/NotifyAdapterImpl.java | 9 + ...ExcusedCompletedCourtCommsServiceImpl.java | 159 ++++++++---------- .../juror/service/MessagesServiceImpl.java | 53 ++---- .../hmcts/juror/api/moj/domain/JurorPool.java | 2 +- .../repository/IAppearanceRepositoryImpl.java | 21 ++- .../moj/service/JurorRecordServiceImpl.java | 5 +- .../moj/service/trial/TrialServiceImpl.java | 8 +- .../hmcts/juror/api/moj/utils/NotifyUtil.java | 28 --- .../db/migrationv2/V2_29__on_call_updates.sql | 7 - .../migrationv2/V2_30__util_report_update.sql | 23 --- .../migrationv2/V2_31__util_report_update.sql | 38 ----- .../moj/service/JurorRecordServiceTest.java | 4 +- .../service/trial/TrialServiceImplTest.java | 2 +- 38 files changed, 485 insertions(+), 596 deletions(-) delete mode 100644 src/main/java/uk/gov/hmcts/juror/api/moj/utils/NotifyUtil.java delete mode 100644 src/main/resources/db/migrationv2/V2_29__on_call_updates.sql delete mode 100644 src/main/resources/db/migrationv2/V2_30__util_report_update.sql delete mode 100644 src/main/resources/db/migrationv2/V2_31__util_report_update.sql diff --git a/build.gradle b/build.gradle index 10419590e..3d60d8c5f 100644 --- a/build.gradle +++ b/build.gradle @@ -287,7 +287,7 @@ pmdTest { maxFailures = 292 } pmdMain { - maxFailures = 752 + maxFailures = 763 } pmd { maxFailures = 0 diff --git a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/CompleteServiceControllerITest.java b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/CompleteServiceControllerITest.java index e2d10c736..7477b394b 100644 --- a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/CompleteServiceControllerITest.java +++ b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/CompleteServiceControllerITest.java @@ -43,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; @@ -75,7 +74,8 @@ private void validateJurorWasCompleted(LocalDate completionTime, String jurorNum JurorPool jurorPool = jurorPoolRepository.findByJurorJurorNumberAndPoolPoolNumber(jurorNumber, poolNumber); assertEquals(true, jurorPool.getIsActive(), "Juror pool should be active"); - assertFalse(jurorPool.isOnCall(), "Juror pool should not be on call"); + assertEquals(false, jurorPool.getOnCall(), + "Juror pool should not be on call"); assertEquals(IJurorStatus.COMPLETED, jurorPool.getStatus().getStatus(), "Juror pool status should be completed"); Juror juror = jurorPool.getJuror(); @@ -85,7 +85,7 @@ private void validateJurorWasCompleted(LocalDate completionTime, String jurorNum if (isDismissal) { assertThat(jurorPool.getNextDate()).isNull(); - assertThat(jurorPool.isOnCall()).isFalse(); + assertThat(jurorPool.getOnCall()).isFalse(); } List jurorHistories = jurorHistoryRepository.findByJurorNumberOrderById(jurorNumber); assertEquals(1, jurorHistories.size(), "Should only be one history entry"); diff --git a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/JurorManagementControllerITest.java b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/JurorManagementControllerITest.java index 9924f413f..065df049d 100644 --- a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/JurorManagementControllerITest.java +++ b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/JurorManagementControllerITest.java @@ -607,7 +607,7 @@ void updateAttendanceCheckOutAllJurors() { AttendanceDetailsResponse.Summary summary = response.getBody().getSummary(); assertThat(summary) .extracting(AttendanceDetailsResponse.Summary::getCheckedOut) - .isEqualTo(5L); + .isEqualTo(3L); assertThat(summary) .extracting(AttendanceDetailsResponse.Summary::getPanelled) @@ -1032,7 +1032,7 @@ void updateAttendanceNoShow() { AttendanceDetailsResponse.Summary summary = response.getBody().getSummary(); assertThat(summary) .extracting(AttendanceDetailsResponse.Summary::getCheckedIn) - .isEqualTo(5L); + .isEqualTo(4L); assertThat(summary) .extracting(AttendanceDetailsResponse.Summary::getAbsent) @@ -1282,7 +1282,7 @@ void updateAttendanceDateOnCallFlagUpdated() { // check the on-call flag before invoking the api Boolean onCallFlagBefore = - jurorPoolRepository.findByJurorJurorNumberAndPoolPoolNumber(JUROR6, POOL_NUMBER_415230101).isOnCall(); + jurorPoolRepository.findByJurorJurorNumberAndPoolPoolNumber(JUROR6, POOL_NUMBER_415230101).getOnCall(); assertThat(onCallFlagBefore).as("On-call flag should be True").isEqualTo(Boolean.TRUE); ResponseEntity responseEntity = @@ -1296,7 +1296,7 @@ void updateAttendanceDateOnCallFlagUpdated() { // verify the on-call flag was updated successfully Boolean onCallFlagAfter = - jurorPoolRepository.findByJurorJurorNumberAndPoolPoolNumber(JUROR6, POOL_NUMBER_415230101).isOnCall(); + jurorPoolRepository.findByJurorJurorNumberAndPoolPoolNumber(JUROR6, POOL_NUMBER_415230101).getOnCall(); assertThat(onCallFlagAfter).as("On-call flag should be False").isEqualTo(Boolean.FALSE); } diff --git a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/ManagePoolControllerITest.java b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/ManagePoolControllerITest.java index 75aba4561..4b14b9255 100644 --- a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/ManagePoolControllerITest.java +++ b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/ManagePoolControllerITest.java @@ -2147,7 +2147,7 @@ private void transferJurorPoolValidateNewlyCreatedJurorPool(String jurorNumber, assertThat(targetJurorPool.getEditTag()) .as(EXPECT_PROPERTY_TO_BE_USE_A_DEFAULT_VALUE) .isNull(); - assertThat(targetJurorPool.isOnCall()) + assertThat(targetJurorPool.getOnCall()) .as(EXPECT_PROPERTY_TO_BE_USE_A_DEFAULT_VALUE) .isFalse(); assertThat(targetJurorPool.getSmartCard()) diff --git a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/TrialControllerITest.java b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/TrialControllerITest.java index 4fd238027..be3ee9a23 100644 --- a/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/TrialControllerITest.java +++ b/src/integration-test/java/uk/gov/hmcts/juror/api/moj/controller/TrialControllerITest.java @@ -800,8 +800,8 @@ void testReturnJuryNoConfirmAttendance() { "Expect status to be Responded").isEqualTo(IJurorStatus.RESPONDED); assertThat( jurorHistoryRepository.findByJurorNumberOrderById(panel.getJurorNumber()).size()) - .as("Expect one history item for juror " + panel.getJurorNumber()) - .isEqualTo(1); + .as("Expect two history item for juror " + panel.getJurorNumber()) + .isEqualTo(2); Appearance appearance = appearanceRepository.findByLocCodeAndJurorNumberAndAttendanceDate("415", panel.getJurorNumber(), diff --git a/src/integration-test/resources/db/CompleteServiceController_InitPoolsAtCourt.sql b/src/integration-test/resources/db/CompleteServiceController_InitPoolsAtCourt.sql index 1195d3d14..6b710503e 100644 --- a/src/integration-test/resources/db/CompleteServiceController_InitPoolsAtCourt.sql +++ b/src/integration-test/resources/db/CompleteServiceController_InitPoolsAtCourt.sql @@ -105,18 +105,18 @@ INSERT INTO juror_mod.juror (juror_number, last_name, first_name, dob, address_l ('641800002', 'PERSON', 'TEST', '1990-05-16', '542 STREET NAME', 'ANYTOWN', 'CH1 2AN', true, null), ('641800003', 'PERSON', 'TEST', '1990-05-16', '542 STREET NAME', 'ANYTOWN', 'CH1 2AN', true, '2023-10-24'); -INSERT INTO juror_mod.juror_pool (owner, juror_number, pool_number, is_active, next_date, status) VALUES -('400', '641600001', '416230101', true, '2023-01-23', 2), -('416', '641600002', '416230103', true, '2023-01-23', 13), -('417', '641700001', '417230101', true, '2023-01-09', 13), -('417', '641700002', '417230101', true, '2023-01-09', 7), -('417', '641700003', '417230101', true, '2023-01-09', 2), -('417', '641700004', '417230101', true, '2023-01-09', 2), -('417', '641700005', '417230101', true, '2023-01-09', 4), -('417', '641700006', '417230101', true, '2023-01-09', 2), -('418', '641800001', '418230101', true, '2023-10-25', 2), -('418', '641800002', '418230102', true, '2023-10-23', 2), -('418', '641800003', '418230103', true, '2023-10-23', 13); +INSERT INTO juror_mod.juror_pool (owner, juror_number, pool_number, is_active, next_date, status, on_call) VALUES +('400', '641600001', '416230101', true, '2023-01-23', 2, null), +('416', '641600002', '416230103', true, '2023-01-23', 13, null), +('417', '641700001', '417230101', true, '2023-01-09', 13, null), +('417', '641700002', '417230101', true, '2023-01-09', 7, null), +('417', '641700003', '417230101', true, '2023-01-09', 2, null), +('417', '641700004', '417230101', true, '2023-01-09', 2, true), +('417', '641700005', '417230101', true, '2023-01-09', 4, null), +('417', '641700006', '417230101', true, '2023-01-09', 2, null), +('418', '641800001', '418230101', true, '2023-10-25', 2, null), +('418', '641800002', '418230102', true, '2023-10-23', 2, null), +('418', '641800003', '418230103', true, '2023-10-23', 13, null); INSERT INTO juror_mod.appearance (attendance_date,juror_number,pool_number,loc_code,f_audit,time_in,time_out,travel_time,appearance_stage,non_attendance) VALUES diff --git a/src/integration-test/resources/db/JurorManagementController_poolsAtCourtLocation.sql b/src/integration-test/resources/db/JurorManagementController_poolsAtCourtLocation.sql index a48472d56..42acc10dd 100644 --- a/src/integration-test/resources/db/JurorManagementController_poolsAtCourtLocation.sql +++ b/src/integration-test/resources/db/JurorManagementController_poolsAtCourtLocation.sql @@ -112,18 +112,18 @@ INSERT INTO juror_mod.juror (juror_number, last_name, first_name, dob, address_l ('641800003', 'PERSON', 'TEST', '1990-05-16', '542 STREET NAME', 'ANYTOWN', 'CH1 2AN', true, '2023-10-24'); INSERT INTO juror_mod.juror_pool (owner, juror_number, pool_number, is_active, next_date, status, on_call) VALUES -('400', '641600001', '416230101', true, '2023-01-23', 2, false), -('416', '641600002', '416230103', true, '2023-01-23', 13, false), -('415', '641500001', '415230101', true, current_date - 10, 13, false), -('415', '641500002', '415230101', true, current_date - 10, 7, false), -('415', '641500003', '415230101', true, current_date - 10, 2, false), +('400', '641600001', '416230101', true, '2023-01-23', 2, null), +('416', '641600002', '416230103', true, '2023-01-23', 13, null), +('415', '641500001', '415230101', true, current_date - 10, 13, null), +('415', '641500002', '415230101', true, current_date - 10, 7, null), +('415', '641500003', '415230101', true, current_date - 10, 2, null), ('415', '641500004', '415230101', true, current_date - 10, 2, true), -('415', '641500005', '415230101', true, current_date - 10, 4, false), -('415', '641500006', '415230101', true, current_date - 10, 2, false), -('415', '641500007', '415230101', true, current_date - 10, 2, false), -('418', '641800001', '418230101', true, '2023-10-25', 2, false), -('418', '641800002', '418230102', true, '2023-10-23', 2, false), -('418', '641800003', '418230103', true, '2023-10-23', 13, false); +('415', '641500005', '415230101', true, current_date - 10, 4, null), +('415', '641500006', '415230101', true, current_date - 10, 2, null), +('415', '641500007', '415230101', true, current_date - 10, 2, null), +('418', '641800001', '418230101', true, '2023-10-25', 2, null), +('418', '641800002', '418230102', true, '2023-10-23', 2, null), +('418', '641800003', '418230103', true, '2023-10-23', 13, null); INSERT INTO juror_mod.appearance (attendance_date,juror_number,pool_number,loc_code,f_audit,time_in,time_out,travel_time,appearance_stage,non_attendance) VALUES (current_date,'641500003','415230101','415',123456789,'09:30:00',null,'01:12','CHECKED_IN',false); diff --git a/src/integration-test/resources/db/JurorPaperResponse_initPaperResponse.sql b/src/integration-test/resources/db/JurorPaperResponse_initPaperResponse.sql index 15d913dd8..2ddb8b748 100644 --- a/src/integration-test/resources/db/JurorPaperResponse_initPaperResponse.sql +++ b/src/integration-test/resources/db/JurorPaperResponse_initPaperResponse.sql @@ -50,7 +50,7 @@ VALUES ('415', '111111111', '415220502', true, CURRENT_DATE + interval '6 weeks' ('400', '121314151', '415220502', true, CURRENT_DATE + interval '6 weeks', 2); INSERT INTO juror_mod.juror_pool(juror_number, pool_number, "owner", user_edtq, is_active, status, times_sel, def_date, "location", no_attendances, no_attended, no_fta, no_awol, pool_seq, edit_tag, next_date, on_call, smart_card, was_deferred, deferral_code, id_checked, postpone, paid_cash, scan_code, last_update, reminder_sent, transfer_date, date_created) VALUES -('641500001', '415240601', '415', 'court-southwark', true, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0002', NULL, '2024-06-11', false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-09 15:07:32.570', NULL, NULL, '2024-04-09 15:06:58.069'); +('641500001', '415240601', '415', 'court-southwark', true, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0002', NULL, '2024-06-11', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-09 15:07:32.570', NULL, NULL, '2024-04-09 15:06:58.069'); INSERT INTO juror_mod.juror_pool(juror_number, pool_number, "owner", user_edtq, is_active, status, times_sel, def_date, "location", no_attendances, no_attended, no_fta, no_awol, pool_seq, edit_tag, next_date, on_call, smart_card, was_deferred, deferral_code, id_checked, postpone, paid_cash, scan_code, last_update, reminder_sent, transfer_date, date_created) VALUES ('641500001', '471240401', '471', 'court-southwark', true, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0001', NULL, '2024-04-29', false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-09 15:12:48.674', NULL, NULL, '2024-04-09 15:12:48.674'); diff --git a/src/integration-test/resources/db/JurorRecordController_bureauDigitalDetail.sql b/src/integration-test/resources/db/JurorRecordController_bureauDigitalDetail.sql index 1498d7fbb..f896adb92 100644 --- a/src/integration-test/resources/db/JurorRecordController_bureauDigitalDetail.sql +++ b/src/integration-test/resources/db/JurorRecordController_bureauDigitalDetail.sql @@ -56,7 +56,7 @@ INSERT INTO juror_mod.juror_pool (owner, juror_number, pool_number, is_active, n ('400', '555555555', '457230801', true, '2022-05-03', 2); INSERT INTO juror_mod.juror_pool(juror_number, pool_number, "owner", user_edtq, is_active, status, times_sel, def_date, "location", no_attendances, no_attended, no_fta, no_awol, pool_seq, edit_tag, next_date, on_call, smart_card, was_deferred, deferral_code, id_checked, postpone, paid_cash, scan_code, last_update, reminder_sent, transfer_date, date_created) VALUES -('641500001', '415240601', '415', 'court-southwark', true, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0002', NULL, '2024-06-11', false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-09 15:07:32.570', NULL, NULL, '2024-04-09 15:06:58.069'); +('641500001', '415240601', '415', 'court-southwark', true, 10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0002', NULL, '2024-06-11', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-09 15:07:32.570', NULL, NULL, '2024-04-09 15:06:58.069'); INSERT INTO juror_mod.juror_pool(juror_number, pool_number, "owner", user_edtq, is_active, status, times_sel, def_date, "location", no_attendances, no_attended, no_fta, no_awol, pool_seq, edit_tag, next_date, on_call, smart_card, was_deferred, deferral_code, id_checked, postpone, paid_cash, scan_code, last_update, reminder_sent, transfer_date, date_created) VALUES ('641500001', '471240401', '471', 'court-southwark', true, 2, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0001', NULL, '2024-04-29', false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-04-09 15:12:48.674', NULL, NULL, '2024-04-09 15:12:48.674'); diff --git a/src/integration-test/resources/db/RequestPoolController_poolsAtCourtLocation.sql b/src/integration-test/resources/db/RequestPoolController_poolsAtCourtLocation.sql index 48fbae21e..8ed90e210 100644 --- a/src/integration-test/resources/db/RequestPoolController_poolsAtCourtLocation.sql +++ b/src/integration-test/resources/db/RequestPoolController_poolsAtCourtLocation.sql @@ -98,27 +98,27 @@ INSERT INTO juror_mod.juror (juror_number, last_name, first_name, dob, address_l ('641900001', 'PERSON1', 'TEST', '1990-05-16', '542 STREET NAME', 'ANYTOWN', 'CH1 2AN', true, null); INSERT INTO juror_mod.juror_pool (owner, juror_number, pool_number, is_active, next_date, status, on_call) VALUES -('400', '641600001', '416230101', true, '2023-01-23', 2, false), -('416', '641600002', '416230103', true, '2023-01-23', 13, false), -('417', '641700001', '417230101', true, '2023-01-09', 13, false), -('417', '641700002', '417230101', true, '2023-01-09', 7, false), -('417', '641700003', '417230101', true, '2023-01-09', 2, false), +('400', '641600001', '416230101', true, '2023-01-23', 2, null), +('416', '641600002', '416230103', true, '2023-01-23', 13, null), +('417', '641700001', '417230101', true, '2023-01-09', 13, null), +('417', '641700002', '417230101', true, '2023-01-09', 7, null), +('417', '641700003', '417230101', true, '2023-01-09', 2, null), ('417', '641700004', '417230101', true, '2023-01-09', 2, true), -('417', '641700005', '417230101', true, '2023-01-09', 4, false), -('417', '641700006', '417230101', true, '2023-01-09', 2, false), -('417', '641700007', '417230101', true, '2023-01-09', 2, false), -('417', '641700008', '417230101', true, '2023-01-09', 2, false), -('417', '641700009', '417230101', true, '2023-01-09', 3, false), -('417', '641700010', '417230101', true, '2023-01-09', 3, false), -('417', '641700011', '417230101', true, '2023-01-09', 4, false), -('417', '641700012', '417230101', true, '2023-01-09', 4, false), -('417', '641700013', '417230101', true, '2023-01-09', 4, false), -('417', '641700014', '417230101', true, '2023-01-09', 3, false), -('418', '641800001', '418230101', true, '2023-10-25', 2, false), -('418', '641800002', '418230102', true, '2023-10-23', 2, false), -('418', '641800003', '418230103', true, '2023-10-23', 2, false), -('418', '641800004', '418230102', true, '2023-10-23', 3, false), -('418', '641800005', '418230103', true, '2023-10-23', 4, false), +('417', '641700005', '417230101', true, '2023-01-09', 4, null), +('417', '641700006', '417230101', true, '2023-01-09', 2, null), +('417', '641700007', '417230101', true, '2023-01-09', 2, null), +('417', '641700008', '417230101', true, '2023-01-09', 2, null), +('417', '641700009', '417230101', true, '2023-01-09', 3, null), +('417', '641700010', '417230101', true, '2023-01-09', 3, null), +('417', '641700011', '417230101', true, '2023-01-09', 4, null), +('417', '641700012', '417230101', true, '2023-01-09', 4, null), +('417', '641700013', '417230101', true, '2023-01-09', 4, null), +('417', '641700014', '417230101', true, '2023-01-09', 3, null), +('418', '641800001', '418230101', true, '2023-10-25', 2, null), +('418', '641800002', '418230102', true, '2023-10-23', 2, null), +('418', '641800003', '418230103', true, '2023-10-23', 2, null), +('418', '641800004', '418230102', true, '2023-10-23', 3, null), +('418', '641800005', '418230103', true, '2023-10-23', 4, null), ('419', '641900001', '419230101', true, '2023-10-23', 2, true); INSERT INTO juror_mod.appearance (attendance_date,juror_number,pool_number,loc_code,f_audit,time_in,time_out,travel_time,appearance_stage,non_attendance) VALUES diff --git a/src/integration-test/resources/db/jurormanagement/UpdateAttendanceDetails.sql b/src/integration-test/resources/db/jurormanagement/UpdateAttendanceDetails.sql index c04625dd0..d1b96e63d 100644 --- a/src/integration-test/resources/db/jurormanagement/UpdateAttendanceDetails.sql +++ b/src/integration-test/resources/db/jurormanagement/UpdateAttendanceDetails.sql @@ -31,10 +31,10 @@ insert into juror_mod.juror_pool (owner, juror_number, pool_number, next_date, d --JUROR_MOD.APPEARANCE insert into juror_mod.appearance (attendance_date,juror_number,loc_code,time_in,time_out,non_attendance,appearance_stage,attendance_type) values -(current_date - interval '1 day','111111111','415','09:31:00',null,false,'CHECKED_IN','FULL_DAY'), -(current_date - interval '2 days','111111111','415','09:30:00',null,false,'CHECKED_IN','FULL_DAY'), +(current_date - interval '1 day','111111111','415','09:31:00',null,false,null,'FULL_DAY'), +(current_date - interval '2 days','111111111','415','09:30:00',null,false,null,'FULL_DAY'), (current_date - interval '2 days','222222222','415','09:30:00',null,false,'CHECKED_IN','FULL_DAY'), (current_date - interval '2 days','333333333','415','09:30:00',null,false,'CHECKED_IN','FULL_DAY'), -(current_date - interval '2 days','555555555','415','06:30:00',null,false,'CHECKED_IN','FULL_DAY'), +(current_date - interval '2 days','555555555','415',null,null,false,null,'FULL_DAY'), (current_date - interval '2 days','666666666','415','09:30:00',null,false,'CHECKED_IN','FULL_DAY'), (current_date - interval '2 days','777777777','415','15:53','12:30',false,'CHECKED_IN','FULL_DAY'); \ No newline at end of file diff --git a/src/integration-test/resources/db/letter/LetterController_initInformationRequestLetter.sql b/src/integration-test/resources/db/letter/LetterController_initInformationRequestLetter.sql index 8705226aa..0bffccdea 100644 --- a/src/integration-test/resources/db/letter/LetterController_initInformationRequestLetter.sql +++ b/src/integration-test/resources/db/letter/LetterController_initInformationRequestLetter.sql @@ -21,13 +21,13 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name ('641500216','216',NULL,'LNAMEONESIXT','FNAMEONESIX',NULL,'16 STREET NAME','ANYTOWN',NULL,NULL,NULL,'CH1 2AN',NULL,NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,'NOT_CHECKED','2024-06-11 13:57:15',NULL,NULL,NULL,NULL,0,'2024-06-03 15:33:11.314842',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false,NULL); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500017','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0015',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:14:27.130294',true,NULL,'2024-06-03 12:00:23.127317'), - ('641500212','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0019',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.348805',NULL,NULL,'2024-06-03 15:33:11.348805'), - ('641500211','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0023',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.357346',NULL,NULL,'2024-06-03 15:33:11.357346'), - ('641500216','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0025',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.361174',NULL,NULL,'2024-06-03 15:33:11.361174'), - ('641500316','415240801','400','ADMINUSER',true,2,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',true,NULL,'2024-06-03 12:00:23.10279'), - ('641500316','415240804','400','ADMINUSER',false,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'), - ('641500223','415240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0020',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-11 13:55:51.432707',true,NULL,'2024-06-03 15:33:11.351721'); + ('641500017','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0015',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:14:27.130294',true,NULL,'2024-06-03 12:00:23.127317'), + ('641500212','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0019',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.348805',NULL,NULL,'2024-06-03 15:33:11.348805'), + ('641500211','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0023',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.357346',NULL,NULL,'2024-06-03 15:33:11.357346'), + ('641500216','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0025',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.361174',NULL,NULL,'2024-06-03 15:33:11.361174'), + ('641500316','415240801','400','ADMINUSER',true,2,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',true,NULL,'2024-06-03 12:00:23.10279'), + ('641500316','415240804','400','ADMINUSER',false,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'), + ('641500223','415240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0020',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-11 13:55:51.432707',true,NULL,'2024-06-03 15:33:11.351721'); INSERT INTO juror_mod.bulk_print_data (juror_no,creation_date,form_type,detail_rec,extracted_flag,digital_comms) VALUES ('641500017',current_date - 1,'5227','14 JUNE 2024 THE CROWN COURT AT CHESTER JURY CENTRAL SUMMONING BUREAU THE COURT SERVICE FREEPOST LON 19669 POCOCK STREET LONDON SE1 0YG 0845 3555567 PART 2 SECTION D FNAMEONESEVEN LNAMEONESEVEN 17 STREET NAME ANYTOWN CH3 2AR 641500017JURY MANAGER ',false,false), diff --git a/src/integration-test/resources/db/mod/reports/AbsencesReportITest.sql b/src/integration-test/resources/db/mod/reports/AbsencesReportITest.sql index 190c7f8c5..40d333fd1 100644 --- a/src/integration-test/resources/db/mod/reports/AbsencesReportITest.sql +++ b/src/integration-test/resources/db/mod/reports/AbsencesReportITest.sql @@ -19,17 +19,17 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name -- create juror_pool associative records INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES ('641500021','415240601','415','MODTESTBUREAU',true,4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL, - current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.702989',NULL,NULL,'2024-04-22 12:26:40.702987'), + current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.702989',NULL,NULL,'2024-04-22 12:26:40.702987'), ('641500011','415240601','415','MODTESTBUREAU',true,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL, - current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.757378',NULL,NULL,'2024-04-22 12:26:40.757376'), + current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.757378',NULL,NULL,'2024-04-22 12:26:40.757376'), ('641500003','415240601','415','MODTESTCOURT',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL, - current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), + current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), ('641500009','415240602','415','MODTESTCOURT',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL, - current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), + current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), ('641500004','417240601','417','MODTESTCOURT',true,1,NULL,current_date+30,NULL,NULL,NULL,NULL,NULL,'0004',NULL, - current_date+2,false,NULL,NULL,'DC',NULL,NULL,NULL,NULL,'2024-04-22 12:30:25.628652',NULL,NULL,'2024-04-22 12:26:40.819485'), + current_date+2,NULL,NULL,NULL,'DC',NULL,NULL,NULL,NULL,'2024-04-22 12:30:25.628652',NULL,NULL,'2024-04-22 12:26:40.819485'), ('641500007','415240601','415','MODTESTCOURT',true,4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL, - current_date+2,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 15:14:10.871528',NULL,NULL,'2024-04-22 12:26:40.848865'); + current_date+2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 15:14:10.871528',NULL,NULL,'2024-04-22 12:26:40.848865'); INSERT INTO juror_mod.appearance (attendance_date,juror_number,pool_number,loc_code,f_audit,time_in,time_out,travel_time,appearance_stage,non_attendance,no_show,attendance_type) VALUES diff --git a/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql b/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql index a8c1b2577..30dfb012b 100644 --- a/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql +++ b/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql @@ -43,43 +43,41 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name ('415000029',NULL,NULL,'LNAME29','FNAME29',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), ('415000030',NULL,NULL,'LNAME30','FNAME30',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), ('415000031',NULL,NULL,'LNAME31','FNAME31',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), - ('415000032',NULL,NULL,'LNAME32','FNAME32',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), - ('415000033',NULL,NULL,'LNAME33','FNAME33',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), - ('415000034',NULL,NULL,'LNAME34','FNAME34',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false); + ('415000032',NULL,NULL,'LNAME32','FNAME32',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false); -INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location") VALUES - ('415000001','415231101','415',NULL,true,3,NULL,NULL,'415'), - ('415000002','415231101','415',NULL,true,3,NULL,NULL,'415'), - ('415000003','415231101','415',NULL,true,3,NULL,NULL,'415'), - ('415000004','415231102','415',NULL,true,3,NULL,NULL,'415'), - ('415000005','415231102','415',NULL,true,3,NULL,NULL,'415'), - ('415000006','415231102','415',NULL,true,3,NULL,NULL,'415'), - ('415000007','415231102','415',NULL,true,3,NULL,NULL,'415'), - ('415000008','415231102','415',NULL,true,3,NULL,NULL,'415'), - ('415000009','415231103','415',NULL,true,3,NULL,NULL,'415'), - ('415000010','415231103','415',NULL,true,3,NULL,NULL,'415'), - ('415000011','415231103','415',NULL,true,3,NULL,NULL,'415'), - ('415000012','415231103','415',NULL,true,3,NULL,NULL,'415'), - ('415000013','415231103','415',NULL,true,3,NULL,NULL,'415'), - ('415000014','415231104','415',NULL,true,4,NULL,NULL,'415'), - ('415000015','415231104','415',NULL,true,4,NULL,NULL,'415'), - ('415000016','415231104','415',NULL,true,4,NULL,NULL,'415'), - ('415000017','415231104','415',NULL,true,4,NULL,NULL,'415'), - ('415000018','415231104','415',NULL,true,1,NULL,NULL,'415'), - ('415000020','415231105','415',NULL,true,4,NULL,NULL,'415'), - ('415000021','415231105','415',NULL,true,4,NULL,NULL,'415'), - ('415000022','415231106','415',NULL,true,2,NULL,NULL,'415'), - ('415000023','415231106','415',NULL,true,2,NULL,NULL,'415'), - ('415000024','415231105','415',NULL,true,5,NULL,NULL,'415'), - ('415000025','415231105','415',NULL,true,6,NULL,NULL,'415'), - ('415000026','415231106','415',NULL,true,7,NULL,NULL,'415'), - ('415000027','415231106','415',NULL,true,8,NULL,NULL,'415'), - ('415000028','415231106','415',NULL,true,9,NULL,NULL,'415'), - ('415000029','415231106','415',NULL,true,10,NULL,NULL,'415'), - ('415000030','415231106','415',NULL,true,11,NULL,NULL,'415'), - ('415000031','415231106','415',NULL,true,12,NULL,NULL,'415'), - ('415000032','415231106','415',NULL,true,13,NULL,NULL,'415'); +INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES + ('415000001','415231101','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000002','415231101','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000003','415231101','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000004','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000005','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000006','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000007','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000008','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000009','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000010','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000011','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000012','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000013','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000014','415231104','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000015','415231104','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000016','415231104','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000017','415231104','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000018','415231104','415',NULL,true,1,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000020','415231105','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000021','415231105','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000022','415231106','415',NULL,true,2,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000023','415231106','415',NULL,true,2,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000024','415231105','415',NULL,true,5,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000025','415231105','415',NULL,true,6,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000026','415231106','415',NULL,true,7,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000027','415231106','415',NULL,true,8,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000028','415231106','415',NULL,true,9,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000029','415231106','415',NULL,true,10,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000030','415231106','415',NULL,true,11,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000031','415231106','415',NULL,true,12,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), + ('415000032','415231106','415',NULL,true,13,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); INSERT INTO juror_mod.appearance (attendance_date,juror_number,loc_code,time_in,time_out,trial_number,non_attendance,no_show,misc_description,pay_cash,last_updated_by,created_by,public_transport_total_due,public_transport_total_paid,hired_vehicle_total_due,hired_vehicle_total_paid,motorcycle_total_due,motorcycle_total_paid,car_total_due,car_total_paid,pedal_cycle_total_due,pedal_cycle_total_paid,childcare_total_due,childcare_total_paid,parking_total_due,parking_total_paid,misc_total_due,misc_total_paid,smart_card_due,is_draft_expense,f_audit,sat_on_jury,pool_number,appearance_stage,loss_of_earnings_due,loss_of_earnings_paid,subsistence_due,subsistence_paid,attendance_type,smart_card_paid,travel_time,travel_jurors_taken_by_car,travel_by_car,travel_jurors_taken_by_motorcycle,travel_by_motorcycle,travel_by_bicycle,miles_traveled,food_and_drink_claim_type,"version",expense_rates_id,attendance_audit_number) VALUES diff --git a/src/integration-test/resources/db/mod/reports/IncompleteServiceReportITest_typical.sql b/src/integration-test/resources/db/mod/reports/IncompleteServiceReportITest_typical.sql index 4db81340d..496704db3 100644 --- a/src/integration-test/resources/db/mod/reports/IncompleteServiceReportITest_typical.sql +++ b/src/integration-test/resources/db/mod/reports/IncompleteServiceReportITest_typical.sql @@ -14,15 +14,15 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name -- create juror_pool associative records INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES ('641500021','415240601','415','MODTESTBUREAU',true,4,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL, - current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.702989',NULL,NULL,'2024-04-22 12:26:40.702987'), + current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.702989',NULL,NULL,'2024-04-22 12:26:40.702987'), ('641500011','415240601','415','MODTESTBUREAU',true,3,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL, - current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.757378',NULL,NULL,'2024-04-22 12:26:40.757376'), + current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.757378',NULL,NULL,'2024-04-22 12:26:40.757376'), ('641500003','415240601','415','MODTESTCOURT',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL, - current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), + current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), ('641500004','415240601','415','MODTESTCOURT',true,7,NULL,current_date+30,NULL,NULL,NULL,NULL,NULL,'0004',NULL, - NULL,false,NULL,NULL,'DC',NULL,NULL,NULL,NULL,'2024-04-22 12:30:25.628652',NULL,NULL,'2024-04-22 12:26:40.819485'), + NULL,NULL,NULL,NULL,'DC',NULL,NULL,NULL,NULL,'2024-04-22 12:30:25.628652',NULL,NULL,'2024-04-22 12:26:40.819485'), ('641500007','415240601','415','MODTESTCOURT',true,13,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL, - current_date-1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 15:14:10.871528',NULL,NULL,'2024-04-22 12:26:40.848865'); + current_date-1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 15:14:10.871528',NULL,NULL,'2024-04-22 12:26:40.848865'); insert into juror_mod.appearance (attendance_date,juror_number,pool_number,loc_code,time_in,time_out,non_attendance,appearance_stage,attendance_type) values (current_date - interval '1 day','641500021','415240601','415',null,null,false,null,'ABSENT'), diff --git a/src/integration-test/resources/db/mod/reports/JurySummoningMonitor_typical.sql b/src/integration-test/resources/db/mod/reports/JurySummoningMonitor_typical.sql index 61c9e5961..60b868a11 100644 --- a/src/integration-test/resources/db/mod/reports/JurySummoningMonitor_typical.sql +++ b/src/integration-test/resources/db/mod/reports/JurySummoningMonitor_typical.sql @@ -59,53 +59,53 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500001','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:03:06.182449',NULL,NULL,'2024-06-03 12:00:23.099129'), - ('641500002','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:04:02.042',NULL,NULL,'2024-06-03 12:00:23.112002'), - ('641500003','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:43:17.407033',NULL,NULL,'2024-06-03 12:00:23.109013'), - ('641500004','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0011',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:48:07.182596',NULL,NULL,'2024-06-03 12:00:23.120384'), - ('641500006','415240801','400','ADMINUSER',false,7,NULL,'2024-08-27',NULL,NULL,NULL,NULL,NULL,'0014',NULL,NULL,false,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990034',NULL,NULL,'2024-06-03 12:00:23.125644'), - ('641500006','415240803','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-27',false,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990177',NULL,NULL,'2024-06-03 12:00:23.125644'), - ('641500007','415240801','400','ADMINUSER',true,7,NULL,'2024-10-29',NULL,NULL,NULL,NULL,NULL,'0012',NULL,NULL,false,NULL,NULL,'P',NULL,true,NULL,NULL,'2024-06-03 15:16:19.119732',NULL,NULL,'2024-06-03 12:00:23.122108'), - ('641500008','415240803','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-27',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:02:08.187452',NULL,NULL,'2024-06-03 12:02:08.187451'), - ('641500010','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.08775',NULL,NULL,'2024-06-03 12:00:23.087748'), - ('641500011','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:50:04.734274',NULL,NULL,'2024-06-03 12:00:23.105914'); + ('641500001','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:03:06.182449',NULL,NULL,'2024-06-03 12:00:23.099129'), + ('641500002','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:04:02.042',NULL,NULL,'2024-06-03 12:00:23.112002'), + ('641500003','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:43:17.407033',NULL,NULL,'2024-06-03 12:00:23.109013'), + ('641500004','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0011',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:48:07.182596',NULL,NULL,'2024-06-03 12:00:23.120384'), + ('641500006','415240801','400','ADMINUSER',false,7,NULL,'2024-08-27',NULL,NULL,NULL,NULL,NULL,'0014',NULL,NULL,NULL,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990034',NULL,NULL,'2024-06-03 12:00:23.125644'), + ('641500006','415240803','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-27',NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990177',NULL,NULL,'2024-06-03 12:00:23.125644'), + ('641500007','415240801','400','ADMINUSER',true,7,NULL,'2024-10-29',NULL,NULL,NULL,NULL,NULL,'0012',NULL,NULL,NULL,NULL,NULL,'P',NULL,true,NULL,NULL,'2024-06-03 15:16:19.119732',NULL,NULL,'2024-06-03 12:00:23.122108'), + ('641500008','415240803','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-27',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:02:08.187452',NULL,NULL,'2024-06-03 12:02:08.187451'), + ('641500010','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.08775',NULL,NULL,'2024-06-03 12:00:23.087748'), + ('641500011','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:50:04.734274',NULL,NULL,'2024-06-03 12:00:23.105914'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500012','415240801','400','ADMINUSER',true,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'), - ('641500013','415240801','400','ADMINUSER',true,9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 10:32:33.668674',NULL,NULL,'2024-06-03 12:00:23.115231'), - ('641500016','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0010',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.118577',NULL,NULL,'2024-06-03 12:00:23.118576'), - ('641500017','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0015',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:14:27.130294',true,NULL,'2024-06-03 12:00:23.127317'), - ('641500018','415240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0013',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:16:26.744714',NULL,NULL,'2024-06-03 12:00:23.123845'), - ('641500019','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0016',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.129403',NULL,NULL,'2024-06-03 12:00:23.129402'), - ('641500021','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:17:15.312749',NULL,NULL,'2024-06-03 12:00:23.091738'), - ('641500023','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.095433',NULL,NULL,'2024-06-03 12:00:23.095431'), - ('641500201','415240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0018',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:29:39.953446',NULL,NULL,'2024-06-03 15:33:11.346417'), - ('641500202','415240801','400','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0024',NULL,NULL,false,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:34:46.391861',NULL,NULL,'2024-06-03 15:33:11.359236'); + ('641500012','415240801','400','ADMINUSER',true,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'), + ('641500013','415240801','400','ADMINUSER',true,9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 10:32:33.668674',NULL,NULL,'2024-06-03 12:00:23.115231'), + ('641500016','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0010',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.118577',NULL,NULL,'2024-06-03 12:00:23.118576'), + ('641500017','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0015',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:14:27.130294',true,NULL,'2024-06-03 12:00:23.127317'), + ('641500018','415240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0013',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:16:26.744714',NULL,NULL,'2024-06-03 12:00:23.123845'), + ('641500019','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0016',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.129403',NULL,NULL,'2024-06-03 12:00:23.129402'), + ('641500021','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:17:15.312749',NULL,NULL,'2024-06-03 12:00:23.091738'), + ('641500023','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.095433',NULL,NULL,'2024-06-03 12:00:23.095431'), + ('641500201','415240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0018',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:29:39.953446',NULL,NULL,'2024-06-03 15:33:11.346417'), + ('641500202','415240801','400','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0024',NULL,NULL,NULL,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:34:46.391861',NULL,NULL,'2024-06-03 15:33:11.359236'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500203','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0022',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.35552',NULL,NULL,'2024-06-03 15:33:11.35552'), - ('641500204','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0026',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.362183',NULL,NULL,'2024-06-03 15:33:11.362182'), - ('641500210','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0017',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.343885',NULL,NULL,'2024-06-03 15:33:11.343885'), - ('641500211','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0021',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.353662',NULL,NULL,'2024-06-03 15:33:11.353662'), - ('641500212','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0019',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.348805',NULL,NULL,'2024-06-03 15:33:11.348805'), - ('641500213','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0023',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.357346',NULL,NULL,'2024-06-03 15:33:11.357346'), - ('641500216','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0025',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.361174',NULL,NULL,'2024-06-03 15:33:11.361174'), - ('641500223','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0020',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.351721',NULL,NULL,'2024-06-03 15:33:11.351721'), - ('641500316','415240801','400','ADMINUSER',true,2,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',true,NULL,'2024-06-03 12:00:23.10279'), - ('641500316','415240804','400','ADMINUSER',false,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'); + ('641500203','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0022',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.35552',NULL,NULL,'2024-06-03 15:33:11.35552'), + ('641500204','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0026',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.362183',NULL,NULL,'2024-06-03 15:33:11.362182'), + ('641500210','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0017',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.343885',NULL,NULL,'2024-06-03 15:33:11.343885'), + ('641500211','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0021',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.353662',NULL,NULL,'2024-06-03 15:33:11.353662'), + ('641500212','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0019',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.348805',NULL,NULL,'2024-06-03 15:33:11.348805'), + ('641500213','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0023',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.357346',NULL,NULL,'2024-06-03 15:33:11.357346'), + ('641500216','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0025',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.361174',NULL,NULL,'2024-06-03 15:33:11.361174'), + ('641500223','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0020',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.351721',NULL,NULL,'2024-06-03 15:33:11.351721'), + ('641500316','415240801','400','ADMINUSER',true,2,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',true,NULL,'2024-06-03 12:00:23.10279'), + ('641500316','415240804','400','ADMINUSER',false,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641600045','416240801','416','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0001',NULL,NULL,false,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:43:59.388',NULL,'2024-06-04','2024-06-04 11:42:42.328'), - ('641600050','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), - ('641600051','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), - ('641600054','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), - ('641600057','416240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:58:18.554',NULL,'2024-06-04','2024-06-04 11:42:42.331'), - ('641600058','416240801','400','MODTESTBUREAU',true,7,NULL,'2024-09-16',NULL,NULL,NULL,NULL,NULL,'0010',NULL,NULL,false,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-04 11:59:20.157',NULL,'2024-06-04','2024-06-04 11:42:42.354'), - ('641600062','416240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:59:44.483',NULL,'2024-06-04','2024-06-04 11:42:42.349'), - ('641600065','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.337',NULL,'2024-06-04','2024-06-04 11:42:42.337'), - ('641600066','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.341',NULL,'2024-06-04','2024-06-04 11:42:42.341'), - ('641600070','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.351',NULL,'2024-06-04','2024-06-04 11:42:42.351'); + ('641600045','416240801','416','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0001',NULL,NULL,NULL,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:43:59.388',NULL,'2024-06-04','2024-06-04 11:42:42.328'), + ('641600050','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), + ('641600051','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), + ('641600054','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), + ('641600057','416240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:58:18.554',NULL,'2024-06-04','2024-06-04 11:42:42.331'), + ('641600058','416240801','400','MODTESTBUREAU',true,7,NULL,'2024-09-16',NULL,NULL,NULL,NULL,NULL,'0010',NULL,NULL,NULL,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-04 11:59:20.157',NULL,'2024-06-04','2024-06-04 11:42:42.354'), + ('641600062','416240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:59:44.483',NULL,'2024-06-04','2024-06-04 11:42:42.349'), + ('641600065','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.337',NULL,'2024-06-04','2024-06-04 11:42:42.337'), + ('641600066','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.341',NULL,'2024-06-04','2024-06-04 11:42:42.341'), + ('641600070','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.351',NULL,'2024-06-04','2024-06-04 11:42:42.351'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('677400941','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-08',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.647878',NULL,NULL,'2024-06-06 12:07:51.647877'), - ('677400928','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-08',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.652351',NULL,NULL,'2024-06-06 12:07:51.65235'), - ('677400923','774240802','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-08',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:08:33.268403',NULL,NULL,'2024-06-06 12:07:51.640718'); + ('677400941','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.647878',NULL,NULL,'2024-06-06 12:07:51.647877'), + ('677400928','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.652351',NULL,NULL,'2024-06-06 12:07:51.65235'), + ('677400923','774240802','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:08:33.268403',NULL,NULL,'2024-06-06 12:07:51.640718'); insert into juror_mod.bureau_snapshot (juror_number,pool_number,"owner",user_edtq,is_active,status,def_date,pool_seq,edit_tag,next_date,was_deferred,deferral_code,postpone,scan_code,last_update,reminder_sent,transfer_date,date_created,excusal_code,acc_exc,police_check) VALUES diff --git a/src/integration-test/resources/db/mod/reports/PersonAttendingSummaryReportITest_typical.sql b/src/integration-test/resources/db/mod/reports/PersonAttendingSummaryReportITest_typical.sql index 46cfaefe1..306326e8e 100644 --- a/src/integration-test/resources/db/mod/reports/PersonAttendingSummaryReportITest_typical.sql +++ b/src/integration-test/resources/db/mod/reports/PersonAttendingSummaryReportITest_typical.sql @@ -14,12 +14,12 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name -- create juror_pool associative records INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES ('641500021','415240601','415','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL, - current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.702989',NULL,NULL,'2024-04-22 12:26:40.702987'), + current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.702989',NULL,NULL,'2024-04-22 12:26:40.702987'), ('641500011','415240601','415','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL, - current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.757378',NULL,NULL,'2024-04-22 12:26:40.757376'), + current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:26:40.757378',NULL,NULL,'2024-04-22 12:26:40.757376'), ('641500003','415240601','415','MODTESTCOURT',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL, - current_date+1,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), + current_date+1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 12:29:18.125891',NULL,NULL,'2024-04-22 12:26:40.788798'), ('641500004','415240601','415','MODTESTCOURT',true,1,NULL,current_date+30,NULL,NULL,NULL,NULL,NULL,'0004',NULL, - current_date+2,false,NULL,NULL,'DC',NULL,NULL,NULL,NULL,'2024-04-22 12:30:25.628652',NULL,NULL,'2024-04-22 12:26:40.819485'), + current_date+2,NULL,NULL,NULL,'DC',NULL,NULL,NULL,NULL,'2024-04-22 12:30:25.628652',NULL,NULL,'2024-04-22 12:26:40.819485'), ('641500007','415240601','415','MODTESTCOURT',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL, - current_date+2,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 15:14:10.871528',NULL,NULL,'2024-04-22 12:26:40.848865'); \ No newline at end of file + current_date+2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-04-22 15:14:10.871528',NULL,NULL,'2024-04-22 12:26:40.848865'); \ No newline at end of file diff --git a/src/integration-test/resources/db/mod/reports/YieldPerformanceReportITest_typical.sql b/src/integration-test/resources/db/mod/reports/YieldPerformanceReportITest_typical.sql index 4ee515d96..68e4036ec 100644 --- a/src/integration-test/resources/db/mod/reports/YieldPerformanceReportITest_typical.sql +++ b/src/integration-test/resources/db/mod/reports/YieldPerformanceReportITest_typical.sql @@ -69,62 +69,62 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500001','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:03:06.182449',NULL,NULL,'2024-06-03 12:00:23.099129'), - ('641500002','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:04:02.042',NULL,NULL,'2024-06-03 12:00:23.112002'), - ('641500003','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:43:17.407033',NULL,NULL,'2024-06-03 12:00:23.109013'), - ('641500004','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0011',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:48:07.182596',NULL,NULL,'2024-06-03 12:00:23.120384'), - ('641500006','415240801','400','ADMINUSER',false,7,NULL,'2024-08-27',NULL,NULL,NULL,NULL,NULL,'0014',NULL,NULL,false,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990034',NULL,NULL,'2024-06-03 12:00:23.125644'), - ('641500006','415240803','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-27',false,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990177',NULL,NULL,'2024-06-03 12:00:23.125644'), - ('641500007','415240801','400','ADMINUSER',true,7,NULL,'2024-10-29',NULL,NULL,NULL,NULL,NULL,'0012',NULL,NULL,false,NULL,NULL,'P',NULL,true,NULL,NULL,'2024-06-03 15:16:19.119732',NULL,NULL,'2024-06-03 12:00:23.122108'), - ('641500008','415240803','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-27',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:02:08.187452',NULL,NULL,'2024-06-03 12:02:08.187451'), - ('641500010','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.08775',NULL,NULL,'2024-06-03 12:00:23.087748'), - ('641500011','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:50:04.734274',NULL,NULL,'2024-06-03 12:00:23.105914'); + ('641500001','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:03:06.182449',NULL,NULL,'2024-06-03 12:00:23.099129'), + ('641500002','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:04:02.042',NULL,NULL,'2024-06-03 12:00:23.112002'), + ('641500003','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:43:17.407033',NULL,NULL,'2024-06-03 12:00:23.109013'), + ('641500004','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0011',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 13:48:07.182596',NULL,NULL,'2024-06-03 12:00:23.120384'), + ('641500006','415240801','400','ADMINUSER',false,7,NULL,'2024-08-27',NULL,NULL,NULL,NULL,NULL,'0014',NULL,NULL,NULL,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990034',NULL,NULL,'2024-06-03 12:00:23.125644'), + ('641500006','415240803','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-27',NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:06:26.990177',NULL,NULL,'2024-06-03 12:00:23.125644'), + ('641500007','415240801','400','ADMINUSER',true,7,NULL,'2024-10-29',NULL,NULL,NULL,NULL,NULL,'0012',NULL,NULL,NULL,NULL,NULL,'P',NULL,true,NULL,NULL,'2024-06-03 15:16:19.119732',NULL,NULL,'2024-06-03 12:00:23.122108'), + ('641500008','415240803','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-27',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:02:08.187452',NULL,NULL,'2024-06-03 12:02:08.187451'), + ('641500010','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.08775',NULL,NULL,'2024-06-03 12:00:23.087748'), + ('641500011','415240801','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:50:04.734274',NULL,NULL,'2024-06-03 12:00:23.105914'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500012','415240801','400','ADMINUSER',true,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'), - ('641500013','415240801','400','ADMINUSER',true,9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 10:32:33.668674',NULL,NULL,'2024-06-03 12:00:23.115231'), - ('641500016','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0010',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.118577',NULL,NULL,'2024-06-03 12:00:23.118576'), - ('641500017','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0015',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:14:27.130294',true,NULL,'2024-06-03 12:00:23.127317'), - ('641500018','415240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0013',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:16:26.744714',NULL,NULL,'2024-06-03 12:00:23.123845'), - ('641500019','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0016',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.129403',NULL,NULL,'2024-06-03 12:00:23.129402'), - ('641500021','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:17:15.312749',NULL,NULL,'2024-06-03 12:00:23.091738'), - ('641500023','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.095433',NULL,NULL,'2024-06-03 12:00:23.095431'), - ('641500201','415240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0018',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:29:39.953446',NULL,NULL,'2024-06-03 15:33:11.346417'), - ('641500202','415240801','400','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0024',NULL,NULL,false,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:34:46.391861',NULL,NULL,'2024-06-03 15:33:11.359236'); + ('641500012','415240801','400','ADMINUSER',true,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'), + ('641500013','415240801','400','ADMINUSER',true,9,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 10:32:33.668674',NULL,NULL,'2024-06-03 12:00:23.115231'), + ('641500016','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0010',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.118577',NULL,NULL,'2024-06-03 12:00:23.118576'), + ('641500017','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0015',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:14:27.130294',true,NULL,'2024-06-03 12:00:23.127317'), + ('641500018','415240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0013',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:16:26.744714',NULL,NULL,'2024-06-03 12:00:23.123845'), + ('641500019','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0016',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.129403',NULL,NULL,'2024-06-03 12:00:23.129402'), + ('641500021','415240801','400','ADMINUSER',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:17:15.312749',NULL,NULL,'2024-06-03 12:00:23.091738'), + ('641500023','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 12:00:23.095433',NULL,NULL,'2024-06-03 12:00:23.095431'), + ('641500201','415240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0018',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:29:39.953446',NULL,NULL,'2024-06-03 15:33:11.346417'), + ('641500202','415240801','400','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0024',NULL,NULL,NULL,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:34:46.391861',NULL,NULL,'2024-06-03 15:33:11.359236'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641500203','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0022',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.35552',NULL,NULL,'2024-06-03 15:33:11.35552'), - ('641500204','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0026',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.362183',NULL,NULL,'2024-06-03 15:33:11.362182'), - ('641500210','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0017',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.343885',NULL,NULL,'2024-06-03 15:33:11.343885'), - ('641500211','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0021',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.353662',NULL,NULL,'2024-06-03 15:33:11.353662'), - ('641500212','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0019',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.348805',NULL,NULL,'2024-06-03 15:33:11.348805'), - ('641500213','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0023',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.357346',NULL,NULL,'2024-06-03 15:33:11.357346'), - ('641500216','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0025',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.361174',NULL,NULL,'2024-06-03 15:33:11.361174'), - ('641500223','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0020',NULL,'2024-08-05',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.351721',NULL,NULL,'2024-06-03 15:33:11.351721'), - ('641500316','415240801','400','ADMINUSER',true,2,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',true,NULL,'2024-06-03 12:00:23.10279'), - ('641500316','415240804','400','ADMINUSER',false,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,false,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'); + ('641500203','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0022',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.35552',NULL,NULL,'2024-06-03 15:33:11.35552'), + ('641500204','415240801','400','ADMINUSER',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0026',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.362183',NULL,NULL,'2024-06-03 15:33:11.362182'), + ('641500210','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0017',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.343885',NULL,NULL,'2024-06-03 15:33:11.343885'), + ('641500211','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0021',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.353662',NULL,NULL,'2024-06-03 15:33:11.353662'), + ('641500212','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0019',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.348805',NULL,NULL,'2024-06-03 15:33:11.348805'), + ('641500213','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0023',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.357346',NULL,NULL,'2024-06-03 15:33:11.357346'), + ('641500216','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0025',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.361174',NULL,NULL,'2024-06-03 15:33:11.361174'), + ('641500223','415240801','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0020',NULL,'2024-08-05',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:33:11.351721',NULL,NULL,'2024-06-03 15:33:11.351721'), + ('641500316','415240801','400','ADMINUSER',true,2,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',true,NULL,'2024-06-03 12:00:23.10279'), + ('641500316','415240804','400','ADMINUSER',false,7,NULL,'2024-08-20',NULL,NULL,NULL,NULL,NULL,'0005',NULL,NULL,NULL,NULL,NULL,'M',NULL,NULL,NULL,NULL,'2024-06-03 15:57:45.605066',NULL,NULL,'2024-06-03 12:00:23.10279'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('641600045','416240801','416','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0001',NULL,NULL,false,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:43:59.388',NULL,'2024-06-04','2024-06-04 11:42:42.328'), - ('641600050','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), - ('641600051','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), - ('641600054','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), - ('641600057','416240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:58:18.554',NULL,'2024-06-04','2024-06-04 11:42:42.331'), - ('641600058','416240801','400','MODTESTBUREAU',true,7,NULL,'2024-09-16',NULL,NULL,NULL,NULL,NULL,'0010',NULL,NULL,false,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-04 11:59:20.157',NULL,'2024-06-04','2024-06-04 11:42:42.354'), - ('641600062','416240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:59:44.483',NULL,'2024-06-04','2024-06-04 11:42:42.349'), - ('641600065','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.337',NULL,'2024-06-04','2024-06-04 11:42:42.337'), - ('641600066','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.341',NULL,'2024-06-04','2024-06-04 11:42:42.341'), - ('641600070','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.351',NULL,'2024-06-04','2024-06-04 11:42:42.351'); + ('641600045','416240801','416','MODTESTBUREAU',true,2,NULL,'2024-08-19',NULL,NULL,NULL,NULL,NULL,'0001',NULL,NULL,NULL,NULL,NULL,'B',NULL,NULL,NULL,NULL,'2024-06-04 11:43:59.388',NULL,'2024-06-04','2024-06-04 11:42:42.328'), + ('641600050','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), + ('641600051','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), + ('641600054','416240801','416','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), + ('641600057','416240801','400','MODTESTBUREAU',true,5,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:58:18.554',NULL,'2024-06-04','2024-06-04 11:42:42.331'), + ('641600058','416240801','400','MODTESTBUREAU',true,7,NULL,'2024-09-16',NULL,NULL,NULL,NULL,NULL,'0010',NULL,NULL,NULL,NULL,NULL,'A',NULL,NULL,NULL,NULL,'2024-06-04 11:59:20.157',NULL,'2024-06-04','2024-06-04 11:42:42.354'), + ('641600062','416240801','400','MODTESTBUREAU',true,6,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0008',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:59:44.483',NULL,'2024-06-04','2024-06-04 11:42:42.349'), + ('641600065','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0004',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.337',NULL,'2024-06-04','2024-06-04 11:42:42.337'), + ('641600066','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0005',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.341',NULL,'2024-06-04','2024-06-04 11:42:42.341'), + ('641600070','416240801','416','MODTESTBUREAU',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0009',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:42:42.351',NULL,'2024-06-04','2024-06-04 11:42:42.351'); INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('677400941','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-08',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.647878',NULL,NULL,'2024-06-06 12:07:51.647877'), - ('677400928','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-08',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.652351',NULL,NULL,'2024-06-06 12:07:51.65235'), - ('677400923','774240802','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-08',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:08:33.268403',NULL,NULL,'2024-06-06 12:07:51.640718'), - ('641700050','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), - ('641700051','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), - ('641700052','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), - ('641700053','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), - ('641700054','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), - ('641700055','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), - ('641700056','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), - ('641700057','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), - ('641700058','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'); + ('677400941','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0002',NULL,'2024-08-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.647878',NULL,NULL,'2024-06-06 12:07:51.647877'), + ('677400928','774240802','400','ADMINUSER',true,1,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:07:51.652351',NULL,NULL,'2024-06-06 12:07:51.65235'), + ('677400923','774240802','400','ADMINUSER',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0001',NULL,'2024-08-08',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-06 12:08:33.268403',NULL,NULL,'2024-06-06 12:07:51.640718'), + ('641700050','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), + ('641700051','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), + ('641700052','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), + ('641700053','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), + ('641700054','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), + ('641700055','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'), + ('641700056','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0006',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:44:53.178',NULL,'2024-06-04','2024-06-04 11:42:42.343'), + ('641700057','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0007',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:49:15.104',true,'2024-06-04','2024-06-04 11:42:42.346'), + ('641700058','417240801','400','MODTESTBUREAU',true,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'0003',NULL,'2024-08-06',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'2024-06-04 11:57:37.158',NULL,'2024-06-04','2024-06-04 11:42:42.334'); insert into juror_mod.bureau_snapshot (juror_number,pool_number,"owner",user_edtq,is_active,status,def_date,pool_seq,edit_tag,next_date,was_deferred,deferral_code,postpone,scan_code,last_update,reminder_sent,transfer_date,date_created,excusal_code,acc_exc,police_check) VALUES diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/controller/JurorCommsCronBatchController.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/controller/JurorCommsCronBatchController.java index 08801c332..f1ffa8df9 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/controller/JurorCommsCronBatchController.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/controller/JurorCommsCronBatchController.java @@ -2,11 +2,11 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; -import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; +import org.springframework.util.Assert; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; @@ -21,11 +21,16 @@ @RequestMapping(value = "/api/v1/bureau/cron", produces = MediaType.APPLICATION_JSON_VALUE) @Slf4j @Tag(name = "Cron API", description = "Bureau Cron API") -@RequiredArgsConstructor(onConstructor_ = {@Autowired}) public class JurorCommsCronBatchController { private final BureauBatchScheduler bureauBatchScheduler; + @Autowired + public JurorCommsCronBatchController(final BureauBatchScheduler bureauBatchScheduler) { + Assert.notNull(bureauBatchScheduler, "BureauAuthenticationService cannot be null."); + this.bureauBatchScheduler = bureauBatchScheduler; + } + @GetMapping @Operation(summary = "/bureau/cron", description = "BureauBatchScheduler is called") diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/BureauBatchScheduler.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/BureauBatchScheduler.java index 2033e3f1f..ba178a09c 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/BureauBatchScheduler.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/BureauBatchScheduler.java @@ -1,11 +1,11 @@ package uk.gov.hmcts.juror.api.bureau.scheduler; -import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; +import org.springframework.util.Assert; import uk.gov.hmcts.juror.api.bureau.service.ScheduledService; import uk.gov.hmcts.juror.api.moj.client.contracts.SchedulerServiceClient; @@ -16,12 +16,21 @@ @Component @Slf4j -@RequiredArgsConstructor(onConstructor_ = {@Autowired}) public class BureauBatchScheduler { private final BureauBatchProcessFactory bureauBatchProcessFactory; private final SchedulerServiceClient schedulerServiceClient; + @Autowired + public BureauBatchScheduler( + final BureauBatchProcessFactory bureauBatchProcessFactory, + final SchedulerServiceClient schedulerServiceClient) { + Assert.notNull(bureauBatchProcessFactory, "BureauBatchProcessFactory cannot be null."); + this.bureauBatchProcessFactory = bureauBatchProcessFactory; + this.schedulerServiceClient = schedulerServiceClient; + + } + /** * General Entry point for externally hosted cron jobs. ( server crontab and not via springboot). */ diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/UrgentStatusScheduler.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/UrgentStatusScheduler.java index 1ddc01fc0..26491ea2b 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/UrgentStatusScheduler.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/scheduler/UrgentStatusScheduler.java @@ -73,8 +73,7 @@ public SchedulerServiceClient.Result process() { SecurityUtil.BUREAU_OWNER); if (jurorDetails == null) { - log.error("Can not find active bureau owned juror pool for juror: {}", - backlogItem.getJurorNumber()); + log.error("Can not find active bureau owned juror pool for juror: " + backlogItem.getJurorNumber()); failedToFindJurorCount++; continue; } @@ -105,9 +104,9 @@ public SchedulerServiceClient.Result process() { ? SchedulerServiceClient.Result.Status.SUCCESS : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, null, Map.of( - "TOTAL_PROCESSED", String.valueOf(totalResponsesProcessed), - "TOTAL_MARKED_URGENT", String.valueOf(totalUrgentResponses), - "TOTAL_FAILED_TO_FIND", String.valueOf(failedToFindJurorCount) + "TOTAL_PROCESSED", "" + totalResponsesProcessed, + "TOTAL_MARKED_URGENT", "" + totalUrgentResponses, + "TOTAL_FAILED_TO_FIND", "" + failedToFindJurorCount )); } diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsLetterServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsLetterServiceImpl.java index 98d11e69a..c2eede774 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsLetterServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsLetterServiceImpl.java @@ -1,7 +1,7 @@ package uk.gov.hmcts.juror.api.bureau.service; import com.google.common.collect.Lists; -import lombok.AllArgsConstructor; +import io.jsonwebtoken.lang.Assert; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -15,7 +15,6 @@ import uk.gov.hmcts.juror.api.moj.domain.JurorPool; import uk.gov.hmcts.juror.api.moj.repository.BulkPrintDataRepository; import uk.gov.hmcts.juror.api.moj.repository.JurorPoolRepository; -import uk.gov.hmcts.juror.api.moj.utils.NotifyUtil; import uk.gov.hmcts.juror.api.moj.utils.SecurityUtil; import java.text.SimpleDateFormat; @@ -28,7 +27,6 @@ */ @Slf4j @Service -@AllArgsConstructor(onConstructor = @__(@Autowired)) public class JurorCommsLetterServiceImpl implements BureauProcessService { @@ -37,6 +35,24 @@ public class JurorCommsLetterServiceImpl implements BureauProcessService { private final BulkPrintDataRepository bulkPrintDataRepository; private final JurorPoolRepository jurorRepository; + @Autowired + public JurorCommsLetterServiceImpl( + final JurorCommsNotificationService jurorCommsNotificationService, + final BulkPrintDataNotifyCommsRepository bulkPrintDataNotifyCommsRepository, + final BulkPrintDataRepository bulkPrintDataRepository, + final JurorPoolRepository jurorRepository) { + Assert.notNull(jurorCommsNotificationService, "JurorCommsNotificationService cannot be null."); + Assert.notNull(bulkPrintDataRepository, "BulkPrintDataRepository cannot be null."); + Assert.notNull(bulkPrintDataNotifyCommsRepository, "BulkPrintDataNotifyCommsRepository cannot be null."); + Assert.notNull(jurorRepository, "JurorRepository cannot be null."); + + this.jurorCommsNotificationService = jurorCommsNotificationService; + this.bulkPrintDataRepository = bulkPrintDataRepository; + this.bulkPrintDataNotifyCommsRepository = bulkPrintDataNotifyCommsRepository; + this.jurorRepository = jurorRepository; + + } + /** * Implements a specific job execution. * Processes entries in the Juror.print_files table and sends the appropriate email notifications to @@ -55,8 +71,9 @@ public SchedulerServiceClient.Result process() { log.debug("jurorCommsPrintFiles {}", bulkPrintDataNotifyCommsList.size()); int commsSent = 0; int commsfailed = 0; - int invalidEmailAddress = 0; if (!bulkPrintDataNotifyCommsList.isEmpty()) { + + for (BulkPrintDataNotifyComms printFile : bulkPrintDataNotifyCommsList) { try { log.trace("LetterService : jurorNumber {}", printFile.getJurorNo()); @@ -76,19 +93,18 @@ public SchedulerServiceClient.Result process() { updatePrintFiles(printFile); commsSent++; } catch (JurorCommsNotificationServiceException e) { - if (NotifyUtil.isInvalidEmailAddressError(e.getCause())) { - invalidEmailAddress++; - } else { - log.error( - "Unable to send Letter comms for {}", - printFile.getJurorNo(), e - ); - commsfailed++; - } + log.error( + "Unable to send Letter comms for {} : {} {}", + printFile.getJurorNo(), + e.getMessage(), + e.getCause().toString() + ); + commsfailed++; } catch (Exception e) { commsfailed++; log.error("Letter Comms Processing : Juror Comms failed : {}", e.getMessage()); } + } log.info("LetterService : Summary, identified:{}, sent:{}, failed:{},", bulkPrintDataNotifyCommsList.size(), commsSent, commsfailed @@ -102,11 +118,8 @@ public SchedulerServiceClient.Result process() { commsfailed == 0 ? SchedulerServiceClient.Result.Status.SUCCESS : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, null, - Map.of( - "COMMS_FAILED", String.valueOf(commsfailed), - "COMMNS_SENT", String.valueOf(commsSent), - "INVALID_EMAIL_ADDRESS", String.valueOf(invalidEmailAddress) - )); + Map.of("COMMS_FAILED", "" + commsfailed, + "COMMNS_SENT", "" + commsSent)); } /** diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsSentToCourtServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsSentToCourtServiceImpl.java index f40aa98ca..42e714b5a 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsSentToCourtServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsSentToCourtServiceImpl.java @@ -3,7 +3,7 @@ import com.google.common.collect.Lists; import com.querydsl.core.types.dsl.BooleanExpression; -import lombok.AllArgsConstructor; +import io.jsonwebtoken.lang.Assert; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -16,20 +16,17 @@ import uk.gov.hmcts.juror.api.moj.repository.JurorPoolQueries; import uk.gov.hmcts.juror.api.moj.repository.JurorPoolRepository; import uk.gov.hmcts.juror.api.moj.service.AppSettingService; -import uk.gov.hmcts.juror.api.moj.utils.NotifyUtil; import java.text.SimpleDateFormat; import java.util.Date; import java.util.List; import java.util.Map; -import java.util.Objects; /** * Implementation of {@link BureauProcessService}. */ @Slf4j @Service -@AllArgsConstructor(onConstructor = @__(@Autowired)) public class JurorCommsSentToCourtServiceImpl implements BureauProcessService { @@ -40,6 +37,19 @@ public class JurorCommsSentToCourtServiceImpl implements BureauProcessService { private final JurorPoolRepository jurorRepository; private final AppSettingService appSetting; + @Autowired + public JurorCommsSentToCourtServiceImpl( + final JurorCommsNotificationService jurorCommsNotificationService, + final AppSettingService appSetting, + final JurorPoolRepository jurorRepository) { + Assert.notNull(jurorCommsNotificationService, "JurorCommsNotificationService cannot be null."); + Assert.notNull(jurorRepository, "JurorRepository cannot be null."); + Assert.notNull(appSetting, "AppSettingService cannot be null."); + this.jurorCommsNotificationService = jurorCommsNotificationService; + this.appSetting = appSetting; + this.jurorRepository = jurorRepository; + } + /** * Implements a specific job execution. * Processes entries in the Juror table and sends the appropriate email notifications to @@ -60,36 +70,26 @@ public SchedulerServiceClient.Result process() { Integer notificationsSent; int errorCount = 0; - int errorInvalidEmailCount = 0; - int errorInvalidPhoneCount = 0; - int successCountEmail = 0; - int successCountSms = 0; - int errorCountEmail = 0; - int errorCountSms = 0; - int successCount = 0; for (JurorPool jurorDetail : jurordetailList) { notificationsSent = jurorDetail.getJuror().getNotifications(); log.trace("Sent To Court Comms Service : jurorNumber {}", jurorDetail.getJurorNumber()); - boolean isEmail = false; - boolean isSms = false; try { //Email if (jurorDetail.getJuror().getEmail() != null && !notificationsSent.equals(EMAIL_NOTIFICATION_SENT)) { - isEmail = true; jurorCommsNotificationService.sendJurorComms(jurorDetail, JurorCommsNotifyTemplateType.SENT_TO_COURT, null, null, false ); notificationsSent = EMAIL_NOTIFICATION_SENT; - successCountEmail++; } //Send SMS only if there has not been an email sent - if (jurorDetail.getJuror().getAltPhoneNumber() != null - && !notificationsSent.equals(EMAIL_NOTIFICATION_SENT) - && Objects.equals(appSetting.getSendEmailOrSms(), SEND_EMAIL_OR_SMS)) { - isSms = true; + if (jurorDetail.getJuror().getAltPhoneNumber() != null && !notificationsSent.equals( + EMAIL_NOTIFICATION_SENT) + && appSetting.getSendEmailOrSms() == SEND_EMAIL_OR_SMS) { + + jurorCommsNotificationService.sendJurorCommsSms( jurorDetail, JurorCommsNotifyTemplateType.SENT_TO_COURT, @@ -97,13 +97,13 @@ public SchedulerServiceClient.Result process() { null, true ); - successCountSms++; } // Send SMS if (jurorDetail.getJuror().getAltPhoneNumber() != null - && !Objects.equals(appSetting.getSendEmailOrSms(), SEND_EMAIL_OR_SMS)) { - isSms = true; + && appSetting.getSendEmailOrSms() != SEND_EMAIL_OR_SMS) { + + jurorCommsNotificationService.sendJurorCommsSms( jurorDetail, JurorCommsNotifyTemplateType.SENT_TO_COURT, @@ -111,53 +111,29 @@ public SchedulerServiceClient.Result process() { null, true ); - successCountSms++; + } //update regardless - stop processing next time. jurorDetail.getJuror().setNotifications(ALL_NOTIFICATION_SENT); notificationsSent = ALL_NOTIFICATION_SENT; update(jurorDetail); - successCount++; } catch (JurorCommsNotificationServiceException e) { - boolean isError = false; - if (isEmail) { - if (NotifyUtil.isInvalidEmailAddressError(e.getCause())) { - errorInvalidEmailCount++; - } else { - isError = true; - errorCountEmail++; - } - } - if (isSms) { - if (NotifyUtil.isInvalidPhoneNumberError(e.getCause())) { - errorInvalidPhoneCount++; - } else { - isError = true; - errorCountSms++; - } - } - if (isError) { - errorCount++; - log.error( - "Unable to send sent to court comms for {}", - jurorDetail.getJurorNumber(), e - ); - } + log.error( + "Unable to send sent to court comms for {} : {} {}", + jurorDetail.getJurorNumber(), + e.getMessage(), + e.getCause().toString() + ); + errorCount++; if (notificationsSent.equals(EMAIL_NOTIFICATION_SENT)) { jurorDetail.getJuror().setNotifications(notificationsSent); update(jurorDetail); } } catch (Exception e) { - log.error("Sent To Court Comms Processing : Juror Comms failed : {}", e.getMessage(), e); + log.error("Sent To Court Comms Processing : Juror Comms failed : {}", e.getMessage()); errorCount++; - if (isEmail) { - errorCountEmail++; - } - if (isSms) { - errorCountSms++; - } } } log.info("Sent To Court Comms Processing : Finished - {}", dateFormat.format(new Date())); @@ -165,17 +141,7 @@ public SchedulerServiceClient.Result process() { errorCount == 0 ? SchedulerServiceClient.Result.Status.SUCCESS : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, null, - Map.of( - "SUCCESS_COUNT_EMAIL", String.valueOf(successCountEmail), - "SUCCESS_COUNT_SMS", String.valueOf(successCountSms), - "ERROR_COUNT_EMAIL", String.valueOf(errorCountEmail), - "ERROR_COUNT_SMS", String.valueOf(errorCountSms), - "COUNT_INVALID_EMAIL", String.valueOf(errorInvalidEmailCount), - "COUNT_INVALID_PHONE", String.valueOf(errorInvalidPhoneCount), - "SUCCESS_COUNT", String.valueOf(successCount), - "ERROR_COUNT", String.valueOf(errorCount), - "TOTAL_JURORS", String.valueOf(jurordetailList.size()) - )); + Map.of("ERROR_COUNT", "" + errorCount)); } /** @@ -183,15 +149,26 @@ public SchedulerServiceClient.Result process() { */ private void update(JurorPool jurorDetails) { try { + log.trace("Inside update ....."); jurorRepository.save(jurorDetails); log.trace("Updating Juror notification as sent ({})... ", jurorDetails.getJuror().getNotifications()); } catch (TransactionSystemException e) { Throwable cause = e.getRootCause(); - throw new JurorCommsNotificationServiceException( - "Failed to update db to " - + jurorDetails.getJuror().getNotifications() + ". Manual update required. ", - cause - ); + // if (poolDetails.getNotifications().equals(EMAIL_NOTIFICATION_SENT)) { + if (jurorDetails.getJuror().getNotifications() == (EMAIL_NOTIFICATION_SENT)) { + log.trace("notifications is : {} - logging error", jurorDetails.getJuror().getNotifications()); + log.error("Failed to update db to {}. Manual update required. {}", + jurorDetails.getJuror().getNotifications(), + cause.toString() + ); + } else { + log.trace("notifications is : {} - throwing excep", jurorDetails.getJuror().getNotifications()); + throw new JurorCommsNotificationServiceException( + "Failed to update db to " + + jurorDetails.getJuror().getNotifications() + ". Manual update required. ", + cause + ); + } } } diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsWeeklyInfoServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsWeeklyInfoServiceImpl.java index b8121d96e..6a93fbec2 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsWeeklyInfoServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorCommsWeeklyInfoServiceImpl.java @@ -3,7 +3,7 @@ import com.google.common.collect.Lists; import com.querydsl.core.types.dsl.BooleanExpression; -import lombok.AllArgsConstructor; +import io.jsonwebtoken.lang.Assert; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -15,7 +15,6 @@ import uk.gov.hmcts.juror.api.moj.domain.JurorPool; import uk.gov.hmcts.juror.api.moj.repository.JurorPoolQueries; import uk.gov.hmcts.juror.api.moj.repository.JurorPoolRepository; -import uk.gov.hmcts.juror.api.moj.utils.NotifyUtil; import java.text.SimpleDateFormat; import java.util.Date; @@ -27,14 +26,26 @@ */ @Slf4j @Service -@AllArgsConstructor(onConstructor = @__(@Autowired)) public class JurorCommsWeeklyInfoServiceImpl implements BureauProcessService { private static final Integer NOTIFICATION_SENT = 1; private final JurorCommsNotificationService jurorCommsNotificationService; + + private final JurorPoolRepository jurorRepository; + @Autowired + public JurorCommsWeeklyInfoServiceImpl( + final JurorCommsNotificationService jurorCommsNotificationService, + final JurorPoolRepository jurorRepository) { + Assert.notNull(jurorCommsNotificationService, "JurorCommsNotificationService cannot be null."); + Assert.notNull(jurorRepository, "JurorRepository cannot be null."); + this.jurorCommsNotificationService = jurorCommsNotificationService; + this.jurorRepository = jurorRepository; + + } + /** * Implements a specific job execution. * Processes entries in the Juror table and sends the appropriate email notifications to @@ -55,7 +66,6 @@ public SchedulerServiceClient.Result process() { int infoCommsSent = 0; int noEmailAddress = 0; - int invalidEmailAddress = 0; int infoCommsfailed = 0; for (JurorPool jurorDetail : jurordetailList) { @@ -77,17 +87,15 @@ public SchedulerServiceClient.Result process() { update(jurorDetail); } catch (JurorCommsNotificationServiceException e) { - if (NotifyUtil.isInvalidEmailAddressError(e.getCause())) { - invalidEmailAddress++; - } else { - log.error( - "Unable to send Informational comms for {}", - jurorDetail.getJurorNumber(), e - ); - infoCommsfailed++; - } + log.error( + "Unable to send Informational comms for " + + jurorDetail.getJurorNumber() + + " : " + e.getMessage() + + " " + e.getCause().toString(), e + ); + infoCommsfailed++; } catch (Exception e) { - log.error("Informational Comms Processing : Juror Comms failed", e); + log.error("Informational Comms Processing : Juror Comms failed : " + e.getMessage(), e); infoCommsfailed++; } } @@ -100,10 +108,9 @@ public SchedulerServiceClient.Result process() { ? SchedulerServiceClient.Result.Status.SUCCESS : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, null, Map.of( - "INFO_COMMS_SENT", String.valueOf(infoCommsSent), - "INFO_COMMS_FAILED", String.valueOf(infoCommsfailed), - "NO_EMAIL_ADDRESS", String.valueOf(noEmailAddress), - "INVALID_EMAIL_ADDRESS", String.valueOf(invalidEmailAddress) + "INFO_COMMS_SENT", "" + infoCommsSent, + "INFO_COMMS_FAILED", "" + infoCommsfailed, + "NO_EMAIL_ADDRESS", "" + noEmailAddress )); } diff --git a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorDashboardSmartSurveyImportImpl.java b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorDashboardSmartSurveyImportImpl.java index 760521fc4..2362eef5f 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorDashboardSmartSurveyImportImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/bureau/service/JurorDashboardSmartSurveyImportImpl.java @@ -79,7 +79,6 @@ public SchedulerServiceClient.Result process() { List surveyResponseList; int dbInsertCount = 0; int dbSkipCount = 0; - int errorCount = 0; SmartSurveyConfigurationProperties.Proxy proxyProperties = smartSurveyConfigurationProperties.getProxy(); @@ -87,6 +86,8 @@ public SchedulerServiceClient.Result process() { // these settings are required for the process to continue log.info("Smart Survey config enabled: {}", smartSurveyEnabled); log.info("Smart Survey config exports url: {}", smartSurveyExportsUrl); + //log.info("Smart Survey config token: {}", smartSurveyToken); + //log.info("Smart Survey config secret: {}", smartSurveyTokenSecret); if (!smartSurveyEnabled) { log.info("Smart Survey data import disabled in application settings"); @@ -114,16 +115,20 @@ public SchedulerServiceClient.Result process() { log.info("Smart Survey proxy port: {}", proxyPort); log.info("Smart Survey proxy type: {}", proxyType); - proxy = new Proxy(proxyType, new InetSocketAddress(proxyHost, Integer.parseInt(proxyPort))); + proxy = new Proxy(proxyType, new InetSocketAddress(proxyHost, Integer.valueOf(proxyPort))); } else { + + proxyHost = null; + proxyPort = null; + proxyType = null; proxy = null; + log.info("Smart Survey proxy settings ignored"); } } catch (Exception e) { log.error("Smart Survey unable to create proxy using application settings"); proxy = null; - errorCount++; } // Output settings retrieved from APP_SETTINGS table @@ -144,17 +149,22 @@ public SchedulerServiceClient.Result process() { log.error("Unable to obtain export download url from smart survey api"); throw new IllegalStateException("unable to obtain export download url from smart survey api"); } else { + exportUrl = exportUrl + smartSurveyCredentials; + surveyResponseList = getExportData(exportUrl, vars, startDate, surveyId); } // Add records to table SURVEY_RESPONSE if not existing - if (!surveyResponseList.isEmpty()) { + if (surveyResponseList.size() > 0) { log.info("Smart Survey records parsed (excluding header): {}", surveyResponseList.size()); - for (SurveyResponse objSurveyResponse : surveyResponseList) { + for (int i = 0; + i < surveyResponseList.size(); + i++) { + SurveyResponse objSurveyResponse = surveyResponseList.get(i); SurveyResponseKey objSurveyResponseKey = new SurveyResponseKey(); objSurveyResponseKey.setId(objSurveyResponse.getId()); objSurveyResponseKey.setSurveyId(objSurveyResponse.getSurveyId()); @@ -164,8 +174,8 @@ public SchedulerServiceClient.Result process() { this.surveyResponseRepository.save(objSurveyResponse); dbInsertCount++; } catch (Exception e) { - errorCount++; - log.error("Error inserting survey record: {} - {}", e.getMessage(), objSurveyResponse); + log.error("Error inserting survey record: {}", e.getMessage()); + log.error("Error inserting survey record: {}", objSurveyResponse); } } else { // record already exists @@ -176,7 +186,6 @@ public SchedulerServiceClient.Result process() { log.info("Records inserted: {}", dbInsertCount); log.info("Records skipped: {}", dbSkipCount); - log.info("Records with error: {}", errorCount); } @@ -184,16 +193,11 @@ public SchedulerServiceClient.Result process() { log.info("Smart Survey Processing : FINISHED- {}", dateFormatSurvey.format(new Date())); - return new SchedulerServiceClient.Result(errorCount == 0 - ? SchedulerServiceClient.Result.Status.SUCCESS - : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, - errorCount == 0 - ? "Successfully loaded survey records" - : "Error loading some survey records", + return new SchedulerServiceClient.Result(SchedulerServiceClient.Result.Status.SUCCESS, + "Successfully loaded survey records", Map.of( "RECORDS_INSERTED", String.valueOf(dbInsertCount), - "RECORDS_SKIPPED", String.valueOf(dbSkipCount), - "ERROR_COUNT", String.valueOf(errorCount) + "RECORDS_SKIPPED", String.valueOf(dbSkipCount) )); } @@ -207,9 +211,9 @@ private String getExportDownloadUrl(String smartSurveyUrl, Map v // Get the latest survey export URL from the smart survey API final String configExportName = this.appSetting.getSmartSurveySummonsResponseExportName(); - String smartSurveyExportList; - RestTemplate restTemplate; - HttpHeaders headers; + String smartSurveyExportList = null; + RestTemplate restTemplate = null; + HttpHeaders headers = null; log.info("Smart Survey request url: {}", smartSurveyUrl); log.info("Smart Survey config export name: {}", configExportName); @@ -248,7 +252,9 @@ private String getExportDownloadUrl(String smartSurveyUrl, Map v // Find the latest survey export matching the name set in the config List jsonList = new ArrayList(); - for (int i = 0; i < jsonArr.length(); i++) { + for (int i = 0; + i < jsonArr.length(); + i++) { JSONObject obj = jsonArr.getJSONObject(i); String exportName = obj.getString("name"); @@ -259,7 +265,7 @@ private String getExportDownloadUrl(String smartSurveyUrl, Map v } String exportUrl = null; //Get the Url for the latest export record - first item in list - if (!jsonList.isEmpty()) { + if (jsonList.size() > 0) { JSONObject obj = jsonList.get(0); log.debug("Smart Survey export details: {}", obj); exportUrl = obj.getString("href_download"); @@ -277,9 +283,9 @@ private List getExportData(String smartSurveyUrl, Map surveyResponseList = new ArrayList(); - String smartSurveyExportData; - RestTemplate restTemplate; - HttpHeaders headers; + String smartSurveyExportData = null; + RestTemplate restTemplate = null; + HttpHeaders headers = null; // get export data from Smart Survey API log.info("Smart Survey request url: {}", smartSurveyUrl); @@ -325,7 +331,9 @@ private List getExportData(String smartSurveyUrl, Map 1) { - for (int i = 1; i < arrCsvRows.length; i++) { + for (int i = 1; + i < arrCsvRows.length; + i++) { String csvRow = arrCsvRows[i]; String[] csvCols = csvRow.split(","); diff --git a/src/main/java/uk/gov/hmcts/juror/api/juror/notify/NotifyAdapterImpl.java b/src/main/java/uk/gov/hmcts/juror/api/juror/notify/NotifyAdapterImpl.java index 28a6edd92..9bf7f74dd 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/juror/notify/NotifyAdapterImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/juror/notify/NotifyAdapterImpl.java @@ -9,12 +9,14 @@ import uk.gov.service.notify.NotificationClientException; import uk.gov.service.notify.SendEmailResponse; import uk.gov.service.notify.SendSmsResponse; +//import uk.gov.service.notify.NotificationClient; @Component @Slf4j public class NotifyAdapterImpl implements NotifyAdapter { private final NotifyConfigurationProperties notifyProperties; private final NotificationClientApi notifyClient; + // private final NotificationClient notificationClient; private static final String MESSAGE_1 = "Notify send is disabled? {}"; private static final String MESSAGE_2 = "Notify http response code: {}"; @@ -22,12 +24,15 @@ public class NotifyAdapterImpl implements NotifyAdapter { @Autowired public NotifyAdapterImpl(final NotifyConfigurationProperties notifyProperties, + // final NotificationClient notificationClient, final NotificationClientApi notifyClient) { Assert.notNull(notifyProperties, "NotifyConfigurationProperties cannot be null"); Assert.notNull(notifyClient, "NotificationClient cannot be null"); + // Assert.notNull(notificationClient, "NotificationClient cannot be null"); this.notifyProperties = notifyProperties; this.notifyClient = notifyClient; + // this.notificationClient = notificationClient; } @Override @@ -110,6 +115,7 @@ public EmailNotificationReceipt sendCommsEmail(final EmailNotification notificat log.warn("Juror Comms Notify response was null!"); } } catch (NotificationClientException e) { + //log.error("Failed to send via Notify: {}", e); log.trace(MESSAGE_2, e.getHttpResult()); throw new NotifyApiException("Failed to send Juror Comms via Notify: {}", e); } catch (Exception e) { @@ -146,6 +152,8 @@ public SmsNotificationReceipt sendCommsSms(final SmsNotification notification) t notification.getPayload(), notification.getReferenceNumber() ); + //final SendEmailResponse sendEmailResponse = notifyClient.sendEmail(notification.getTemplateId(), + // notification.getRecipientEmail(), notification.getPayload(), notification.getReferenceNumber()); if (log.isTraceEnabled()) { log.trace("Juror Comms SMS Notify responded: {}", sendSmsResponse); } @@ -156,6 +164,7 @@ public SmsNotificationReceipt sendCommsSms(final SmsNotification notification) t log.warn("Juror Comms SMS Notify response was null!"); } } catch (NotificationClientException e) { + //log.error("Failed to send via Notify: {}", e); log.trace(MESSAGE_2, e.getHttpResult()); throw new NotifyApiException("Failed to send Juror Comms SMS via Notify: {}", e); } catch (Exception e) { diff --git a/src/main/java/uk/gov/hmcts/juror/api/juror/service/ExcusedCompletedCourtCommsServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/juror/service/ExcusedCompletedCourtCommsServiceImpl.java index 09309fbcf..9d815d52a 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/juror/service/ExcusedCompletedCourtCommsServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/juror/service/ExcusedCompletedCourtCommsServiceImpl.java @@ -2,6 +2,7 @@ import com.google.common.collect.Lists; import com.querydsl.core.types.dsl.BooleanExpression; +import io.jsonwebtoken.lang.Assert; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -20,7 +21,7 @@ import uk.gov.hmcts.juror.api.moj.repository.JurorPoolRepository; import uk.gov.hmcts.juror.api.moj.repository.RegionNotifyTemplateQueriesMod; import uk.gov.hmcts.juror.api.moj.repository.RegionNotifyTemplateRepositoryMod; -import uk.gov.hmcts.juror.api.moj.utils.NotifyUtil; +import uk.gov.hmcts.juror.api.moj.service.AppSettingService; import uk.gov.service.notify.NotificationClient; import uk.gov.service.notify.NotificationClientException; import uk.gov.service.notify.SendEmailResponse; @@ -42,27 +43,40 @@ public class ExcusedCompletedCourtCommsServiceImpl implements BureauProcessService { private final JurorPoolRepository jurorRepository; + private final CourtRegionModRepository courtRegionModRepository; private final RegionNotifyTemplateRepositoryMod regionNotifyTemplateRepositoryMod; - private final NotifyConfigurationProperties notifyConfigurationProperties; - private final NotifyRegionsConfigurationProperties notifyRegionsConfigurationProperties; + private Proxy proxy; private final String messagePlaceHolderJurorNumber = "JURORNUMBER"; private final String messagePlaceHolderlocationCode = "lOCATIONCODE"; private final String updateMessageStatusSent = "SENTNOTIFY"; private final String updateMessageStatusNotSent = "NOTSENT"; - private Proxy proxy; + private final NotifyConfigurationProperties notifyConfigurationProperties; + private final NotifyRegionsConfigurationProperties notifyRegionsConfigurationProperties; @Autowired public ExcusedCompletedCourtCommsServiceImpl( + + final AppSettingService appSetting, + final JurorPoolRepository jurorRepository, final CourtRegionModRepository courtRegionModRepository, final NotifyConfigurationProperties notifyConfigurationProperties, final NotifyRegionsConfigurationProperties notifyRegionsConfigurationProperties, + final RegionNotifyTemplateRepositoryMod regionNotifyTemplateRepositoryMod) { + Assert.notNull(jurorRepository, "JurorPoolRepository cannot be null."); + Assert.notNull(appSetting, "AppSettingService cannot be null."); + Assert.notNull(courtRegionModRepository, "CourtRegionModRepository cannot be null."); + Assert.notNull(notifyConfigurationProperties, "NotifyConfigurationProperties cannot be null."); + Assert.notNull(notifyRegionsConfigurationProperties, "NotifyRegionsConfigurationProperties cannot be null."); + + Assert.notNull(regionNotifyTemplateRepositoryMod, "RegionNotifyTemplateRepositoryMod cannot be null."); this.jurorRepository = jurorRepository; this.courtRegionModRepository = courtRegionModRepository; this.notifyConfigurationProperties = notifyConfigurationProperties; this.notifyRegionsConfigurationProperties = notifyRegionsConfigurationProperties; + this.regionNotifyTemplateRepositoryMod = regionNotifyTemplateRepositoryMod; } @@ -85,6 +99,8 @@ public SchedulerServiceClient.Result process() { Map myRegionMap = new HashMap<>(); + @SuppressWarnings("PMD.VariableDeclarationUsageDistance") + int errorCount = 0; List regionIds = setUpRegionIds(); List notifyRegionIds = setUpNotifyRegionKeys(); for (int i = 0; i < notifyRegionIds.size(); i++) { @@ -92,40 +108,23 @@ public SchedulerServiceClient.Result process() { } log.debug("Display myRegionMap {}", myRegionMap); - final Metrics excusalMetrics = processExcusalList(gotProxy, myRegionMap); - final Metrics completedMetrics = processCompleted(gotProxy, myRegionMap); + errorCount += processExcusalList(gotProxy, myRegionMap); + errorCount += processCompleted(gotProxy, myRegionMap); + log.info("Excused Completed Court Comms Processing : Finished - {}", dateFormat.format(new Date())); return new SchedulerServiceClient.Result( - excusalMetrics.errorCount == 0 && completedMetrics.errorCount == 0 + errorCount == 0 ? SchedulerServiceClient.Result.Status.SUCCESS : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, null, - getMetaData(excusalMetrics, completedMetrics)); - } - - private static Map getMetaData(Metrics excusalMetrics, Metrics completedMetrics) { - Map metaData = new HashMap<>(); - metaData.put("EXCUSAL_IDENTIFIED", String.valueOf(excusalMetrics.jurorPoolsIdentified)); - metaData.put("EXCUSAL_ERROR_COUNT", String.valueOf(excusalMetrics.errorCount)); - metaData.put("EXCUSAL_INVALID_PHONE_COUNT", String.valueOf(excusalMetrics.invalidPhoneCount)); - metaData.put("EXCUSAL_INVALID_EMAIL_COUNT", String.valueOf(excusalMetrics.invalidEmailAddressCount)); - metaData.put("EXCUSAL_SUCCESS_COUNT", String.valueOf(excusalMetrics.successCount)); - metaData.put("EXCUSAL_MISSING_EMAIL_PHONE", String.valueOf(excusalMetrics.missingEmailAndPhone)); - - metaData.put("COMPLETED_IDENTIFIED", String.valueOf(completedMetrics.jurorPoolsIdentified)); - metaData.put("COMPLETED_ERROR_COUNT", String.valueOf(completedMetrics.errorCount)); - metaData.put("COMPLETED_INVALID_PHONE_COUNT", String.valueOf(completedMetrics.invalidPhoneCount)); - metaData.put("COMPLETED_INVALID_EMAIL_COUNT", String.valueOf(completedMetrics.invalidEmailAddressCount)); - metaData.put("COMPLETED_SUCCESS_COUNT", String.valueOf(completedMetrics.successCount)); - metaData.put("COMPLETED_MISSING_EMAIL_PHONE", String.valueOf(completedMetrics.missingEmailAndPhone)); - return metaData; + Map.of("ERROR_COUNT", "" + errorCount)); } public Proxy setUpConnection() { final NotifyConfigurationProperties.Proxy setUpProxy = notifyConfigurationProperties.getProxy(); if (setUpProxy != null && setUpProxy.isEnabled()) { String setupHost = setUpProxy.getHost(); - int setupPort = Integer.parseInt(setUpProxy.getPort()); + Integer setupPort = Integer.valueOf(setUpProxy.getPort()); Proxy.Type setupType = setUpProxy.getType(); final InetSocketAddress socketAddress = new InetSocketAddress(setupHost, setupPort); proxy = new Proxy(setupType, socketAddress); @@ -143,6 +142,14 @@ private void updateCommsStatusFlagCompleted(JurorPool poolCourtDetailCompletedLi } catch (TransactionSystemException e) { Throwable cause = e.getRootCause(); if (poolCourtDetailCompletedList.getJuror().getServiceCompCommsStatus() == null) { + log.trace( + "ServiceCompCommsStatus is : {} - logging error", + poolCourtDetailCompletedList.getJuror().getServiceCompCommsStatus() + ); + log.info( + "ServiceCompCommsStatus is : {} - logging error", + poolCourtDetailCompletedList.getJuror().getServiceCompCommsStatus() + ); log.error( "Failed to update db to {}. Manual update required. {}", poolCourtDetailCompletedList.getJuror().getServiceCompCommsStatus(), @@ -171,6 +178,14 @@ private void updateCommsStatusFlagExcusal(JurorPool poolCourtDetailExcusalList) } catch (TransactionSystemException e) { Throwable cause = e.getRootCause(); if (poolCourtDetailExcusalList.getJuror().getServiceCompCommsStatus() == null) { + log.trace( + "ServiceCompCommsStatus is : {} - logging error", + poolCourtDetailExcusalList.getJuror().getServiceCompCommsStatus() + ); + log.info( + "ServiceCompCommsStatus is : {} - logging error", + poolCourtDetailExcusalList.getJuror().getServiceCompCommsStatus() + ); log.error( "Failed to update db to {}. Manual update required. {}", poolCourtDetailExcusalList.getJuror().getServiceCompCommsStatus(), @@ -205,6 +220,7 @@ public List setUpRegionIds() { for (CourtRegionMod courtRegion : courtRegions) { String courtregionIds = courtRegion.getRegionId(); regionIds.add(courtregionIds); + log.info("CourtRegions {}", courtRegion.getRegionId()); } @@ -212,7 +228,7 @@ public List setUpRegionIds() { return regionIds; } - public Metrics processExcusalList(Proxy gotProxy, Map myRegionMap) { + public int processExcusalList(Proxy gotProxy, Map myRegionMap) { final List jurorCourtDetailListExcusal = Lists.newLinkedList(jurorRepository.findAll( JurorPoolQueries.recordsForExcusalComms())); @@ -222,12 +238,6 @@ public Metrics processExcusalList(Proxy gotProxy, Map myRegionMa ); int errorCount = 0; - int invalidPhoneCount = 0; - int invalidEmailCount = 0; - int successCount = 0; - int missingEmailAndPhone = 0; - int missingApiKeyCount = 0; - for (JurorPool jurorCourtDetailExcusalList : jurorCourtDetailListExcusal) { log.info("poolCourtDetailExcusalList PART_NO : {}", jurorCourtDetailExcusalList.getJurorNumber()); log.info("Excusal Date: {}", jurorCourtDetailExcusalList.getJuror().getExcusalDate()); @@ -262,11 +272,12 @@ public Metrics processExcusalList(Proxy gotProxy, Map myRegionMa if (regionApikey == null || regionApikey.isEmpty()) { - log.error("Missing Notify Api Account key Cannot send notify communication"); + log.error("Missing Notify Api Account key Cannot send notify communication: "); + log.info("Missing Notify Api Account key Cannot send notify communication: "); jurorCourtDetailExcusalList.getJuror().setServiceCompCommsStatus(updateMessageStatusNotSent); updateCommsStatusFlagExcusal(jurorCourtDetailExcusalList); - missingApiKeyCount++; + continue; } @@ -334,13 +345,13 @@ public Metrics processExcusalList(Proxy gotProxy, Map myRegionMa } } else { log.info("No Email or phone"); - missingEmailAndPhone++; continue; } for (RegionNotifyTemplateMod regionNotifyTemplateMod : regionNotifyTriggeredExcusalTemplateList) { UUID notificationId; if (hasEmail) { + String emailExcusalTemplateId = regionNotifyTemplateMod.getNotifyTemplateId(); SendEmailResponse emailResponse = notificationClient.sendEmail( emailExcusalTemplateId, @@ -363,36 +374,26 @@ public Metrics processExcusalList(Proxy gotProxy, Map myRegionMa if (notificationId != null) { jurorCourtDetailExcusalList.getJuror().setServiceCompCommsStatus(updateMessageStatusSent); updateCommsStatusFlagExcusal(jurorCourtDetailExcusalList); - successCount++; - } else { - errorCount++; } } } catch (NotificationClientException e) { - log.info("Unable to send notify: {}", e.getMessage()); + log.error("Failed to send via Notify: {}", e); + log.trace("Unable to send notify: {}", e.getHttpResult()); + log.info("Unable to send notify: {}", e.getHttpResult()); jurorCourtDetailExcusalList.getJuror().setServiceCompCommsStatus(updateMessageStatusNotSent); updateCommsStatusFlagExcusal(jurorCourtDetailExcusalList); - if (NotifyUtil.isInvalidPhoneNumberError(e)) { - invalidPhoneCount++; - } else if (NotifyUtil.isInvalidEmailAddressError(e)) { - invalidEmailCount++; - } else { - log.error("Failed to send via Notify: {}", e.getMessage(), e); - errorCount++; - } + errorCount++; } catch (Exception e) { - log.error("Unexpected exception: {}", e.getMessage(), e); + log.info("Unexpected exception: {}", e); errorCount++; } } - return new Metrics(jurorCourtDetailListExcusal.size(), errorCount, successCount, - missingEmailAndPhone, missingApiKeyCount, - invalidPhoneCount, invalidEmailCount); + return errorCount; } - private Metrics processCompleted(Proxy gotProxy, Map myRegionMap) { - + private int processCompleted(Proxy gotProxy, Map myRegionMap) { + int errorCount = 0; final List jurorCourtDetailListCompleted = Lists.newLinkedList(jurorRepository.findAll( JurorPoolQueries.recordsForServiceCompletedComms())); @@ -400,12 +401,7 @@ private Metrics processCompleted(Proxy gotProxy, Map myRegionMap "jurorCourtDetailListCompleted Number of Completed Records to process {}", jurorCourtDetailListCompleted.size() ); - int errorCount = 0; - int invalidPhoneCount = 0; - int invalidEmailCount = 0; - int successCount = 0; - int missingEmailAndPhone = 0; - int missingApiKeyCount = 0; + for (JurorPool jurorCourtDetailCompletedList : jurorCourtDetailListCompleted) { log.info("jurorCourtDetailListCompleted PART_NO {}", jurorCourtDetailCompletedList.getJurorNumber()); @@ -420,13 +416,19 @@ private Metrics processCompleted(Proxy gotProxy, Map myRegionMap final int emailLength = (email != null ? email.length() : 0); if (emailLength == 1) { + jurorCourtDetailCompletedList.getJuror().setEmail(null); + updateCommsStatusFlagCompleted(jurorCourtDetailCompletedList); + } final String locCode = jurorCourtDetailCompletedList.getCourt().getLocCode(); final String jurorNumber = jurorCourtDetailCompletedList.getJurorNumber(); final String reference = jurorCourtDetailCompletedList.getJurorNumber(); + + // String apiKey = (poolCourtDetailCompletedList != null ? poolCourtDetailCompletedList.getCourt() + // .getCourtRegion().getNotifyAccountKey() : null); final String regionId = jurorCourtDetailCompletedList.getCourt().getCourtRegion().getRegionId(); final String regionApikey = myRegionMap.get(regionId); log.debug("regionApikey {} ", regionApikey); @@ -434,9 +436,10 @@ private Metrics processCompleted(Proxy gotProxy, Map myRegionMap if (regionApikey == null || regionApikey.isEmpty()) { log.error("Missing Notify Api Account key Cannot send notify communication: "); + log.info("Missing Notify Api Account key Cannot send notify communication: "); jurorCourtDetailCompletedList.getJuror().setServiceCompCommsStatus(updateMessageStatusNotSent); updateCommsStatusFlagCompleted(jurorCourtDetailCompletedList); - missingApiKeyCount++; + continue; } @@ -498,8 +501,6 @@ private Metrics processCompleted(Proxy gotProxy, Map myRegionMap regionNotifyTemplateRepositoryMod.findAll(regionNotifyTriggeredCompleteTemplateSmsFilter)); } } else { - log.info("No Email or phone"); - missingEmailAndPhone++; continue; } @@ -533,38 +534,22 @@ private Metrics processCompleted(Proxy gotProxy, Map myRegionMap if (notificationId != null) { jurorCourtDetailCompletedList.getJuror().setServiceCompCommsStatus(updateMessageStatusSent); updateCommsStatusFlagCompleted(jurorCourtDetailCompletedList); - successCount++; - } else { - errorCount++; } } } catch (NotificationClientException e) { - log.info("Unable to send notify: {}", e.getMessage()); + + log.error("Failed to send via Notify: {}", e); + log.trace("Unable to send notify: {}", e.getHttpResult()); + log.info("Unable to send notify: {}", e.getHttpResult()); jurorCourtDetailCompletedList.getJuror().setServiceCompCommsStatus(updateMessageStatusNotSent); + updateCommsStatusFlagCompleted(jurorCourtDetailCompletedList); errorCount++; - if (NotifyUtil.isInvalidPhoneNumberError(e)) { - invalidPhoneCount++; - } else if (NotifyUtil.isInvalidEmailAddressError(e)) { - invalidEmailCount++; - } else { - log.error("Failed to send via Notify: {}", e.getMessage(), e); - errorCount++; - } - } catch (Exception e) { - log.error("Unexpected exception:", e); + log.info("Unexpected exception: {}", e); errorCount++; } } - return new Metrics(jurorCourtDetailListCompleted.size(), errorCount, successCount, - missingEmailAndPhone, missingApiKeyCount, - invalidPhoneCount, invalidEmailCount); - } - - public record Metrics(int jurorPoolsIdentified, int errorCount, int successCount, - int missingEmailAndPhone, int missingApiKeyCount, - int invalidPhoneCount, int invalidEmailAddressCount) { - + return errorCount; } } \ No newline at end of file diff --git a/src/main/java/uk/gov/hmcts/juror/api/juror/service/MessagesServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/juror/service/MessagesServiceImpl.java index 378424657..0dabd8fc3 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/juror/service/MessagesServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/juror/service/MessagesServiceImpl.java @@ -5,7 +5,6 @@ import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -22,7 +21,6 @@ import uk.gov.hmcts.juror.api.moj.repository.RegionNotifyTemplateQueriesMod; import uk.gov.hmcts.juror.api.moj.repository.RegionNotifyTemplateRepositoryMod; import uk.gov.hmcts.juror.api.moj.service.AppSettingService; -import uk.gov.hmcts.juror.api.moj.utils.NotifyUtil; import uk.gov.service.notify.NotificationClient; import uk.gov.service.notify.NotificationClientException; import uk.gov.service.notify.SendEmailResponse; @@ -47,6 +45,7 @@ public class MessagesServiceImpl implements BureauProcessService { private static final String MESSAGE_PLACEHOLDER_JUROR = "JURORNUMBER"; private static final String MESSAGE_READ = "SN"; private static final String MESSAGE_READ_APP_ERROR = "NS"; + private static final String MESSAGE_NOT_READ = "NR"; private static final int CHECK_NUM = 1; private static final String LOG_ERROR_MESSAGE_TEMPLATE_ID = " Missing templateId. Cannot send notify " @@ -79,10 +78,14 @@ public SchedulerServiceClient.Result process() { // keys as values Map myRegionMap = new HashMap<>(); + @SuppressWarnings("PMD.VariableDeclarationUsageDistance") + int errorCount = 0; List notifyRegionKeys = setUpNotifyRegionKeys(); List regionIds = setUpRegionIds(); - for (int i = 0; i < notifyRegionKeys.size(); i++) { + for (int i = 0; + i < notifyRegionKeys.size(); + i++) { myRegionMap.put(regionIds.get(i), notifyRegionKeys.get(i)); } @@ -99,13 +102,6 @@ public SchedulerServiceClient.Result process() { Map templateDetailsMap = new HashMap<>(); - int errorCount = 0; - int invalidPhoneCount = 0; - int invalidEmailCount = 0; - int missingApiKeyCount = 0; - int missingEmailAndPhone = 0; - int emailSuccess = 0; - int smsSuccess = 0; for (Message messagesDetail : messageDetailList) { log.info("messagesDetail Juror number : {}", messagesDetail.getJurorNumber()); @@ -128,6 +124,9 @@ public SchedulerServiceClient.Result process() { final String textMessage = messagesDetail.getMessageText(); final String reference = (messagesDetail.getJurorNumber()); + + // String apiKey = (messagesDetail != null ? messagesDetail.getLocationCode().getCourtRegion() + // .getNotifyAccountKey() : null); final String regionId = messagesDetail.getLocationCode().getCourtRegion().getRegionId(); final String regionApikey = myRegionMap.get(regionId); log.debug("regionApikey {} ", regionApikey); @@ -138,7 +137,7 @@ public SchedulerServiceClient.Result process() { regionId); messagesDetail.setMessageRead(MESSAGE_READ_APP_ERROR); updateMessageFlag(messagesDetail); - missingApiKeyCount++; + continue; } @@ -147,13 +146,10 @@ public SchedulerServiceClient.Result process() { personalisation.put(MESSAGE_PLACEHOLDER_JUROR, jurorNumber); - final boolean isEmail = StringUtils.isNotBlank(email); - final boolean isPhone = StringUtils.isNotBlank(phoneNumber); + final boolean isEmail = messagesDetail.getEmail() != null; + final boolean isPhone = messagesDetail.getPhone() != null; if (!isEmail && !isPhone) { - messagesDetail.setMessageRead(MESSAGE_READ_APP_ERROR); - updateMessageFlag(messagesDetail); - missingEmailAndPhone++; continue; } @@ -188,13 +184,11 @@ public SchedulerServiceClient.Result process() { smsTemplateId, email, personalisation, reference); response = emailResponse; notificationId = emailResponse.getNotificationId(); - emailSuccess++; } else if (isPhone) { SendSmsResponse smsResponse = notifyClient.sendSms(smsTemplateId, phoneNumber, personalisation, reference); response = smsResponse; notificationId = smsResponse.getNotificationId(); - smsSuccess++; } if (notificationId != null) { @@ -204,17 +198,10 @@ public SchedulerServiceClient.Result process() { log.trace("Court Comms sms messaging Service : response {}", response); } } catch (NotificationClientException e) { - log.info("Failed to send via Notify - {}", e.getMessage()); + log.error("Failed to send via Notify", e); messagesDetail.setMessageRead(MESSAGE_READ_APP_ERROR); updateMessageFlag(messagesDetail); - if (NotifyUtil.isInvalidPhoneNumberError(e)) { - invalidPhoneCount++; - } else if (NotifyUtil.isInvalidEmailAddressError(e)) { - invalidEmailCount++; - } else { - log.error("Failed to send via Notify", e); - errorCount++; - } + errorCount++; } catch (Exception e) { log.error("Unexpected exception when sending details to notify", e); errorCount++; @@ -226,17 +213,7 @@ public SchedulerServiceClient.Result process() { errorCount == 0 ? SchedulerServiceClient.Result.Status.SUCCESS : SchedulerServiceClient.Result.Status.PARTIAL_SUCCESS, null, - Map.of( - "TOTAL_MESSAGES_TO_SEND", String.valueOf(messageDetailList.size()), - "ERROR_COUNT", String.valueOf(errorCount), - "MISSING_API_KEY_COUNT", String.valueOf(missingApiKeyCount), - "MISSING_EMAIL_AND_PHONE", String.valueOf(missingEmailAndPhone), - "EMAIL_SUCCESS", String.valueOf(emailSuccess), - "SMS_SUCCESS", String.valueOf(smsSuccess), - - "INVALID_PHONE_COUNT", String.valueOf(invalidPhoneCount), - "INVALID_EMAIL_COUNT", String.valueOf(invalidEmailCount) - )); + Map.of("ERROR_COUNT", "" + errorCount)); } private TemplateDetails createTemplateDetails(Message messagesDetail) { diff --git a/src/main/java/uk/gov/hmcts/juror/api/moj/domain/JurorPool.java b/src/main/java/uk/gov/hmcts/juror/api/moj/domain/JurorPool.java index f7931fb30..f2b7be85b 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/moj/domain/JurorPool.java +++ b/src/main/java/uk/gov/hmcts/juror/api/moj/domain/JurorPool.java @@ -98,7 +98,7 @@ public class JurorPool implements Serializable { private LocalDate nextDate; @Column(name = "on_call") - private boolean onCall; + private Boolean onCall; @Length(max = 20) @Column(name = "smart_card") diff --git a/src/main/java/uk/gov/hmcts/juror/api/moj/repository/IAppearanceRepositoryImpl.java b/src/main/java/uk/gov/hmcts/juror/api/moj/repository/IAppearanceRepositoryImpl.java index 29f0d5fdb..e97749033 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/moj/repository/IAppearanceRepositoryImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/moj/repository/IAppearanceRepositoryImpl.java @@ -93,10 +93,9 @@ public List retrieveAttendanceDetails(RetrieveAttendanceDetailsDto reques || commonData.getTag().equals(RetrieveAttendanceDetailsTag.PANELLED)) { query = query.where(APPEARANCE.appearanceStage.eq(AppearanceStage.CHECKED_IN)); } else if (commonData.getTag().equals(RetrieveAttendanceDetailsTag.CONFIRM_ATTENDANCE)) { - query = query.where(APPEARANCE.timeIn.isNotNull()) - .where(APPEARANCE.appearanceStage.in(AppearanceStage.CHECKED_IN, AppearanceStage.CHECKED_OUT)) - .where(APPEARANCE.attendanceAuditNumber.isNull()) - .where(APPEARANCE.appearanceConfirmed.isFalse()); + // a confirmed juror can have appStage of CheckedIn or CheckedOut therefore cannot rely on appStage. A + // confirmed juror will always have TimeIn. + query = query.where(APPEARANCE.timeIn.isNotNull()); } // execute the query and return the results @@ -295,13 +294,13 @@ public Optional findByJurorNumberAndLocCodeAndAttendanceDateAndVersi try { return Optional.ofNullable((Appearance) AuditReaderFactory.get(entityManager) - .createQuery() - .forRevisionsOfEntity(Appearance.class, true, false) - .add(AuditEntity.property("jurorNumber").eq(jurorNumber)) - .add(AuditEntity.property("locCode").eq(locCode)) - .add(AuditEntity.property("attendanceDate").eq(attendanceDate)) - .add(AuditEntity.property("version").eq(appearanceVersion)) - .getSingleResult()); + .createQuery() + .forRevisionsOfEntity(Appearance.class, true, false) + .add(AuditEntity.property("jurorNumber").eq(jurorNumber)) + .add(AuditEntity.property("locCode").eq(locCode)) + .add(AuditEntity.property("attendanceDate").eq(attendanceDate)) + .add(AuditEntity.property("version").eq(appearanceVersion)) + .getSingleResult()); } catch (NoResultException e) { return Optional.empty(); } diff --git a/src/main/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceImpl.java index 1528729b2..d4f717687 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceImpl.java @@ -5,6 +5,7 @@ import lombok.NoArgsConstructor; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.text.WordUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.history.Revision; @@ -601,7 +602,7 @@ public void updateAttendance(UpdateAttendanceRequestDto dto) { private void validateOnCall(JurorPool jurorPool) { - if (jurorPool.isOnCall()) { + if (jurorPool.getOnCall() != null && jurorPool.getOnCall().equals(true)) { throw new MojException.BadRequest("Juror status is already on call", null); } } @@ -1196,7 +1197,7 @@ public JurorAttendanceDetailsResponseDto getJurorAttendanceDetails(String locCod responseDto.setNonAttendances((int) jurorAttendanceDetails.stream() .filter(p -> AttendanceType.NON_ATTENDANCE.equals(p.getAttendanceType())).count()); - responseDto.setOnCall(jurorPool.isOnCall()); + responseDto.setOnCall(ObjectUtils.defaultIfNull(jurorPool.getOnCall(), false)); responseDto.setNextDate(jurorPool.getNextDate()); return responseDto; diff --git a/src/main/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImpl.java b/src/main/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImpl.java index 2a93fb584..45ba28f1d 100644 --- a/src/main/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImpl.java +++ b/src/main/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImpl.java @@ -269,15 +269,13 @@ public void returnJury(BureauJwtPayload payload, String trialNumber, String loca appearance.setTimeOut(LocalTime.parse(returnJuryDto.getCheckOut())); log.debug("setting time out for juror %s".formatted(jurorNumber)); } - if (appearance.getAttendanceAuditNumber() == null) { - //Only give them an attendance number if they were checked out via this process - appearance.setAttendanceAuditNumber("J" + attendanceAuditNumber); - jurorHistoryService.createJuryAttendanceHistory(jurorPool, appearance, panel); - } + //Only give them an attendance number if they were checked out via this process + appearance.setAttendanceAuditNumber("J" + attendanceAuditNumber); } appearance.setTrialNumber(trialNumber); appearance.setSatOnJury(true); jurorAppearanceService.realignAttendanceType(appearance); + jurorHistoryService.createJuryAttendanceHistory(jurorPool, appearance, panel); } panel.setResult(PanelResult.RETURNED); diff --git a/src/main/java/uk/gov/hmcts/juror/api/moj/utils/NotifyUtil.java b/src/main/java/uk/gov/hmcts/juror/api/moj/utils/NotifyUtil.java deleted file mode 100644 index bc764fcc4..000000000 --- a/src/main/java/uk/gov/hmcts/juror/api/moj/utils/NotifyUtil.java +++ /dev/null @@ -1,28 +0,0 @@ -package uk.gov.hmcts.juror.api.moj.utils; - -import uk.gov.service.notify.NotificationClientException; - -public final class NotifyUtil { - - private NotifyUtil() { - - } - - public static boolean isInvalidPhoneNumberError(Throwable e) { - return doesMessageContain(e, "phone_number is a required property") - || doesMessageContain(e, "InvalidPhoneError"); - } - - public static boolean isInvalidEmailAddressError(Throwable e) { - return doesMessageContain(e, "email_address is a required property") - || doesMessageContain(e, "InvalidEmailAddressError"); - } - - public static boolean doesMessageContain(Throwable e, String message) { - if (e instanceof NotificationClientException notificationClientException) { - return notificationClientException.getMessage() != null - && notificationClientException.getMessage().contains(message); - } - return false; - } -} diff --git a/src/main/resources/db/migrationv2/V2_29__on_call_updates.sql b/src/main/resources/db/migrationv2/V2_29__on_call_updates.sql deleted file mode 100644 index ee1002833..000000000 --- a/src/main/resources/db/migrationv2/V2_29__on_call_updates.sql +++ /dev/null @@ -1,7 +0,0 @@ -update juror_mod.juror_pool jp -set on_call = false -where jp.on_call is null; - -alter table juror_mod.juror_pool - ALTER COLUMN on_call SET DEFAULT false, - ALTER COLUMN on_call SET NOT NULL; \ No newline at end of file diff --git a/src/main/resources/db/migrationv2/V2_30__util_report_update.sql b/src/main/resources/db/migrationv2/V2_30__util_report_update.sql deleted file mode 100644 index ec6aedf16..000000000 --- a/src/main/resources/db/migrationv2/V2_30__util_report_update.sql +++ /dev/null @@ -1,23 +0,0 @@ - --- utility function to return list of all days within the report window and holiday flag --- updated to correctly handle no trial days added by a court and multiple holidays on the same day -CREATE OR REPLACE FUNCTION juror_mod.util_report_report_days_list(p_loc_code text, p_start_date date, p_end_date date) - RETURNS TABLE(report_date date, holiday boolean) - LANGUAGE plpgsql -AS $function$ -begin - -return query - -with report_days as ( -select generate_series(p_start_date, p_end_date, '1 day'::interval)::date as report_day) - -select distinct(report_days.report_day) as report_date, - case when h.holiday is not null then true else false end as holiday -from report_days - left join juror_mod.holiday h on (report_days.report_day = h.holiday and (h.loc_code is null or h.loc_code = p_loc_code)) -order by report_days.report_day; - - END; -$function$ -; diff --git a/src/main/resources/db/migrationv2/V2_31__util_report_update.sql b/src/main/resources/db/migrationv2/V2_31__util_report_update.sql deleted file mode 100644 index 1c126fe38..000000000 --- a/src/main/resources/db/migrationv2/V2_31__util_report_update.sql +++ /dev/null @@ -1,38 +0,0 @@ - --- This function is used to generate a list of jurors who are in a pool during a given date range. --- Updated the query to only count genuine appearances rather than non-attendance or no-shows. -CREATE OR REPLACE FUNCTION juror_mod.util_report_pool_members_list(p_loc_code text, p_start_date date, p_end_date date) - RETURNS TABLE(juror_number character varying, attendance_date date, return_date date, service_start_date date, service_end_date date, min_status integer) - LANGUAGE plpgsql -AS $function$ -begin - - return query select - jp.juror_number, - min(a.attendance_date) attendance_date, - min(case when jp.is_active = true then p.return_date else to_date('01/12/2099', 'dd/mm/yyyy') end ) return_date, - greatest(least(coalesce(min(a.attendance_date), min(case when jp.is_active = true then p.return_date else to_date('01/12/2099', 'dd/mm/yyyy') end )), - min(case when jp.is_active = true then p.return_date else to_date('01/12/2099','dd/mm/yyyy') end )), p_start_date) service_start, - -- figure out if an appearance occurred before service start date and use that if applicable - least(min(coalesce(case when jp.status = 10 then jp.transfer_date else date(j.completion_date) end, p_end_date)),p_end_date) service_end, - min(status) min_status - from juror_mod.juror_pool jp - join juror_mod.juror j - on jp.juror_number = j.juror_number - join juror_mod.pool p - on jp.pool_number = p.pool_no - left join juror_mod.appearance a - on jp.juror_number = a.juror_number - where p.loc_code = a.loc_code - and (((jp.status in (2,3,4,10,13) or (jp.status = 7 and a.attendance_date is not null)) and jp.is_active = true) - or (jp.status = 8 and a.attendance_date is not null and j.completion_date is not null)) - and (a.non_attendance is null or a.non_attendance = false) and (a.no_show is null or a.no_show = false) - and p.loc_code = p_loc_code - and ((jp.status = 10 and jp.transfer_date >= p_start_date) - or (jp.status <> 10 and (j.completion_date is null or j.completion_date >= p_start_date))) - group by jp.juror_number - having (least(coalesce(min(a.attendance_date), min(case when jp.is_active = true then p.return_date else to_date('01/12/2099', 'dd/mm/yyyy') end)), - min(case when jp.is_active = true then p.return_date else to_date('01/12/2099', 'dd/mm/yyyy') end)) <= p_end_date); -END; -$function$ -; diff --git a/src/test/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceTest.java b/src/test/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceTest.java index d3a763345..d28840f9c 100644 --- a/src/test/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceTest.java +++ b/src/test/java/uk/gov/hmcts/juror/api/moj/service/JurorRecordServiceTest.java @@ -2276,7 +2276,7 @@ void updateAttendanceHappyPathOnCall() { verify(jurorPoolRepository, times(1)).save(jurorPool); - assertThat(jurorPool.isOnCall()).isTrue(); + assertThat(jurorPool.getOnCall()).isTrue(); assertThat(jurorPool.getNextDate()).isNull(); } @@ -2303,7 +2303,7 @@ void updateAttendanceHappyPathChangeNextDate() { verify(jurorPoolRepository, times(1)).save(jurorPool); assertThat(jurorPool.getNextDate()).isEqualTo(dto.getNextDate()); - assertThat(jurorPool.isOnCall()).isFalse(); + assertThat(jurorPool.getOnCall()).isFalse(); } diff --git a/src/test/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImplTest.java b/src/test/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImplTest.java index 4d2978c85..2a2206550 100644 --- a/src/test/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImplTest.java +++ b/src/test/java/uk/gov/hmcts/juror/api/moj/service/trial/TrialServiceImplTest.java @@ -447,7 +447,7 @@ void testReturnJuryNoConfirmAttendanceNullTimes() { verify(panelRepository, times(1)) .findByTrialTrialNumberAndTrialCourtLocationLocCode(trialNumber, "415"); verify(panelRepository, times(panelMembers.size())).saveAndFlush(any()); - verify(jurorHistoryService, never()).createJuryAttendanceHistory(any(), any(), any()); + verify(jurorHistoryService, times(panelMembers.size())).createJuryAttendanceHistory(any(), any(), any()); verify(jurorAppearanceService, times(panelMembers.size())).realignAttendanceType(any(Appearance.class)); } From d8f35d85bb5ac1312a3ef6f32aa0c75d7b28fd27 Mon Sep 17 00:00:00 2001 From: akikrahman1 Date: Mon, 9 Sep 2024 17:33:30 +0100 Subject: [PATCH 4/6] interim1 release candidate changes only --- .../migrationv2/V2_30__util_report_update.sql | 23 +++++++++++ .../migrationv2/V2_31__util_report_update.sql | 38 +++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 src/main/resources/db/migrationv2/V2_30__util_report_update.sql create mode 100644 src/main/resources/db/migrationv2/V2_31__util_report_update.sql diff --git a/src/main/resources/db/migrationv2/V2_30__util_report_update.sql b/src/main/resources/db/migrationv2/V2_30__util_report_update.sql new file mode 100644 index 000000000..414a4d171 --- /dev/null +++ b/src/main/resources/db/migrationv2/V2_30__util_report_update.sql @@ -0,0 +1,23 @@ + +-- utility function to return list of all days within the report window and holiday flag +-- updated to correctly handle no trial days added by a court and multiple holidays on the same day +CREATE OR REPLACE FUNCTION juror_mod.util_report_report_days_list(p_loc_code text, p_start_date date, p_end_date date) + RETURNS TABLE(report_date date, holiday boolean) + LANGUAGE plpgsql +AS $function$ +begin + +return query + +with report_days as ( +select generate_series(p_start_date, p_end_date, '1 day'::interval)::date as report_day) + +select distinct(report_days.report_day) as report_date, + case when h.holiday is not null then true else false end as holiday +from report_days + left join juror_mod.holiday h on (report_days.report_day = h.holiday and (h.loc_code is null or h.loc_code = p_loc_code)) +order by report_days.report_day; + + END; +$function$ +; \ No newline at end of file diff --git a/src/main/resources/db/migrationv2/V2_31__util_report_update.sql b/src/main/resources/db/migrationv2/V2_31__util_report_update.sql new file mode 100644 index 000000000..6cf9a80ba --- /dev/null +++ b/src/main/resources/db/migrationv2/V2_31__util_report_update.sql @@ -0,0 +1,38 @@ + +-- This function is used to generate a list of jurors who are in a pool during a given date range. +-- Updated the query to only count genuine appearances rather than non-attendance or no-shows. +CREATE OR REPLACE FUNCTION juror_mod.util_report_pool_members_list(p_loc_code text, p_start_date date, p_end_date date) + RETURNS TABLE(juror_number character varying, attendance_date date, return_date date, service_start_date date, service_end_date date, min_status integer) + LANGUAGE plpgsql +AS $function$ +begin + + return query select + jp.juror_number, + min(a.attendance_date) attendance_date, + min(case when jp.is_active = true then p.return_date else to_date('01/12/2099', 'dd/mm/yyyy') end ) return_date, + greatest(least(coalesce(min(a.attendance_date), min(case when jp.is_active = true then p.return_date else to_date('01/12/2099', 'dd/mm/yyyy') end )), + min(case when jp.is_active = true then p.return_date else to_date('01/12/2099','dd/mm/yyyy') end )), p_start_date) service_start, + -- figure out if an appearance occurred before service start date and use that if applicable + least(min(coalesce(case when jp.status = 10 then jp.transfer_date else date(j.completion_date) end, p_end_date)),p_end_date) service_end, + min(status) min_status + from juror_mod.juror_pool jp + join juror_mod.juror j + on jp.juror_number = j.juror_number + join juror_mod.pool p + on jp.pool_number = p.pool_no + left join juror_mod.appearance a + on jp.juror_number = a.juror_number + where p.loc_code = a.loc_code + and (((jp.status in (2,3,4,10,13) or (jp.status = 7 and a.attendance_date is not null)) and jp.is_active = true) + or (jp.status = 8 and a.attendance_date is not null and j.completion_date is not null)) + and (a.non_attendance is null or a.non_attendance = false) and (a.no_show is null or a.no_show = false) + and p.loc_code = p_loc_code + and ((jp.status = 10 and jp.transfer_date >= p_start_date) + or (jp.status <> 10 and (j.completion_date is null or j.completion_date >= p_start_date))) + group by jp.juror_number + having (least(coalesce(min(a.attendance_date), min(case when jp.is_active = true then p.return_date else to_date('01/12/2099', 'dd/mm/yyyy') end)), + min(case when jp.is_active = true then p.return_date else to_date('01/12/2099', 'dd/mm/yyyy') end)) <= p_end_date); +END; +$function$ +; \ No newline at end of file From 5095c5e60fd43da09fb506b5be5d1ccfbdd2840e Mon Sep 17 00:00:00 2001 From: akikrahman1 Date: Mon, 9 Sep 2024 17:42:25 +0100 Subject: [PATCH 5/6] Update DailyUtilisationReportsITest_typical.sql --- .../DailyUtilisationReportsITest_typical.sql | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql b/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql index 30dfb012b..0e3504865 100644 --- a/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql +++ b/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql @@ -43,41 +43,43 @@ INSERT INTO juror_mod.juror (juror_number,poll_number,title,last_name,first_name ('415000029',NULL,NULL,'LNAME29','FNAME29',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), ('415000030',NULL,NULL,'LNAME30','FNAME30',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), ('415000031',NULL,NULL,'LNAME31','FNAME31',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), - ('415000032',NULL,NULL,'LNAME32','FNAME32',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false); + ('415000032',NULL,NULL,'LNAME32','FNAME32',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), + ('415000033',NULL,NULL,'LNAME33','FNAME33',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false), + ('415000034',NULL,NULL,'LNAME34','FNAME34',NULL,'ADDRESS LINE 1',NULL,NULL,'ADDRESS LINE 4',NULL,'CH1 2AB',NULL,NULL,NULL,true,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'NOT_CHECKED',NULL,NULL,NULL,NULL,0,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,false,NULL,0,false); -INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location",no_attendances,no_attended,no_fta,no_awol,pool_seq,edit_tag,next_date,on_call,smart_card,was_deferred,deferral_code,id_checked,postpone,paid_cash,scan_code,last_update,reminder_sent,transfer_date,date_created) VALUES - ('415000001','415231101','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000002','415231101','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000003','415231101','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000004','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000005','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000006','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000007','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000008','415231102','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000009','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000010','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000011','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000012','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000013','415231103','415',NULL,true,3,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000014','415231104','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000015','415231104','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000016','415231104','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000017','415231104','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000018','415231104','415',NULL,true,1,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000020','415231105','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000021','415231105','415',NULL,true,4,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000022','415231106','415',NULL,true,2,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000023','415231106','415',NULL,true,2,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000024','415231105','415',NULL,true,5,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000025','415231105','415',NULL,true,6,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000026','415231106','415',NULL,true,7,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000027','415231106','415',NULL,true,8,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000028','415231106','415',NULL,true,9,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000029','415231106','415',NULL,true,10,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000030','415231106','415',NULL,true,11,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000031','415231106','415',NULL,true,12,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL), - ('415000032','415231106','415',NULL,true,13,NULL,NULL,'415',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); +INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_active,status,times_sel,def_date,"location") VALUES + ('415000001','415231101','415',NULL,true,3,NULL,NULL,'415'), + ('415000002','415231101','415',NULL,true,3,NULL,NULL,'415'), + ('415000003','415231101','415',NULL,true,3,NULL,NULL,'415'), + ('415000004','415231102','415',NULL,true,3,NULL,NULL,'415'), + ('415000005','415231102','415',NULL,true,3,NULL,NULL,'415'), + ('415000006','415231102','415',NULL,true,3,NULL,NULL,'415'), + ('415000007','415231102','415',NULL,true,3,NULL,NULL,'415'), + ('415000008','415231102','415',NULL,true,3,NULL,NULL,'415'), + ('415000009','415231103','415',NULL,true,3,NULL,NULL,'415'), + ('415000010','415231103','415',NULL,true,3,NULL,NULL,'415'), + ('415000011','415231103','415',NULL,true,3,NULL,NULL,'415'), + ('415000012','415231103','415',NULL,true,3,NULL,NULL,'415'), + ('415000013','415231103','415',NULL,true,3,NULL,NULL,'415'), + ('415000014','415231104','415',NULL,true,4,NULL,NULL,'415'), + ('415000015','415231104','415',NULL,true,4,NULL,NULL,'415'), + ('415000016','415231104','415',NULL,true,4,NULL,NULL,'415'), + ('415000017','415231104','415',NULL,true,4,NULL,NULL,'415'), + ('415000018','415231104','415',NULL,true,1,NULL,NULL,'415'), + ('415000020','415231105','415',NULL,true,4,NULL,NULL,'415'), + ('415000021','415231105','415',NULL,true,4,NULL,NULL,'415'), + ('415000022','415231106','415',NULL,true,2,NULL,NULL,'415'), + ('415000023','415231106','415',NULL,true,2,NULL,NULL,'415'), + ('415000024','415231105','415',NULL,true,5,NULL,NULL,'415'), + ('415000025','415231105','415',NULL,true,6,NULL,NULL,'415'), + ('415000026','415231106','415',NULL,true,7,NULL,NULL,'415'), + ('415000027','415231106','415',NULL,true,8,NULL,NULL,'415'), + ('415000028','415231106','415',NULL,true,9,NULL,NULL,'415'), + ('415000029','415231106','415',NULL,true,10,NULL,NULL,'415'), + ('415000030','415231106','415',NULL,true,11,NULL,NULL,'415'), + ('415000031','415231106','415',NULL,true,12,NULL,NULL,'415'), + ('415000032','415231106','415',NULL,true,13,NULL,NULL,'415'); INSERT INTO juror_mod.appearance (attendance_date,juror_number,loc_code,time_in,time_out,trial_number,non_attendance,no_show,misc_description,pay_cash,last_updated_by,created_by,public_transport_total_due,public_transport_total_paid,hired_vehicle_total_due,hired_vehicle_total_paid,motorcycle_total_due,motorcycle_total_paid,car_total_due,car_total_paid,pedal_cycle_total_due,pedal_cycle_total_paid,childcare_total_due,childcare_total_paid,parking_total_due,parking_total_paid,misc_total_due,misc_total_paid,smart_card_due,is_draft_expense,f_audit,sat_on_jury,pool_number,appearance_stage,loss_of_earnings_due,loss_of_earnings_paid,subsistence_due,subsistence_paid,attendance_type,smart_card_paid,travel_time,travel_jurors_taken_by_car,travel_by_car,travel_jurors_taken_by_motorcycle,travel_by_motorcycle,travel_by_bicycle,miles_traveled,food_and_drink_claim_type,"version",expense_rates_id,attendance_audit_number) VALUES @@ -204,4 +206,3 @@ INSERT INTO juror_mod.holiday (loc_code,holiday,description,public) VALUES ('415','2024-04-26','TEST',false), ('415','2024-09-20','TEST',false), (NULL,'2024-04-01','PUBLIC HOLIDAY',true); - From ddf90d7d5c88e894b9ff575b2eb63bc3b54c32fc Mon Sep 17 00:00:00 2001 From: akikrahman1 Date: Tue, 10 Sep 2024 09:07:23 +0100 Subject: [PATCH 6/6] Update DailyUtilisationReportsITest_typical.sql --- .../db/mod/reports/DailyUtilisationReportsITest_typical.sql | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql b/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql index 0e3504865..0ea4a722a 100644 --- a/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql +++ b/src/integration-test/resources/db/mod/reports/DailyUtilisationReportsITest_typical.sql @@ -79,8 +79,9 @@ INSERT INTO juror_mod.juror_pool (juror_number,pool_number,"owner",user_edtq,is_ ('415000029','415231106','415',NULL,true,10,NULL,NULL,'415'), ('415000030','415231106','415',NULL,true,11,NULL,NULL,'415'), ('415000031','415231106','415',NULL,true,12,NULL,NULL,'415'), - ('415000032','415231106','415',NULL,true,13,NULL,NULL,'415'); - + ('415000032','415231106','415',NULL,true,13,NULL,NULL,'415'), + ('415000033','415231106','415',NULL,true,7,NULL,NULL,'415'), + ('415000034','415231106','415',NULL,true,5,NULL,NULL,'415'); INSERT INTO juror_mod.appearance (attendance_date,juror_number,loc_code,time_in,time_out,trial_number,non_attendance,no_show,misc_description,pay_cash,last_updated_by,created_by,public_transport_total_due,public_transport_total_paid,hired_vehicle_total_due,hired_vehicle_total_paid,motorcycle_total_due,motorcycle_total_paid,car_total_due,car_total_paid,pedal_cycle_total_due,pedal_cycle_total_paid,childcare_total_due,childcare_total_paid,parking_total_due,parking_total_paid,misc_total_due,misc_total_paid,smart_card_due,is_draft_expense,f_audit,sat_on_jury,pool_number,appearance_stage,loss_of_earnings_due,loss_of_earnings_paid,subsistence_due,subsistence_paid,attendance_type,smart_card_paid,travel_time,travel_jurors_taken_by_car,travel_by_car,travel_jurors_taken_by_motorcycle,travel_by_motorcycle,travel_by_bicycle,miles_traveled,food_and_drink_claim_type,"version",expense_rates_id,attendance_audit_number) VALUES ('2024-05-08','415000001','415','09:00:00.5603',NULL,NULL,false,NULL,NULL,false,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,true,NULL,NULL,'415231101',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,NULL,NULL),