From cfc2d82006380ed325428bcdcd4a6c264d118038 Mon Sep 17 00:00:00 2001 From: adamg-hmcts Date: Mon, 11 Nov 2024 12:44:11 +0000 Subject: [PATCH 1/2] Allow the same search field to be defined for multiple roles --- .../ccd/sdk/generator/SearchFieldAndResultGenerator.java | 3 ++- .../src/test/java/uk/gov/hmcts/reform/fpl/CCDConfig.java | 1 + .../caseworker-publiclaw-solicitor.json | 7 +++++++ .../resources/CARE_SUPERVISION_EPO/SearchInputFields.json | 7 +++++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ccd-config-generator/src/main/java/uk/gov/hmcts/ccd/sdk/generator/SearchFieldAndResultGenerator.java b/ccd-config-generator/src/main/java/uk/gov/hmcts/ccd/sdk/generator/SearchFieldAndResultGenerator.java index 835343ca..027a50ba 100644 --- a/ccd-config-generator/src/main/java/uk/gov/hmcts/ccd/sdk/generator/SearchFieldAndResultGenerator.java +++ b/ccd-config-generator/src/main/java/uk/gov/hmcts/ccd/sdk/generator/SearchFieldAndResultGenerator.java @@ -43,8 +43,9 @@ protected static void generateFields( result.add(map); } } + Path output = Paths.get(root.getPath(), fileName + ".json"); - JsonUtils.mergeInto(output, result, new AddMissing(), "CaseFieldID"); + JsonUtils.mergeInto(output, result, new AddMissing(), "CaseFieldID", "UserRole"); } protected static Map buildField(String caseType, String fieldId, String label, int displayOrder, diff --git a/ccd-config-generator/src/test/java/uk/gov/hmcts/reform/fpl/CCDConfig.java b/ccd-config-generator/src/test/java/uk/gov/hmcts/reform/fpl/CCDConfig.java index 7a969715..32d61fbd 100644 --- a/ccd-config-generator/src/test/java/uk/gov/hmcts/reform/fpl/CCDConfig.java +++ b/ccd-config-generator/src/test/java/uk/gov/hmcts/reform/fpl/CCDConfig.java @@ -191,6 +191,7 @@ private void buildSearchInputFields() { .field(CaseData::getCaseName, "Case name") .field(CaseData::getFamilyManCaseNumber, "FamilyMan case number") .field(CaseData::getDateOfIssue, "Date of Issue", HMCTS_ADMIN) + .field(CaseData::getDateOfIssue, "Date of Issue", LOCAL_AUTHORITY) .field("hearingPreferencesWelsh", "Is in Welsh") .caseReferenceField() .field("allocatedJudge", "Allocated Judge", "judgeTitle", "hearingPreferencesWelsh=\"no\"") diff --git a/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/AuthorisationCaseField/caseworker-publiclaw-solicitor.json b/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/AuthorisationCaseField/caseworker-publiclaw-solicitor.json index ea331d03..e68f3895 100644 --- a/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/AuthorisationCaseField/caseworker-publiclaw-solicitor.json +++ b/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/AuthorisationCaseField/caseworker-publiclaw-solicitor.json @@ -76,6 +76,13 @@ "LiveFrom": "01/01/2017", "CaseFieldID": "allocatedJudgeLabel" }, + { + "CRUD" : "R", + "CaseTypeID" : "CARE_SUPERVISION_EPO", + "UserRole" : "caseworker-publiclaw-solicitor", + "LiveFrom" : "01/01/2017", + "CaseFieldID" : "dateOfIssue" + }, { "CRUD": "CR", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/SearchInputFields.json b/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/SearchInputFields.json index 38abf2d0..0dc5aaaa 100644 --- a/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/SearchInputFields.json +++ b/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/SearchInputFields.json @@ -27,6 +27,13 @@ "UserRole" : "caseworker-publiclaw-courtadmin", "Label" : "Date of Issue" }, + { + "LiveFrom" : "01/01/2017", + "CaseTypeID" : "CARE_SUPERVISION_EPO", + "CaseFieldID" : "dateOfIssue", + "UserRole" : "caseworker-publiclaw-solicitor", + "Label" : "Date of Issue" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO", From 5fe4b416e07e4aaf65a103cff37365f6e2e0e8ba Mon Sep 17 00:00:00 2001 From: adamg-hmcts Date: Wed, 13 Nov 2024 10:45:29 +0000 Subject: [PATCH 2/2] Update workbasket input fields test --- .../src/test/java/uk/gov/hmcts/reform/fpl/CCDConfig.java | 1 + .../caseworker-publiclaw-courtadmin.json | 7 +++++++ .../CARE_SUPERVISION_EPO/WorkBasketInputFields.json | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/ccd-config-generator/src/test/java/uk/gov/hmcts/reform/fpl/CCDConfig.java b/ccd-config-generator/src/test/java/uk/gov/hmcts/reform/fpl/CCDConfig.java index 32d61fbd..31161c9f 100644 --- a/ccd-config-generator/src/test/java/uk/gov/hmcts/reform/fpl/CCDConfig.java +++ b/ccd-config-generator/src/test/java/uk/gov/hmcts/reform/fpl/CCDConfig.java @@ -221,6 +221,7 @@ private void buildWorkBasketInputFields() { .field(CaseData::getCaseName, "Case name") .field(CaseData::getFamilyManCaseNumber, "FamilyMan case number") .field(CaseData::getHearingDetails, "Hearing Details", LOCAL_AUTHORITY) + .field(CaseData::getHearingDetails, "Hearing Details", HMCTS_ADMIN) .field("hearingPreferencesWelsh", "Is in Welsh") .caseReferenceField() .field(CaseData::getDateSubmitted, "Date submitted", "", "#DATETIMEDISPLAY(d MMMM yyyy)") diff --git a/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/AuthorisationCaseField/caseworker-publiclaw-courtadmin.json b/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/AuthorisationCaseField/caseworker-publiclaw-courtadmin.json index 0d6f121a..c42f6334 100644 --- a/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/AuthorisationCaseField/caseworker-publiclaw-courtadmin.json +++ b/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/AuthorisationCaseField/caseworker-publiclaw-courtadmin.json @@ -27,6 +27,13 @@ "LiveFrom": "01/01/2017", "CaseFieldID": "standardDirectionOrder" }, + { + "CRUD": "R", + "CaseTypeID": "CARE_SUPERVISION_EPO", + "UserRole": "caseworker-publiclaw-courtadmin", + "LiveFrom": "01/01/2017", + "CaseFieldID": "hearingDetails" + }, { "CRUD": "R", "CaseTypeID": "CARE_SUPERVISION_EPO", diff --git a/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/WorkBasketInputFields.json b/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/WorkBasketInputFields.json index c9700b99..f62d417a 100644 --- a/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/WorkBasketInputFields.json +++ b/ccd-config-generator/src/test/resources/CARE_SUPERVISION_EPO/WorkBasketInputFields.json @@ -20,6 +20,13 @@ "UserRole" : "caseworker-publiclaw-solicitor", "Label" : "Hearing Details" }, + { + "LiveFrom" : "01/01/2017", + "CaseTypeID" : "CARE_SUPERVISION_EPO", + "CaseFieldID" : "hearingDetails", + "UserRole" : "caseworker-publiclaw-courtadmin", + "Label" : "Hearing Details" + }, { "LiveFrom": "01/01/2017", "CaseTypeID": "CARE_SUPERVISION_EPO",