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..a3018ca8a --- /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', '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'); 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/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl b/src/main/resources/validationrules/publiclaw/publiclaw-judicial-office-holder-mapping.drl index 1fa64658e..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 @@ -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,9 +300,9 @@ then end; /* - * 10: "PUBLICLAW District Judge (MC) - SPTW" business role mapping to JOH. + * 11: "PUBLICLAW District Judge (MC) - Salaried" business role mapping to JOH. */ -rule "publiclaw_district_judge_mc_sptw_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)", @@ -286,7 +313,7 @@ then insert( JudicialOfficeHolder.builder() .userId($jap.getUserId()) - .office("PUBLICLAW District Judge (MC) - SPTW") + .office("PUBLICLAW District Judge (MC) - Salaried") .jurisdiction("PUBLICLAW") .ticketCodes($jap.getTicketCodes()) .beginTime($jap.getBeginTime()) @@ -296,11 +323,11 @@ then .primaryLocation($jap.getPrimaryLocationId()) .contractType($jap.getAppointmentType()) .build()); - logMsg("Rule : publiclaw_district_judge_mc_sptw_joh"); + logMsg("Rule : publiclaw_district_judge_mc_salaried_joh"); end; /* - * 11: "PUBLICLAW High Court Judge - Salaried" business role mapping to JOH. + * 12: "PUBLICLAW High Court Judge - Salaried" business role mapping to JOH. */ rule "publiclaw_high_court_judge_salaried_joh" when @@ -327,7 +354,7 @@ then end; /* - * 12: "PUBLICLAW High Court Judge - Sitting in Retirement - Fee Paid" business role mapping to JOH. + * 13: "PUBLICLAW High Court Judge - Sitting in Retirement - Fee Paid" business role mapping to JOH. */ rule "publiclaw_high_court_judge_in_retirement_joh" when @@ -354,7 +381,7 @@ then end; /* - * 13: "PUBLICLAW Designated Family Judge - Salaried" business role mapping to JOH. + * 14: "PUBLICLAW Designated Family Judge - Salaried" business role mapping to JOH. */ rule "publiclaw_designated_family_judge_salaried_joh" when @@ -381,7 +408,7 @@ then end; /* - * 14: "PUBLICLAW Magistrate - Voluntary" business role mapping to JOH. + * 15: "PUBLICLAW Magistrate - Voluntary" business role mapping to JOH. */ rule "publiclaw_magistrate_voluntary_joh" when @@ -408,12 +435,12 @@ then end; /* - * 15: "PUBLICLAW District Judge (MC) - Salaried" business role mapping to JOH. + * 16: "PUBLICLAW Tribunal Judge - Salaried" business role mapping to JOH. */ -rule "publiclaw_district_judge_mc_salaried_joh" +rule "publiclaw_tribunal_judge_salaried_joh" when - $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) - $jap: JudicialAccessProfile(appointment == "District Judge (MC)", + $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")) @@ -421,7 +448,7 @@ then insert( JudicialOfficeHolder.builder() .userId($jap.getUserId()) - .office("PUBLICLAW District Judge (MC) - Salaried") + .office("PUBLICLAW Tribunal Judge - Salaried") .jurisdiction("PUBLICLAW") .ticketCodes($jap.getTicketCodes()) .beginTime($jap.getBeginTime()) @@ -431,24 +458,24 @@ then .primaryLocation($jap.getPrimaryLocationId()) .contractType($jap.getAppointmentType()) .build()); - logMsg("Rule : publiclaw_district_judge_mc_salaried_joh"); + logMsg("Rule : publiclaw_tribunal_judge_salaried_joh"); end; /* - * 16. "PUBLICLAW Recorder-Fee-Paid" business role business role mapping to JOH. + * 17: "PUBLICLAW Employment Judge - Salaried" business role mapping to JOH. */ -rule "publiclaw_recorder_fee_paid_joh" +rule "publiclaw_employment_judge_salaried_joh" when - $f: FeatureFlag(status && flagName == FeatureFlagEnum.PUBLICLAW_WA_1_0.getValue()) - $jap: JudicialAccessProfile(appointment == "Recorder", - appointmentType == "Fee Paid", + $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 Recorder - Fee Paid") + .office("PUBLICLAW Employment Judge - Salaried") .jurisdiction("PUBLICLAW") .ticketCodes($jap.getTicketCodes()) .beginTime($jap.getBeginTime()) @@ -458,5 +485,194 @@ then .primaryLocation($jap.getPrimaryLocationId()) .contractType($jap.getAppointmentType()) .build()); - logMsg("Rule : publiclaw_recorder_fee_paid_joh"); + 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)", + 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..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,9 +23,10 @@ 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 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<>(); @@ -127,13 +130,18 @@ 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", "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..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 @@ -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, @@ -210,7 +211,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, + true, + List.of("Tribunal Judge - Salaried"), + List.of("judge","hmcts-judiciary","hearing-viewer","hearing-manager")), + Arguments.of("Employment Judge", "Salaried", + false, + true, + List.of("Employment Judge - Salaried"), + List.of("judge","hmcts-judiciary","hearing-viewer","hearing-manager")), + Arguments.of("Specialist Circuit Judge", "Salaried", + false, + true, + List.of("Specialist Circuit Judge - Salaried"), + List.of("judge","hmcts-judiciary","hearing-viewer","hearing-manager")), + Arguments.of("Senior Circuit Judge", "Salaried", + false, + true, + List.of("Senior Circuit Judge - Salaried"), + List.of("judge","hmcts-judiciary","hearing-viewer","hearing-manager")), + Arguments.of("Circuit Judge (sitting in retirement)", "Fee Paid", + true, + true, + List.of("Circuit Judge - Sitting in Retirement - Fee Paid"), + 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, + true, + List.of("Circuit Judge - Sitting in Retirement - Fee Paid"), + List.of("fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), + Arguments.of("Recorder (sitting in retirement)", "Fee Paid", + true, + true, + List.of("Recorder - Sitting in Retirement - Fee Paid"), + 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, + true, + List.of("Recorder - Sitting in Retirement - Fee Paid"), + List.of("fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), + Arguments.of("Deputy Upper Tribunal Judge", "Fee Paid", + true, + true, + List.of("Deputy Upper Tribunal Judge - Fee Paid"), + 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, + true, + List.of("Deputy Upper Tribunal Judge - Fee Paid"), + List.of("fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), + Arguments.of("District Judge (MC)- Sitting in Retirement", "Fee Paid", + true, + true, + List.of("District Judge (MC) - Sitting in Retirement - Fee Paid"), + 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, + true, + List.of("District Judge (MC) - Sitting in Retirement - Fee Paid"), + List.of("fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")), + Arguments.of("District Judge (sitting in retirement)", "Fee Paid", + true, + true, + List.of("District Judge - Sitting in Retirement - Fee Paid"), + 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, + true, + List.of("District Judge - Sitting in Retirement - Fee Paid"), + List.of("fee-paid-judge","hmcts-judiciary","hearing-viewer","hearing-manager")) ); } @@ -254,7 +330,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