Skip to content

Commit

Permalink
Hotfix/jm 7928 (#761)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
akikrahman1 and Ben-Edwards-cgi authored Sep 9, 2024
1 parent a44626f commit 2c0c871
Show file tree
Hide file tree
Showing 38 changed files with 596 additions and 485 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ pmdTest {
maxFailures = 292
}
pmdMain {
maxFailures = 763
maxFailures = 752
}
pmd {
maxFailures = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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();
Expand All @@ -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<JurorHistory> jurorHistories = jurorHistoryRepository.findByJurorNumberOrderById(jurorNumber);
assertEquals(1, jurorHistories.size(), "Should only be one history entry");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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<String> responseEntity =
Expand All @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Loading

0 comments on commit 2c0c871

Please sign in to comment.