diff --git a/src/main/resources/validationrules/civil/civil-caseworker-mapping.drl b/src/main/resources/validationrules/civil/civil-caseworker-mapping.drl index 2aab874b0d..356ec0df07 100644 --- a/src/main/resources/validationrules/civil/civil-caseworker-mapping.drl +++ b/src/main/resources/validationrules/civil/civil-caseworker-mapping.drl @@ -15,39 +15,6 @@ import uk.gov.hmcts.reform.orgrolemapping.domain.model.FeatureFlag; import uk.gov.hmcts.reform.orgrolemapping.domain.model.enums.FeatureFlagEnum; import function uk.gov.hmcts.reform.orgrolemapping.domain.service.RequestMappingService.logMsg; -/* - * CIVIL staff "senior tribunal-caseworker" Org role mapping. - * Made obsolete in DTSAM-131 by CIVIL_WA_1_4. - * To be removed in DTSAM-139. - */ - -rule "civil_senior_tribunal_caseworker_org_role" -when - $f: FeatureFlag(status && flagName == FeatureFlagEnum.CIVIL_WA_1_0.getValue()) - $f2: FeatureFlag(status == false, flagName == FeatureFlagEnum.CIVIL_WA_1_4.getValue()) - $cap: CaseWorkerAccessProfile(roleId == "1", serviceCode in ("AAA6", "AAA7"), !suspended) -then - Map attribute = new HashMap<>(); - attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("CIVIL")); - attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId())); - attribute.put("workTypes", JacksonUtils.convertObjectIntoJsonNode("decision_making_work,access_requests")); - attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId())); - insert( - RoleAssignment.builder() - .actorIdType(ActorIdType.IDAM) - .actorId($cap.getId()) - .roleCategory(RoleCategory.LEGAL_OPERATIONS) - .roleType(RoleType.ORGANISATION) - .roleName("senior-tribunal-caseworker") - .grantType(GrantType.STANDARD) - .classification(Classification.PUBLIC) - .readOnly(false) - .attributes(attribute) - .authorisations($cap.getSkillCodes()) - .build()); - logMsg("Rule : civil_senior_tribunal_caseworker_org_role"); -end; - /* * CIVIL staff "senior tribunal-caseworker" Org role mapping. */ @@ -77,72 +44,6 @@ then logMsg("Rule : v1_4_civil_senior_tribunal_caseworker_org_role"); end; -/* - * CIVIL staff "tribunal-caseworker" Org role mapping. - * Made obsolete in DTSAM-131 by CIVIL_WA_1_4. - * To be removed in DTSAM-139. - */ - -rule "civil_tribunal_caseworker_org_role" -when - $f: FeatureFlag(status && flagName == FeatureFlagEnum.CIVIL_WA_1_0.getValue()) - $f2: FeatureFlag(status == false, flagName == FeatureFlagEnum.CIVIL_WA_1_4.getValue()) - $cap: CaseWorkerAccessProfile(roleId == "2", serviceCode in ("AAA6", "AAA7"), !suspended) -then - Map attribute = new HashMap<>(); - attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("CIVIL")); - attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId())); - attribute.put("workTypes", JacksonUtils.convertObjectIntoJsonNode("decision_making_work")); - attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId())); - insert( - RoleAssignment.builder() - .actorIdType(ActorIdType.IDAM) - .actorId($cap.getId()) - .roleCategory(RoleCategory.LEGAL_OPERATIONS) - .roleType(RoleType.ORGANISATION) - .roleName("tribunal-caseworker") - .grantType(GrantType.STANDARD) - .classification(Classification.PUBLIC) - .readOnly(false) - .attributes(attribute) - .authorisations($cap.getSkillCodes()) - .build()); - logMsg("Rule : civil_tribunal_caseworker_org_role"); -end; - -/* - * CIVIL staff "tribunal-caseworker" v11 Org role mapping. - * Made obsolete in DTSAM-131 by CIVIL_WA_1_4. - * To be removed in DTSAM-139. - */ - -rule "v11_civil_tribunal_caseworker_org_role" -when - $f: FeatureFlag(status && flagName == FeatureFlagEnum.CIVIL_WA_1_1.getValue()) - $f2: FeatureFlag(status == false, flagName == FeatureFlagEnum.CIVIL_WA_1_4.getValue()) - $cap: CaseWorkerAccessProfile(roleId == "1", serviceCode in ("AAA6", "AAA7"), !suspended) -then - Map attribute = new HashMap<>(); - attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("CIVIL")); - attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId())); - attribute.put("workTypes", JacksonUtils.convertObjectIntoJsonNode("decision_making_work")); - attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId())); - insert( - RoleAssignment.builder() - .actorIdType(ActorIdType.IDAM) - .actorId($cap.getId()) - .roleCategory(RoleCategory.LEGAL_OPERATIONS) - .roleType(RoleType.ORGANISATION) - .roleName("tribunal-caseworker") - .grantType(GrantType.STANDARD) - .classification(Classification.PUBLIC) - .readOnly(false) - .attributes(attribute) - .authorisations($cap.getSkillCodes()) - .build()); - logMsg("Rule : v11_civil_tribunal_caseworker_org_role"); -end; - /* * CIVIL staff "tribunal-caseworker" Org role mapping. v1.4 */ @@ -197,39 +98,6 @@ then logMsg("Rule : civil_hmcts_legal_operations_org_role"); end; -/* - * CIVIL staff "task-supervisor" Org role mapping. - * Made obsolete in DTSAM-131 by CIVIL_WA_1_4. - * To be removed in DTSAM-139. - */ -rule "civil_task_supervisor_staff_org_role" -when - $f: FeatureFlag(status && flagName == FeatureFlagEnum.CIVIL_WA_1_0.getValue()) - $f2: FeatureFlag(status == false, flagName == FeatureFlagEnum.CIVIL_WA_1_4.getValue()) - $cap: CaseWorkerAccessProfile(roleId == "1", serviceCode in ("AAA6", "AAA7"), - !suspended, taskSupervisorFlag == "Y") -then - Map attribute = new HashMap<>(); - attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("CIVIL")); - attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId())); - attribute.put("workTypes", JacksonUtils.convertObjectIntoJsonNode("decision_making_work,access_requests")); - attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId())); - insert( - RoleAssignment.builder() - .actorIdType(ActorIdType.IDAM) - .actorId($cap.getId()) - .roleCategory(RoleCategory.LEGAL_OPERATIONS) - .roleType(RoleType.ORGANISATION) - .roleName("task-supervisor") - .grantType(GrantType.STANDARD) - .classification(Classification.PUBLIC) - .readOnly(false) - .attributes(attribute) - .authorisations($cap.getSkillCodes()) - .build()); - logMsg("Rule : civil_task_supervisor_admin_org_role"); -end; - /* * CIVIL staff "task-supervisor" Org role mapping. */ @@ -259,39 +127,6 @@ then logMsg("Rule : v1_4_civil_task_supervisor_admin_org_role"); end; -/* - * CIVIL staff "case-allocator" Org role mapping. - * Made obsolete in DTSAM-131 by CIVIL_WA_1_4. - * To be removed in DTSAM-139. - */ - -rule "civil_case_allocator_staff_org_role" -when - $f: FeatureFlag(status && flagName == FeatureFlagEnum.CIVIL_WA_1_0.getValue()) - $f2: FeatureFlag(status == false, flagName == FeatureFlagEnum.CIVIL_WA_1_4.getValue()) - $cap: CaseWorkerAccessProfile(roleId == "1", serviceCode in ("AAA6", "AAA7"), - !suspended, caseAllocatorFlag == "Y") -then - Map attribute = new HashMap<>(); - attribute.put("jurisdiction", JacksonUtils.convertObjectIntoJsonNode("CIVIL")); - attribute.put("primaryLocation", JacksonUtils.convertObjectIntoJsonNode($cap.getPrimaryLocationId())); - attribute.put("region", JacksonUtils.convertObjectIntoJsonNode($cap.getRegionId())); - insert( - RoleAssignment.builder() - .actorIdType(ActorIdType.IDAM) - .actorId($cap.getId()) - .roleCategory(RoleCategory.LEGAL_OPERATIONS) - .roleType(RoleType.ORGANISATION) - .roleName("case-allocator") - .grantType(GrantType.STANDARD) - .classification(Classification.PUBLIC) - .readOnly(false) - .attributes(attribute) - .authorisations($cap.getSkillCodes()) - .build()); - logMsg("Rule : civil_case_allocator_staff_org_role"); -end; - /* * CIVIL staff "case-allocator" Org role mapping. */