From a0ea70a46562cc5c71023c42a2318b8162c82d3e Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Wed, 13 Sep 2023 16:17:20 +0100 Subject: [PATCH 1/7] COT-519 - Add extra roles/rules to AM role mapping - JOH and Roles Drools rules and tests added, PUBLICLAW_WA_1_1 feature flag addded --- .../domain/model/enums/FeatureFlagEnum.java | 3 +- ...19_PUBLICLAW_WA_1_1_base_flag_addition.sql | 7 + ...bliclaw-judicial-office-holder-mapping.drl | 243 ++++++++++++++++++ .../publiclaw-judicial-org-role-mapping.drl | 19 +- ...DroolPublicLawJudicialRoleMappingTest.java | 80 +++++- 5 files changed, 345 insertions(+), 7 deletions(-) create mode 100644 src/main/resources/db/migration/V20230912_519__COT-519_PUBLICLAW_WA_1_1_base_flag_addition.sql diff --git a/src/main/java/uk/gov/hmcts/reform/orgrolemapping/domain/model/enums/FeatureFlagEnum.java b/src/main/java/uk/gov/hmcts/reform/orgrolemapping/domain/model/enums/FeatureFlagEnum.java index e6b5c30b6..2a8803809 100644 --- a/src/main/java/uk/gov/hmcts/reform/orgrolemapping/domain/model/enums/FeatureFlagEnum.java +++ b/src/main/java/uk/gov/hmcts/reform/orgrolemapping/domain/model/enums/FeatureFlagEnum.java @@ -13,7 +13,8 @@ public enum FeatureFlagEnum { PRIVATELAW_WA_1_1("privatelaw_wa_1_1"), EMPLOYMENT_WA_1_0("employment_wa_1_0"), PRIVATELAW_WA_1_2("privatelaw_wa_1_2"), - ST_CIC_WA_1_0("st_cic_wa_1_0"); + ST_CIC_WA_1_0("st_cic_wa_1_0"), + PUBLICLAW_WA_1_1("publiclaw_wa_1_1"); private final String value; diff --git a/src/main/resources/db/migration/V20230912_519__COT-519_PUBLICLAW_WA_1_1_base_flag_addition.sql b/src/main/resources/db/migration/V20230912_519__COT-519_PUBLICLAW_WA_1_1_base_flag_addition.sql new file mode 100644 index 000000000..3fb8acae5 --- /dev/null +++ b/src/main/resources/db/migration/V20230912_519__COT-519_PUBLICLAW_WA_1_1_base_flag_addition.sql @@ -0,0 +1,7 @@ +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'local', 'st_cic', 'true'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'pr', 'st_cic', 'true'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'aat', 'st_cic', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'demo', 'st_cic', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'perftest', 'st_cic', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'ithc', 'st_cic', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'prod', 'st_cic', 'false'); diff --git a/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl b/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl index 1fa64658e..59a2b21e2 100644 --- a/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl +++ b/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl @@ -460,3 +460,246 @@ then .build()); logMsg("Rule : publiclaw_recorder_fee_paid_joh"); end; + +/* + * 16: "PUBLICLAW Tribunal Judge - Salaried" business role mapping to JOH. + */ +rule "publiclaw_tribunal_judge_salaried_joh" +when + $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_1.getValue()) + $jap: JudicialAccessProfile(appointment == "Tribunal Judge", + appointmentType in ("Salaried"), + (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), + validateAuthorisation(authorisations, "ABA3")) +then + insert( + JudicialOfficeHolder.builder() + .userId($jap.getUserId()) + .office("PUBLICLAW Tribunal Judge - Salaried") + .jurisdiction("PUBLICLAW") + .ticketCodes($jap.getTicketCodes()) + .beginTime($jap.getBeginTime()) + .endTime($jap.getEndTime()) + .regionId($jap.getRegionId()) + .baseLocationId($jap.getBaseLocationId()) + .primaryLocation($jap.getPrimaryLocationId()) + .contractType($jap.getAppointmentType()) + .build()); + logMsg("Rule : publiclaw_tribunal_judge_salaried_joh"); +end; + +/* + * 17: "PUBLICLAW Employment Judge - Salaried" business role mapping to JOH. + */ +rule "publiclaw_employment_judge_salaried_joh" +when + $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_1.getValue()) + $jap: JudicialAccessProfile(appointment == "Employment Judge", + appointmentType in ("Salaried"), + (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), + validateAuthorisation(authorisations, "ABA3")) +then + insert( + JudicialOfficeHolder.builder() + .userId($jap.getUserId()) + .office("PUBLICLAW Employment Judge - Salaried") + .jurisdiction("PUBLICLAW") + .ticketCodes($jap.getTicketCodes()) + .beginTime($jap.getBeginTime()) + .endTime($jap.getEndTime()) + .regionId($jap.getRegionId()) + .baseLocationId($jap.getBaseLocationId()) + .primaryLocation($jap.getPrimaryLocationId()) + .contractType($jap.getAppointmentType()) + .build()); + logMsg("Rule : publiclaw_employment_judge_salaried_joh"); +end; + +/* + * 18: "PUBLICLAW Specialist Circuit Judge - Salaried" business role mapping to JOH. + */ +rule "publiclaw_specialist_circuit_judge_salaried_joh" +when + $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_1.getValue()) + $jap: JudicialAccessProfile(appointment == "Specialist Circuit Judge", + appointmentType in ("Salaried"), + (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), + validateAuthorisation(authorisations, "ABA3")) +then + insert( + JudicialOfficeHolder.builder() + .userId($jap.getUserId()) + .office("PUBLICLAW Specialist Circuit Judge - Salaried") + .jurisdiction("PUBLICLAW") + .ticketCodes($jap.getTicketCodes()) + .beginTime($jap.getBeginTime()) + .endTime($jap.getEndTime()) + .regionId($jap.getRegionId()) + .baseLocationId($jap.getBaseLocationId()) + .primaryLocation($jap.getPrimaryLocationId()) + .contractType($jap.getAppointmentType()) + .build()); + logMsg("Rule : publiclaw_specialist_circuit_judge_salaried_joh"); +end; + +/* + * 19: "PUBLICLAW Senior Circuit Judge - Salaried" business role mapping to JOH. + */ +rule "publiclaw_senior_circuit_judge_salaried_joh" +when + $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_1.getValue()) + $jap: JudicialAccessProfile(appointment == "Senior Circuit Judge", + appointmentType in ("Salaried"), + (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), + validateAuthorisation(authorisations, "ABA3")) +then + insert( + JudicialOfficeHolder.builder() + .userId($jap.getUserId()) + .office("PUBLICLAW Senior Circuit Judge - Salaried") + .jurisdiction("PUBLICLAW") + .ticketCodes($jap.getTicketCodes()) + .beginTime($jap.getBeginTime()) + .endTime($jap.getEndTime()) + .regionId($jap.getRegionId()) + .baseLocationId($jap.getBaseLocationId()) + .primaryLocation($jap.getPrimaryLocationId()) + .contractType($jap.getAppointmentType()) + .build()); + logMsg("Rule : publiclaw_senior_circuit_judge_salaried_joh"); +end; + +/* + * 20: "PUBLICLAW Circuit Judge - Sitting in Retirement - Fee Paid" business role mapping to JOH. + */ +rule "publiclaw_circuit_judge_in_retirement_fee_paid_joh" +when + $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_1.getValue()) + $jap: JudicialAccessProfile(appointment == "Circuit Judge (sitting in retirement)", + appointmentType in ("Fee Paid"), + (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), + validateAuthorisation(authorisations, "ABA3")) +then + insert( + JudicialOfficeHolder.builder() + .userId($jap.getUserId()) + .office("PUBLICLAW Circuit Judge - Sitting in Retirement - Fee Paid") + .jurisdiction("PUBLICLAW") + .ticketCodes($jap.getTicketCodes()) + .beginTime($jap.getBeginTime()) + .endTime($jap.getEndTime()) + .regionId($jap.getRegionId()) + .baseLocationId($jap.getBaseLocationId()) + .primaryLocation($jap.getPrimaryLocationId()) + .contractType($jap.getAppointmentType()) + .build()); + logMsg("Rule : publiclaw_circuit_judge_in_retirement_fee_paid_joh"); +end; + +/* + * 21: "PUBLICLAW Recorder - Sitting in Retirement - Fee Paid" business role mapping to JOH. + */ +rule "publiclaw_recorder_in_retirement_fee_paid_joh" +when + $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_1.getValue()) + $jap: JudicialAccessProfile(appointment == "Recorder (sitting in retirement)", + appointmentType in ("Fee Paid"), + (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), + validateAuthorisation(authorisations, "ABA3")) +then + insert( + JudicialOfficeHolder.builder() + .userId($jap.getUserId()) + .office("PUBLICLAW Recorder - Sitting in Retirement - Fee Paid") + .jurisdiction("PUBLICLAW") + .ticketCodes($jap.getTicketCodes()) + .beginTime($jap.getBeginTime()) + .endTime($jap.getEndTime()) + .regionId($jap.getRegionId()) + .baseLocationId($jap.getBaseLocationId()) + .primaryLocation($jap.getPrimaryLocationId()) + .contractType($jap.getAppointmentType()) + .build()); + logMsg("Rule : publiclaw_recorder_in_retirement_fee_paid_joh"); +end; + +/* + * 22: "PUBLICLAW Deputy Upper Tribunal Judge - Fee Paid" business role mapping to JOH. + */ +rule "publiclaw_deputy_upper_tribunal_judge_fee_paid_joh" +when + $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_1.getValue()) + $jap: JudicialAccessProfile(appointment == "Deputy Upper Tribunal Judge", + appointmentType in ("Fee Paid"), + (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), + validateAuthorisation(authorisations, "ABA3")) +then + insert( + JudicialOfficeHolder.builder() + .userId($jap.getUserId()) + .office("PUBLICLAW Deputy Upper Tribunal Judge - Fee Paid") + .jurisdiction("PUBLICLAW") + .ticketCodes($jap.getTicketCodes()) + .beginTime($jap.getBeginTime()) + .endTime($jap.getEndTime()) + .regionId($jap.getRegionId()) + .baseLocationId($jap.getBaseLocationId()) + .primaryLocation($jap.getPrimaryLocationId()) + .contractType($jap.getAppointmentType()) + .build()); + logMsg("Rule : publiclaw_recorder_in_retirement_fee_paid_joh"); +end; + +/* + * 23: "PUBLICLAW District Judge (MC) - Sitting in Retirement - Fee Paid" business role mapping to JOH. + */ +rule "publiclaw_district_judge_mc_in_retirement_fee_paid_joh" +when + $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_1.getValue()) + $jap: JudicialAccessProfile(appointment == "District Judge (MC)- Sitting in Retirement", + appointmentType in ("Fee Paid"), + (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), + validateAuthorisation(authorisations, "ABA3")) +then + insert( + JudicialOfficeHolder.builder() + .userId($jap.getUserId()) + .office("PUBLICLAW District Judge (MC) - Sitting in Retirement - Fee Paid") + .jurisdiction("PUBLICLAW") + .ticketCodes($jap.getTicketCodes()) + .beginTime($jap.getBeginTime()) + .endTime($jap.getEndTime()) + .regionId($jap.getRegionId()) + .baseLocationId($jap.getBaseLocationId()) + .primaryLocation($jap.getPrimaryLocationId()) + .contractType($jap.getAppointmentType()) + .build()); + logMsg("Rule : publiclaw_district_judge_mc_in_retirement_fee_paid_joh"); +end; + +/* + * 24: "PUBLICLAW District Judge - Sitting in Retirement - Fee Paid" business role mapping to JOH. + */ +rule "publiclaw_district_judge_in_retirement_fee_paid_joh" +when + $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_1.getValue()) + $jap: JudicialAccessProfile(appointment == "District Judge- Sitting in Retirement -Fee Paid", + appointmentType in ("Fee Paid"), + (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), + validateAuthorisation(authorisations, "ABA3")) +then + insert( + JudicialOfficeHolder.builder() + .userId($jap.getUserId()) + .office("PUBLICLAW District Judge - Sitting in Retirement - Fee Paid") + .jurisdiction("PUBLICLAW") + .ticketCodes($jap.getTicketCodes()) + .beginTime($jap.getBeginTime()) + .endTime($jap.getEndTime()) + .regionId($jap.getRegionId()) + .baseLocationId($jap.getBaseLocationId()) + .primaryLocation($jap.getPrimaryLocationId()) + .contractType($jap.getAppointmentType()) + .build()); + logMsg("Rule : publiclaw_district_judge_in_retirement_fee_paid_joh"); +end; \ No newline at end of file diff --git a/src/main/resources/validationrules/publiclaw/publiclaw-judicial-org-role-mapping.drl b/src/main/resources/validationrules/publiclaw/publiclaw-judicial-org-role-mapping.drl index 62668d76b..5ec288b13 100644 --- a/src/main/resources/validationrules/publiclaw/publiclaw-judicial-org-role-mapping.drl +++ b/src/main/resources/validationrules/publiclaw/publiclaw-judicial-org-role-mapping.drl @@ -25,7 +25,8 @@ when $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) $joh: JudicialOfficeHolder(office in ("PUBLICLAW District Judge - Salaried", "PUBLICLAW District Judge (MC) - SPTW", "PUBLICLAW High Court Judge - Salaried", "PUBLICLAW Circuit Judge - Salaried", "PUBLICLAW Designated Family Judge - Salaried", - "PUBLICLAW District Judge (MC) - Salaried")) + "PUBLICLAW District Judge (MC) - Salaried", "PUBLICLAW Specialist Circuit Judge - Salaried", + "PUBLICLAW Senior Circuit Judge - Salaried", "PUBLICLAW Tribunal Judge - Salaried", "PUBLICLAW Employment Judge - Salaried")) then Map attribute = new HashMap<>(); attribute.put("contractType", JacksonUtils.convertObjectIntoJsonNode("Salaried")); @@ -62,7 +63,9 @@ when "PUBLICLAW Deputy District Judge - Fee Paid", "PUBLICLAW Deputy District Judge - Sitting in Retirement - Fee Paid", "PUBLICLAW Deputy District Judge - PRFD - Fee Paid", "PUBLICLAW Deputy High Court Judge - Fee Paid", "PUBLICLAW High Court Judge - Sitting in Retirement - Fee Paid","PUBLICLAW Deputy Circuit Judge - Fee Paid", - "PUBLICLAW Recorder - Fee Paid")) + "PUBLICLAW Recorder - Fee Paid", "PUBLICLAW Circuit Judge - Sitting in Retirement - Fee Paid", + "PUBLICLAW Recorder - Sitting in Retirement - Fee Paid", "PUBLICLAW Deputy Upper Tribunal Judge - Fee Paid", + "PUBLICLAW District Judge (MC) - Sitting in Retirement - Fee Paid", "PUBLICLAW District Judge - Sitting in Retirement - Fee Paid")) $bk: JudicialBooking(userId == $joh.userId) then Map attribute = new HashMap<>(); @@ -133,7 +136,12 @@ when "PUBLICLAW Deputy District Judge - Fee Paid", "PUBLICLAW Deputy District Judge - Sitting in Retirement - Fee Paid", "PUBLICLAW Deputy District Judge - PRFD - Fee Paid", "PUBLICLAW Deputy High Court Judge - Fee Paid", "PUBLICLAW High Court Judge - Sitting in Retirement - Fee Paid", "PUBLICLAW Designated Family Judge - Salaried", - "PUBLICLAW Deputy Circuit Judge - Fee Paid","PUBLICLAW District Judge (MC) - Salaried", "PUBLICLAW Recorder - Fee Paid")) + "PUBLICLAW Deputy Circuit Judge - Fee Paid","PUBLICLAW District Judge (MC) - Salaried", + "PUBLICLAW Recorder - Fee Paid", "PUBLICLAW Tribunal Judge - Salaried", "PUBLICLAW Employment Judge - Salaried", + "PUBLICLAW Specialist Circuit Judge - Salaried", "PUBLICLAW Senior Circuit Judge - Salaried", + "PUBLICLAW Circuit Judge - Sitting in Retirement - Fee Paid", "PUBLICLAW Recorder - Sitting in Retirement - Fee Paid", + "PUBLICLAW Deputy Upper Tribunal Judge - Fee Paid", "PUBLICLAW District Judge (MC) - Sitting in Retirement - Fee Paid", + "PUBLICLAW District Judge - Sitting in Retirement - Fee Paid")) then Map attribute = new HashMap<>(); if($joh.getOffice().contains("Salaried")|| $joh.getOffice().contains("SPTW")) @@ -294,7 +302,10 @@ when "PUBLICLAW Deputy District Judge (MC) - Fee Paid", "PUBLICLAW Deputy District Judge (MC) - Sitting in Retirement", "PUBLICLAW Deputy District Judge - Fee Paid", "PUBLICLAW Deputy District Judge - Sitting in Retirement - Fee Paid", "PUBLICLAW Deputy District Judge - PRFD - Fee Paid", "PUBLICLAW Deputy High Court Judge - Fee Paid", - "PUBLICLAW High Court Judge - Sitting in Retirement - Fee Paid", "PUBLICLAW Recorder - Fee Paid")) + "PUBLICLAW High Court Judge - Sitting in Retirement - Fee Paid", "PUBLICLAW Recorder - Fee Paid", + "PUBLICLAW Circuit Judge - Sitting in Retirement - Fee Paid", "PUBLICLAW Recorder - Sitting in Retirement - Fee Paid", + "PUBLICLAW Deputy Upper Tribunal Judge - Fee Paid", "PUBLICLAW District Judge (MC) - Sitting in Retirement - Fee Paid", + "PUBLICLAW District Judge - Sitting in Retirement - Fee Paid")) then Map attribute = new HashMap<>(); attribute.put("contractType", JacksonUtils.convertObjectIntoJsonNode("Fee-Paid")); diff --git a/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java b/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java index c63a027f9..f93423e66 100644 --- a/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java +++ b/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java @@ -210,7 +210,82 @@ static Stream endToEndData() { true, List.of("Recorder - Fee Paid"), List.of("fee-paid-judge","hmcts-judiciary", - "hearing-viewer", "hearing-manager")) + "hearing-viewer", "hearing-manager")), + Arguments.of("Tribunal Judge", "Salaried", + false, + false, + List.of("Tribunal Judge - Salaried"), + List.of("judge","hmcts-judiciary")), + Arguments.of("Employment Judge", "Salaried", + false, + false, + List.of("Employment Judge - Salaried"), + List.of("judge","hmcts-judiciary")), + Arguments.of("Specialist Circuit Judge", "Salaried", + false, + false, + List.of("Specialist Circuit Judge - Salaried"), + List.of("judge","hmcts-judiciary")), + Arguments.of("Senior Circuit Judge", "Salaried", + false, + false, + List.of("Senior Circuit Judge - Salaried"), + List.of("judge","hmcts-judiciary")), + Arguments.of("Circuit Judge (sitting in retirement)", "Fee Paid", + true, + false, + List.of("Circuit Judge - Sitting in Retirement - Fee Paid"), + List.of("judge","fee-paid-judge","hmcts-judiciary")), + //no Judicial Booking, no judge role + Arguments.of("Circuit Judge (sitting in retirement)", "Fee Paid", + false, + false, + List.of("Circuit Judge - Sitting in Retirement - Fee Paid"), + List.of("fee-paid-judge","hmcts-judiciary")), + Arguments.of("Recorder (sitting in retirement)", "Fee Paid", + true, + false, + List.of("Recorder - Sitting in Retirement - Fee Paid"), + List.of("judge","fee-paid-judge","hmcts-judiciary")), + //no Judicial Booking, no judge role + Arguments.of("Recorder (sitting in retirement)", "Fee Paid", + false, + false, + List.of("Recorder - Sitting in Retirement - Fee Paid"), + List.of("fee-paid-judge","hmcts-judiciary")), + Arguments.of("Deputy Upper Tribunal Judge", "Fee Paid", + true, + false, + List.of("Deputy Upper Tribunal Judge - Fee Paid"), + List.of("judge","fee-paid-judge","hmcts-judiciary")), + //no Judicial Booking, no judge role + Arguments.of("Deputy Upper Tribunal Judge", "Fee Paid", + false, + false, + List.of("Deputy Upper Tribunal Judge - Fee Paid"), + List.of("fee-paid-judge","hmcts-judiciary")), + Arguments.of("District Judge (MC)- Sitting in Retirement", "Fee Paid", + true, + false, + List.of("District Judge (MC) - Sitting in Retirement - Fee Paid"), + List.of("judge","fee-paid-judge","hmcts-judiciary")), + //no Judicial Booking, no judge role + Arguments.of("District Judge (MC)- Sitting in Retirement", "Fee Paid", + false, + false, + List.of("District Judge (MC) - Sitting in Retirement - Fee Paid"), + List.of("fee-paid-judge","hmcts-judiciary")), + Arguments.of("District Judge- Sitting in Retirement -Fee Paid", "Fee Paid", + true, + false, + List.of("District Judge - Sitting in Retirement - Fee Paid"), + List.of("judge","fee-paid-judge","hmcts-judiciary")), + //no Judicial Booking, no judge role + Arguments.of("District Judge- Sitting in Retirement -Fee Paid", "Fee Paid", + false, + false, + List.of("District Judge - Sitting in Retirement - Fee Paid"), + List.of("fee-paid-judge","hmcts-judiciary")) ); } @@ -254,7 +329,8 @@ void shouldTakeJudicialAccessProfileConvertToJudicialOfficeHolderThenReturnRoleA List roleAssignments = buildExecuteKieSession( List.of(FeatureFlag.builder().flagName("publiclaw_wa_1_0").status(true).build(), - FeatureFlag.builder().flagName("sscs_hearing_1_0").status(hearingFlag).build()) + FeatureFlag.builder().flagName("sscs_hearing_1_0").status(hearingFlag).build(), + FeatureFlag.builder().flagName("publiclaw_wa_1_1").status(true).build()) ); //assertions From 8a2bb8fe8466e052fb9d02874e99343c140fa29b Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Wed, 13 Sep 2023 17:24:11 +0100 Subject: [PATCH 2/7] JOH Drools rules reordered and renumbered to better and Appointment names updated reflect config page, tests updated, possible duplicate rule identified --- ...bliclaw-judicial-office-holder-mapping.drl | 132 +++++++++--------- ...DroolPublicLawJudicialRoleMappingTest.java | 4 +- 2 files changed, 68 insertions(+), 68 deletions(-) diff --git a/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl b/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl index 59a2b21e2..c02172cd2 100644 --- a/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl +++ b/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl @@ -84,7 +84,34 @@ then end; /* - * 3: "PUBLICLAW Deputy District Judge - PRFD - Fee Paid" business role mapping to JOH. + * 3. "PUBLICLAW Recorder-Fee-Paid" business role business role mapping to JOH. + */ +rule "publiclaw_recorder_fee_paid_joh" +when + $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) + $jap: JudicialAccessProfile(appointment == "Recorder", + appointmentType == "Fee Paid", + (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), + validateAuthorisation(authorisations, "ABA3")) +then + insert( + JudicialOfficeHolder.builder() + .userId($jap.getUserId()) + .office("PUBLICLAW Recorder - Fee Paid") + .jurisdiction("PUBLICLAW") + .ticketCodes($jap.getTicketCodes()) + .beginTime($jap.getBeginTime()) + .endTime($jap.getEndTime()) + .regionId($jap.getRegionId()) + .baseLocationId($jap.getBaseLocationId()) + .primaryLocation($jap.getPrimaryLocationId()) + .contractType($jap.getAppointmentType()) + .build()); + logMsg("Rule : publiclaw_recorder_fee_paid_joh"); +end; + +/* + * 4: "PUBLICLAW Deputy District Judge - PRFD - Fee Paid" business role mapping to JOH. */ rule "publiclaw_deputy_district_judge_prfd_fee_paid_joh" when @@ -111,7 +138,7 @@ then end; /* - * 4: "PUBLICLAW Deputy District Judge (MC) - Fee Paid" business role mapping to JOH. + * 5: "PUBLICLAW Deputy District Judge (MC) - Fee Paid" business role mapping to JOH. */ rule "publiclaw_deputy_district_judge_mc_fee_paid_joh" when @@ -138,7 +165,7 @@ then end; /* - * 5: "PUBLICLAW Deputy District Judge (MC) - Sitting in Retirement" business role mapping to JOH. + * 6: "PUBLICLAW Deputy District Judge (MC) - Sitting in Retirement" business role mapping to JOH. */ rule "publiclaw_deputy_district_judge_mc_in_retirement_joh" when @@ -165,7 +192,7 @@ then end; /* - * 6: "PUBLICLAW Deputy District Judge - Fee Paid" business role mapping to JOH. + * 7: "PUBLICLAW Deputy District Judge - Fee Paid" business role mapping to JOH. */ rule "publiclaw_deputy_deputy_district_judge_fee_paid_joh" when @@ -192,7 +219,7 @@ then end; /* - * 7: "PUBLICLAW Deputy District Judge - Sitting in Retirement - Fee Paid" business role mapping to JOH. + * 8: "PUBLICLAW Deputy District Judge - Sitting in Retirement - Fee Paid" business role mapping to JOH. */ rule "publiclaw_deputy_district_judge_in_retirement_joh" when @@ -219,7 +246,7 @@ then end; /* - * 8: "PUBLICLAW Deputy High Court Judge - Fee Paid" business role mapping to JOH. + * 9: "PUBLICLAW Deputy High Court Judge - Fee Paid" business role mapping to JOH. */ rule "publiclaw_deputy_high_court_judge_fee_paid_joh" when @@ -246,7 +273,7 @@ then end; /* - * 9: "PUBLICLAW District Judge - Salaried" business role mapping to JOH. + * 10: "PUBLICLAW District Judge - Salaried" business role mapping to JOH. */ rule "publiclaw_district_judge_salaried_joh" when @@ -273,7 +300,7 @@ then end; /* - * 10: "PUBLICLAW District Judge (MC) - SPTW" business role mapping to JOH. + * 11: "PUBLICLAW District Judge (MC) - SPTW" business role mapping to JOH. */ rule "publiclaw_district_judge_mc_sptw_joh" when @@ -299,13 +326,13 @@ then logMsg("Rule : publiclaw_district_judge_mc_sptw_joh"); end; -/* - * 11: "PUBLICLAW High Court Judge - Salaried" business role mapping to JOH. +/* ############## looks very similar to 11, moved here for comparison ########################## + * 15: "PUBLICLAW District Judge (MC) - Salaried" business role mapping to JOH. */ -rule "publiclaw_high_court_judge_salaried_joh" +rule "publiclaw_district_judge_mc_salaried_joh" when $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) - $jap: JudicialAccessProfile(appointment == "High Court Judge", + $jap: JudicialAccessProfile(appointment == "District Judge (MC)", appointmentType in ("Salaried"), (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), validateAuthorisation(authorisations, "ABA3")) @@ -313,34 +340,7 @@ then insert( JudicialOfficeHolder.builder() .userId($jap.getUserId()) - .office("PUBLICLAW High Court Judge - Salaried") - .jurisdiction("PUBLICLAW") - .ticketCodes($jap.getTicketCodes()) - .beginTime($jap.getBeginTime()) - .endTime($jap.getEndTime()) - .regionId($jap.getRegionId()) - .baseLocationId($jap.getBaseLocationId()) - .primaryLocation($jap.getPrimaryLocationId()) - .contractType($jap.getAppointmentType()) - .build()); - logMsg("Rule : publiclaw_high_court_judge_salaried_joh"); -end; - -/* - * 12: "PUBLICLAW High Court Judge - Sitting in Retirement - Fee Paid" business role mapping to JOH. - */ -rule "publiclaw_high_court_judge_in_retirement_joh" -when - $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) - $jap: JudicialAccessProfile(appointment == "High Court Judge- Sitting in Retirement", - appointmentType in ("Fee Paid"), - (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), - validateAuthorisation(authorisations, "ABA3")) -then - insert( - JudicialOfficeHolder.builder() - .userId($jap.getUserId()) - .office("PUBLICLAW High Court Judge - Sitting in Retirement - Fee Paid") + .office("PUBLICLAW District Judge (MC) - Salaried") .jurisdiction("PUBLICLAW") .ticketCodes($jap.getTicketCodes()) .beginTime($jap.getBeginTime()) @@ -350,24 +350,24 @@ then .primaryLocation($jap.getPrimaryLocationId()) .contractType($jap.getAppointmentType()) .build()); - logMsg("Rule : publiclaw_high_court_judge_in_retirement_joh"); + logMsg("Rule : publiclaw_district_judge_mc_salaried_joh"); end; /* - * 13: "PUBLICLAW Designated Family Judge - Salaried" business role mapping to JOH. + * 12: "PUBLICLAW High Court Judge - Salaried" business role mapping to JOH. */ -rule "publiclaw_designated_family_judge_salaried_joh" +rule "publiclaw_high_court_judge_salaried_joh" when $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) - $jap: JudicialAccessProfile(appointment != null, + $jap: JudicialAccessProfile(appointment == "High Court Judge", + appointmentType in ("Salaried"), (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), - (roles != null && roles.contains("Designated Family Judge")), validateAuthorisation(authorisations, "ABA3")) then insert( JudicialOfficeHolder.builder() .userId($jap.getUserId()) - .office("PUBLICLAW Designated Family Judge - Salaried") + .office("PUBLICLAW High Court Judge - Salaried") .jurisdiction("PUBLICLAW") .ticketCodes($jap.getTicketCodes()) .beginTime($jap.getBeginTime()) @@ -377,24 +377,24 @@ then .primaryLocation($jap.getPrimaryLocationId()) .contractType($jap.getAppointmentType()) .build()); - logMsg("Rule : publiclaw_designated_family_judge_salaried_joh"); + logMsg("Rule : publiclaw_high_court_judge_salaried_joh"); end; /* - * 14: "PUBLICLAW Magistrate - Voluntary" business role mapping to JOH. + * 13: "PUBLICLAW High Court Judge - Sitting in Retirement - Fee Paid" business role mapping to JOH. */ -rule "publiclaw_magistrate_voluntary_joh" +rule "publiclaw_high_court_judge_in_retirement_joh" when $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) - $jap: JudicialAccessProfile(appointment == "Magistrate", - appointmentType in ("Voluntary"), + $jap: JudicialAccessProfile(appointment == "High Court Judge- Sitting in Retirement", + appointmentType in ("Fee Paid"), (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), validateAuthorisation(authorisations, "ABA3")) then insert( JudicialOfficeHolder.builder() .userId($jap.getUserId()) - .office("PUBLICLAW Magistrate - Voluntary") + .office("PUBLICLAW High Court Judge - Sitting in Retirement - Fee Paid") .jurisdiction("PUBLICLAW") .ticketCodes($jap.getTicketCodes()) .beginTime($jap.getBeginTime()) @@ -404,24 +404,24 @@ then .primaryLocation($jap.getPrimaryLocationId()) .contractType($jap.getAppointmentType()) .build()); - logMsg("Rule : publiclaw_magistrate_voluntary_joh"); + logMsg("Rule : publiclaw_high_court_judge_in_retirement_joh"); end; /* - * 15: "PUBLICLAW District Judge (MC) - Salaried" business role mapping to JOH. + * 14: "PUBLICLAW Designated Family Judge - Salaried" business role mapping to JOH. */ -rule "publiclaw_district_judge_mc_salaried_joh" +rule "publiclaw_designated_family_judge_salaried_joh" when $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) - $jap: JudicialAccessProfile(appointment == "District Judge (MC)", - appointmentType in ("Salaried"), + $jap: JudicialAccessProfile(appointment != null, (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), + (roles != null && roles.contains("Designated Family Judge")), validateAuthorisation(authorisations, "ABA3")) then insert( JudicialOfficeHolder.builder() .userId($jap.getUserId()) - .office("PUBLICLAW District Judge (MC) - Salaried") + .office("PUBLICLAW Designated Family Judge - Salaried") .jurisdiction("PUBLICLAW") .ticketCodes($jap.getTicketCodes()) .beginTime($jap.getBeginTime()) @@ -431,24 +431,24 @@ then .primaryLocation($jap.getPrimaryLocationId()) .contractType($jap.getAppointmentType()) .build()); - logMsg("Rule : publiclaw_district_judge_mc_salaried_joh"); + logMsg("Rule : publiclaw_designated_family_judge_salaried_joh"); end; /* - * 16. "PUBLICLAW Recorder-Fee-Paid" business role business role mapping to JOH. + * 15: "PUBLICLAW Magistrate - Voluntary" business role mapping to JOH. */ -rule "publiclaw_recorder_fee_paid_joh" +rule "publiclaw_magistrate_voluntary_joh" when $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) - $jap: JudicialAccessProfile(appointment == "Recorder", - appointmentType == "Fee Paid", + $jap: JudicialAccessProfile(appointment == "Magistrate", + appointmentType in ("Voluntary"), (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), validateAuthorisation(authorisations, "ABA3")) then insert( JudicialOfficeHolder.builder() .userId($jap.getUserId()) - .office("PUBLICLAW Recorder - Fee Paid") + .office("PUBLICLAW Magistrate - Voluntary") .jurisdiction("PUBLICLAW") .ticketCodes($jap.getTicketCodes()) .beginTime($jap.getBeginTime()) @@ -458,7 +458,7 @@ then .primaryLocation($jap.getPrimaryLocationId()) .contractType($jap.getAppointmentType()) .build()); - logMsg("Rule : publiclaw_recorder_fee_paid_joh"); + logMsg("Rule : publiclaw_magistrate_voluntary_joh"); end; /* @@ -683,7 +683,7 @@ end; rule "publiclaw_district_judge_in_retirement_fee_paid_joh" when $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_1.getValue()) - $jap: JudicialAccessProfile(appointment == "District Judge- Sitting in Retirement -Fee Paid", + $jap: JudicialAccessProfile(appointment == "District Judge (sitting in retirement)", appointmentType in ("Fee Paid"), (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), validateAuthorisation(authorisations, "ABA3")) diff --git a/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java b/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java index f93423e66..1729ba5d6 100644 --- a/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java +++ b/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java @@ -275,13 +275,13 @@ static Stream endToEndData() { false, List.of("District Judge (MC) - Sitting in Retirement - Fee Paid"), List.of("fee-paid-judge","hmcts-judiciary")), - Arguments.of("District Judge- Sitting in Retirement -Fee Paid", "Fee Paid", + Arguments.of("District Judge (sitting in retirement)", "Fee Paid", true, false, List.of("District Judge - Sitting in Retirement - Fee Paid"), List.of("judge","fee-paid-judge","hmcts-judiciary")), //no Judicial Booking, no judge role - Arguments.of("District Judge- Sitting in Retirement -Fee Paid", "Fee Paid", + Arguments.of("District Judge (sitting in retirement)", "Fee Paid", false, false, List.of("District Judge - Sitting in Retirement - Fee Paid"), From 941a0a53325864be67873a2ca7dd4ed59b172eae Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Thu, 14 Sep 2023 10:41:06 +0100 Subject: [PATCH 3/7] duplicate JOH rule publiclaw_district_judge_mc_sptw_joh removed, references in role rules removed --- ...bliclaw-judicial-office-holder-mapping.drl | 31 ++----------------- .../publiclaw-judicial-org-role-mapping.drl | 4 +-- 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl b/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl index c02172cd2..b7118de6c 100644 --- a/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl +++ b/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl @@ -300,40 +300,13 @@ then end; /* - * 11: "PUBLICLAW District Judge (MC) - SPTW" business role mapping to JOH. - */ -rule "publiclaw_district_judge_mc_sptw_joh" -when - $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) - $jap: JudicialAccessProfile(appointment == "District Judge (MC)", - appointmentType in ("Salaried", "SPTW"), - (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), - validateAuthorisation(authorisations, "ABA3")) -then - insert( - JudicialOfficeHolder.builder() - .userId($jap.getUserId()) - .office("PUBLICLAW District Judge (MC) - SPTW") - .jurisdiction("PUBLICLAW") - .ticketCodes($jap.getTicketCodes()) - .beginTime($jap.getBeginTime()) - .endTime($jap.getEndTime()) - .regionId($jap.getRegionId()) - .baseLocationId($jap.getBaseLocationId()) - .primaryLocation($jap.getPrimaryLocationId()) - .contractType($jap.getAppointmentType()) - .build()); - logMsg("Rule : publiclaw_district_judge_mc_sptw_joh"); -end; - -/* ############## looks very similar to 11, moved here for comparison ########################## - * 15: "PUBLICLAW District Judge (MC) - Salaried" business role mapping to JOH. + * 11: "PUBLICLAW District Judge (MC) - Salaried" business role mapping to JOH. */ rule "publiclaw_district_judge_mc_salaried_joh" when $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) $jap: JudicialAccessProfile(appointment == "District Judge (MC)", - appointmentType in ("Salaried"), + appointmentType in ("Salaried", "SPTW"), (endTime == null || endTime.compareTo(ZonedDateTime.now()) >= 0), validateAuthorisation(authorisations, "ABA3")) then diff --git a/src/main/resources/validationrules/publiclaw/publiclaw-judicial-org-role-mapping.drl b/src/main/resources/validationrules/publiclaw/publiclaw-judicial-org-role-mapping.drl index 5ec288b13..6a2662bf5 100644 --- a/src/main/resources/validationrules/publiclaw/publiclaw-judicial-org-role-mapping.drl +++ b/src/main/resources/validationrules/publiclaw/publiclaw-judicial-org-role-mapping.drl @@ -23,7 +23,7 @@ import function uk.gov.hmcts.reform.orgrolemapping.domain.service.RequestMapping rule "publiclaw_salaried_judge_org_role" when $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) - $joh: JudicialOfficeHolder(office in ("PUBLICLAW District Judge - Salaried", "PUBLICLAW District Judge (MC) - SPTW", + $joh: JudicialOfficeHolder(office in ("PUBLICLAW District Judge - Salaried", "PUBLICLAW High Court Judge - Salaried", "PUBLICLAW Circuit Judge - Salaried", "PUBLICLAW Designated Family Judge - Salaried", "PUBLICLAW District Judge (MC) - Salaried", "PUBLICLAW Specialist Circuit Judge - Salaried", "PUBLICLAW Senior Circuit Judge - Salaried", "PUBLICLAW Tribunal Judge - Salaried", "PUBLICLAW Employment Judge - Salaried")) @@ -130,7 +130,7 @@ rule "publiclaw_hmcts_judiciary_role" when $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) $joh: JudicialOfficeHolder(office in ( - "PUBLICLAW District Judge - Salaried", "PUBLICLAW District Judge (MC) - SPTW", + "PUBLICLAW District Judge - Salaried", "PUBLICLAW High Court Judge - Salaried", "PUBLICLAW Circuit Judge - Salaried", "PUBLICLAW Deputy District Judge (MC) - Fee Paid", "PUBLICLAW Deputy District Judge (MC) - Sitting in Retirement", "PUBLICLAW Deputy District Judge - Fee Paid", "PUBLICLAW Deputy District Judge - Sitting in Retirement - Fee Paid", From 646128f55f7c0031651c9c560efaf7e61d4450ed Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Thu, 14 Sep 2023 12:38:49 +0100 Subject: [PATCH 4/7] hearing-manager role rule refactored to only exclude Magistrate from PUBLICLAW, tests updated to include hearings --- .../core/hearing-role-judicial-global.drl | 11 +---- ...DroolPublicLawJudicialRoleMappingTest.java | 40 +++++++++---------- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/src/main/resources/validationrules/core/hearing-role-judicial-global.drl b/src/main/resources/validationrules/core/hearing-role-judicial-global.drl index d49b5516d..93d9e1a82 100644 --- a/src/main/resources/validationrules/core/hearing-role-judicial-global.drl +++ b/src/main/resources/validationrules/core/hearing-role-judicial-global.drl @@ -53,15 +53,8 @@ import function uk.gov.hmcts.reform.orgrolemapping.domain.service.RequestMapping rule "global_hearing_manager_judicial" when $f: FeatureFlag(status && flagName == FeatureFlagEnum.SSCS_HEARING_1_0.getValue()) - $joh: JudicialOfficeHolder(office in ( - "PUBLICLAW District Judge - Salaried", "PUBLICLAW District Judge (MC) - SPTW", - "PUBLICLAW High Court Judge - Salaried", "PUBLICLAW Circuit Judge - Salaried", - "PUBLICLAW Deputy District Judge (MC) - Fee Paid", "PUBLICLAW Deputy District Judge (MC) - Sitting in Retirement", - "PUBLICLAW Deputy District Judge - Fee Paid", "PUBLICLAW Deputy District Judge - Sitting in Retirement - Fee Paid", - "PUBLICLAW Deputy District Judge - PRFD - Fee Paid", "PUBLICLAW Deputy High Court Judge - Fee Paid", - "PUBLICLAW High Court Judge - Sitting in Retirement - Fee Paid", - "PUBLICLAW Designated Family Judge - Salaried", "PUBLICLAW District Judge (MC) - Salaried", - "PUBLICLAW Deputy Circuit Judge - Fee Paid","PUBLICLAW Recorder - Fee Paid")) + $joh: JudicialOfficeHolder( jurisdiction in ("PUBLICLAW") && + office not in ("PUBLICLAW Magistrate - Voluntary")) then Map attribute = new HashMap<>(); attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode($joh.getJurisdiction())); diff --git a/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java b/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java index 1729ba5d6..3d544365a 100644 --- a/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java +++ b/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java @@ -233,59 +233,59 @@ static Stream endToEndData() { List.of("judge","hmcts-judiciary")), Arguments.of("Circuit Judge (sitting in retirement)", "Fee Paid", true, - false, + true, List.of("Circuit Judge - Sitting in Retirement - Fee Paid"), - List.of("judge","fee-paid-judge","hmcts-judiciary")), + List.of("judge","fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), //no Judicial Booking, no judge role Arguments.of("Circuit Judge (sitting in retirement)", "Fee Paid", false, - false, + true, List.of("Circuit Judge - Sitting in Retirement - Fee Paid"), - List.of("fee-paid-judge","hmcts-judiciary")), + List.of("fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), Arguments.of("Recorder (sitting in retirement)", "Fee Paid", true, - false, + true, List.of("Recorder - Sitting in Retirement - Fee Paid"), - List.of("judge","fee-paid-judge","hmcts-judiciary")), + List.of("judge","fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), //no Judicial Booking, no judge role Arguments.of("Recorder (sitting in retirement)", "Fee Paid", false, - false, + true, List.of("Recorder - Sitting in Retirement - Fee Paid"), - List.of("fee-paid-judge","hmcts-judiciary")), + List.of("fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), Arguments.of("Deputy Upper Tribunal Judge", "Fee Paid", true, - false, + true, List.of("Deputy Upper Tribunal Judge - Fee Paid"), - List.of("judge","fee-paid-judge","hmcts-judiciary")), + List.of("judge","fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), //no Judicial Booking, no judge role Arguments.of("Deputy Upper Tribunal Judge", "Fee Paid", false, - false, + true, List.of("Deputy Upper Tribunal Judge - Fee Paid"), - List.of("fee-paid-judge","hmcts-judiciary")), + List.of("fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), Arguments.of("District Judge (MC)- Sitting in Retirement", "Fee Paid", true, - false, + true, List.of("District Judge (MC) - Sitting in Retirement - Fee Paid"), - List.of("judge","fee-paid-judge","hmcts-judiciary")), + List.of("judge","fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), //no Judicial Booking, no judge role Arguments.of("District Judge (MC)- Sitting in Retirement", "Fee Paid", false, - false, + true, List.of("District Judge (MC) - Sitting in Retirement - Fee Paid"), - List.of("fee-paid-judge","hmcts-judiciary")), + List.of("fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), Arguments.of("District Judge (sitting in retirement)", "Fee Paid", true, - false, + true, List.of("District Judge - Sitting in Retirement - Fee Paid"), - List.of("judge","fee-paid-judge","hmcts-judiciary")), + List.of("judge","fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), //no Judicial Booking, no judge role Arguments.of("District Judge (sitting in retirement)", "Fee Paid", false, - false, + true, List.of("District Judge - Sitting in Retirement - Fee Paid"), - List.of("fee-paid-judge","hmcts-judiciary")) + List.of("fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")) ); } From e43f550297eff70ea9a006c52069eb86ea13fe90 Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Thu, 14 Sep 2023 12:40:58 +0100 Subject: [PATCH 5/7] comment added --- .../domain/service/DroolPublicLawJudicialRoleMappingTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java b/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java index 3d544365a..cd72ff366 100644 --- a/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java +++ b/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java @@ -200,6 +200,7 @@ static Stream endToEndData() { List.of("High Court Judge"), List.of("fee-paid-judge", "hmcts-judiciary", "hearing-viewer", "hearing-manager")), + // hearing-manager excluded from Magistrate Arguments.of("Magistrate", "Voluntary", false, true, From 4517603d34ad9a5fba0301955fc3f35dcba0ab23 Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Thu, 14 Sep 2023 13:32:52 +0100 Subject: [PATCH 6/7] more hearing flags plus assertions added --- .../DroolPublicLawJudicialRoleMappingTest.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java b/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java index cd72ff366..85b700beb 100644 --- a/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java +++ b/src/test/java/uk/gov/hmcts/reform/orgrolemapping/domain/service/DroolPublicLawJudicialRoleMappingTest.java @@ -214,24 +214,24 @@ static Stream endToEndData() { "hearing-viewer", "hearing-manager")), Arguments.of("Tribunal Judge", "Salaried", false, - false, + true, List.of("Tribunal Judge - Salaried"), - List.of("judge","hmcts-judiciary")), + List.of("judge","hmcts-judiciary","hearing-viewer","hearing-manager")), Arguments.of("Employment Judge", "Salaried", false, - false, + true, List.of("Employment Judge - Salaried"), - List.of("judge","hmcts-judiciary")), + List.of("judge","hmcts-judiciary","hearing-viewer","hearing-manager")), Arguments.of("Specialist Circuit Judge", "Salaried", false, - false, + true, List.of("Specialist Circuit Judge - Salaried"), - List.of("judge","hmcts-judiciary")), + List.of("judge","hmcts-judiciary","hearing-viewer","hearing-manager")), Arguments.of("Senior Circuit Judge", "Salaried", false, - false, + true, List.of("Senior Circuit Judge - Salaried"), - List.of("judge","hmcts-judiciary")), + List.of("judge","hmcts-judiciary","hearing-viewer","hearing-manager")), Arguments.of("Circuit Judge (sitting in retirement)", "Fee Paid", true, true, From 126d3e10faa6dfd704746174bb4d4d182dbcb3b2 Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Mon, 18 Sep 2023 10:50:32 +0100 Subject: [PATCH 7/7] service_name in db scripts correct to publiclaw --- ...COT-519_PUBLICLAW_WA_1_1_base_flag_addition.sql | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/resources/db/migration/V20230912_519__COT-519_PUBLICLAW_WA_1_1_base_flag_addition.sql b/src/main/resources/db/migration/V20230912_519__COT-519_PUBLICLAW_WA_1_1_base_flag_addition.sql index 3fb8acae5..a3018ca8a 100644 --- a/src/main/resources/db/migration/V20230912_519__COT-519_PUBLICLAW_WA_1_1_base_flag_addition.sql +++ b/src/main/resources/db/migration/V20230912_519__COT-519_PUBLICLAW_WA_1_1_base_flag_addition.sql @@ -1,7 +1,7 @@ -INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'local', 'st_cic', 'true'); -INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'pr', 'st_cic', 'true'); -INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'aat', 'st_cic', 'false'); -INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'demo', 'st_cic', 'false'); -INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'perftest', 'st_cic', 'false'); -INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'ithc', 'st_cic', 'false'); -INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'prod', 'st_cic', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'local', 'publiclaw', 'true'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'pr', 'publiclaw', 'true'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'aat', 'publiclaw', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'demo', 'publiclaw', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'perftest', 'publiclaw', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'ithc', 'publiclaw', 'false'); +INSERT INTO flag_config (flag_name, env, service_name, status) VALUES ('publiclaw_wa_1_1', 'prod', 'publiclaw', 'false');