Skip to content

Commit

Permalink
DTSAM-139 Retire old rules after CIVIL_WA_1_4 Go Live - obsolete rule…
Browse files Browse the repository at this point in the history
…s removed (#1915)
  • Loading branch information
mikebrownccd authored May 21, 2024
1 parent 4535086 commit 172d397
Showing 1 changed file with 0 additions and 165 deletions.
165 changes: 0 additions & 165 deletions src/main/resources/validationrules/civil/civil-caseworker-mapping.drl
Original file line number Diff line number Diff line change
Expand Up @@ -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<String,JsonNode> 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.
*/
Expand Down Expand Up @@ -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<String,JsonNode> 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<String,JsonNode> 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
*/
Expand Down Expand Up @@ -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<String,JsonNode> 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.
*/
Expand Down Expand Up @@ -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<String,JsonNode> 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.
*/
Expand Down

0 comments on commit 172d397

Please sign in to comment.