Skip to content

Commit 2d80100

Browse files
authored
Revert "Revert "Fpvtl 2095 c100 policy changes (#3589)" (#3673)" (#3685)
This reverts commit c5911b2.
1 parent 37a4188 commit 2d80100

20 files changed

Lines changed: 476 additions & 12 deletions

src/main/java/uk/gov/hmcts/reform/prl/constants/PrlAppsConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,6 +1145,7 @@ public class PrlAppsConstants {
11451145
public static final String IS_INVOKED_FROM_TASK = "isInvokedFromTask";
11461146
public static final String ALLOCATED_BARRISTER = "allocatedBarrister";
11471147
public static final String CAFCASS_DATE_TIME = "cafcassDateTime";
1148+
public static final String PERMISSION_REQUIRED_DOCUMENT = "uploadOrderDocForPermission";
11481149
public static final String MESSAGE_REPLY_DYNAMIC_LIST = "messageReplyDynamicList";
11491150
public static final String MESSAGE_IDENTIFIER = "messageIdentifier";
11501151
public static final String TASK_ASSOCIATED_WITH_MESSAGE = "taskAssociatedWithMessage";

src/main/java/uk/gov/hmcts/reform/prl/enums/PermissionRequiredEnum.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ public String getDisplayedValue() {
2222

2323
@JsonCreator
2424
public static PermissionRequiredEnum getValue(String key) {
25+
if ("Yes".equalsIgnoreCase(key)) {
26+
return yes;
27+
}
28+
if ("No".equalsIgnoreCase(key)) {
29+
return noNotRequired;
30+
}
2531
return PermissionRequiredEnum.valueOf(key);
2632
}
27-
2833
}
2934

src/main/java/uk/gov/hmcts/reform/prl/enums/SpokenOrWrittenWelshEnum.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
public enum SpokenOrWrittenWelshEnum {
1212

1313
@JsonProperty("spoken")
14-
spoken("Will need to speak Welsh"),
14+
spoken("Will want to speak Welsh"),
1515
@JsonProperty("written")
16-
written("Will need to read and write in Welsh"),
16+
written("Will want to read and write in Welsh"),
1717
@JsonProperty("both")
1818
both("Both");
1919

src/main/java/uk/gov/hmcts/reform/prl/enums/respondentsolicitor/RespondentWelshNeedsListEnum.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
@JsonSerialize(using = CustomEnumSerializer.class)
1414
public enum RespondentWelshNeedsListEnum {
1515
@JsonProperty("speakWelsh")
16-
speakWelsh("Will need to speak Welsh"),
16+
speakWelsh("Will want to speak Welsh"),
1717

1818
@JsonProperty("readAndWriteWelsh")
19-
readAndWriteWelsh("Will need to read and write in Welsh");
19+
readAndWriteWelsh("Will want to read and write in Welsh");
2020

2121
private final String displayedValue;
2222

src/main/java/uk/gov/hmcts/reform/prl/mapper/citizen/CaseDataMapper.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import uk.gov.hmcts.reform.prl.models.c100rebuild.C100RebuildReasonableAdjustmentsElements;
1919
import uk.gov.hmcts.reform.prl.models.c100rebuild.C100RebuildRespondentDetailsElements;
2020
import uk.gov.hmcts.reform.prl.models.c100rebuild.C100RebuildSafetyConcernsElements;
21+
import uk.gov.hmcts.reform.prl.models.c100rebuild.C100RebuildScreeningQuestionsElements;
2122
import uk.gov.hmcts.reform.prl.models.c100rebuild.C100RebuildUrgencyElements;
2223
import uk.gov.hmcts.reform.prl.models.dto.ccd.CaseData;
2324

@@ -34,6 +35,7 @@
3435
import static uk.gov.hmcts.reform.prl.mapper.citizen.CaseDataReasonableAdjustmentsElementsMapper.updateReasonableAdjustmentsElementsForCaseData;
3536
import static uk.gov.hmcts.reform.prl.mapper.citizen.CaseDataRespondentDetailsElementsMapper.updateRespondentDetailsElementsForCaseData;
3637
import static uk.gov.hmcts.reform.prl.mapper.citizen.CaseDataSafetyConcernsElementsMapper.updateSafetyConcernsElementsForCaseData;
38+
import static uk.gov.hmcts.reform.prl.mapper.citizen.CaseDataScreeningQuestionsElementsMapper.updateScreeningQuestionsElementsForCaseData;
3739
import static uk.gov.hmcts.reform.prl.mapper.citizen.CaseDataTypeOfOrderElementsMapper.updateTypeOfOrderElementsForCaseData;
3840
import static uk.gov.hmcts.reform.prl.mapper.citizen.CaseDataUrgencyElementsMapper.updateUrgencyElementsForCaseData;
3941

@@ -90,6 +92,12 @@ public CaseData buildUpdatedCaseData(CaseData caseData) throws JsonProcessingExc
9092
updateMiamElementsForCaseData(caseDataBuilder, c100RebuildMiamElements);
9193
}
9294

95+
if (isNotEmpty(c100RebuildData.getC100RebuildScreeningQuestions())) {
96+
C100RebuildScreeningQuestionsElements c100RebuildScreeningQuestionsElements = mapper
97+
.readValue(c100RebuildData.getC100RebuildScreeningQuestions(), C100RebuildScreeningQuestionsElements.class);
98+
updateScreeningQuestionsElementsForCaseData(caseDataBuilder, c100RebuildScreeningQuestionsElements);
99+
}
100+
93101
if (isNotEmpty(c100RebuildData.getC100RebuildChildDetails())) {
94102
c100RebuildChildDetailsElements = mapper
95103
.readValue(c100RebuildData.getC100RebuildChildDetails(), C100RebuildChildDetailsElements.class);
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
package uk.gov.hmcts.reform.prl.mapper.citizen;
2+
3+
import org.apache.commons.lang3.StringUtils;
4+
import uk.gov.hmcts.reform.prl.enums.PermissionRequiredEnum;
5+
import uk.gov.hmcts.reform.prl.enums.YesOrNo;
6+
import uk.gov.hmcts.reform.prl.models.c100rebuild.C100RebuildScreeningQuestionsElements;
7+
import uk.gov.hmcts.reform.prl.models.documents.Document;
8+
import uk.gov.hmcts.reform.prl.models.dto.ccd.CaseData;
9+
10+
import java.util.List;
11+
12+
import static org.apache.commons.lang3.ObjectUtils.isNotEmpty;
13+
14+
15+
public class CaseDataScreeningQuestionsElementsMapper {
16+
17+
public static final String NONE = "none";
18+
19+
private CaseDataScreeningQuestionsElementsMapper() {
20+
}
21+
22+
public static void updateScreeningQuestionsElementsForCaseData(CaseData.CaseDataBuilder<?, ?> caseDataBuilder,
23+
C100RebuildScreeningQuestionsElements c100RebuildScreeningQuestionsElements) {
24+
25+
caseDataBuilder
26+
.applicationPermissionRequired(isNotEmpty(c100RebuildScreeningQuestionsElements.getSqCourtPermissionRequired())
27+
? PermissionRequiredEnum.getValue(c100RebuildScreeningQuestionsElements.getSqCourtPermissionRequired())
28+
: null)
29+
.orderInPlacePermissionRequired(isNotEmpty(c100RebuildScreeningQuestionsElements.getSqPermissionsWhy())
30+
? buildOrderInPlace(c100RebuildScreeningQuestionsElements.getSqPermissionsWhy()) : null)
31+
.orderDetailsForPermissions(StringUtils.isNotEmpty(c100RebuildScreeningQuestionsElements.getSqCourtOrderPreventSubfield())
32+
? c100RebuildScreeningQuestionsElements.getSqCourtOrderPreventSubfield() : null)
33+
.uploadOrderDocForPermission(isNotEmpty(c100RebuildScreeningQuestionsElements.getSqUploadDocumentSubfield())
34+
? buildDocument(c100RebuildScreeningQuestionsElements.getSqUploadDocumentSubfield()) : null);
35+
}
36+
37+
private static YesOrNo buildOrderInPlace(List<String> sqPermissionsWhy) {
38+
if (sqPermissionsWhy == null || sqPermissionsWhy.isEmpty()) {
39+
return null;
40+
}
41+
42+
boolean hasNonEmptyValue = false;
43+
44+
for (String value : sqPermissionsWhy) {
45+
if (StringUtils.isNotEmpty(value)) {
46+
hasNonEmptyValue = true;
47+
48+
if (value.equalsIgnoreCase("courtOrderPrevent")) {
49+
return YesOrNo.Yes;
50+
}
51+
}
52+
}
53+
return hasNonEmptyValue ? YesOrNo.No : null;
54+
}
55+
56+
static Document buildDocument(uk.gov.hmcts.reform.prl.models.documents.Document document) {
57+
if (isNotEmpty(document)) {
58+
return Document.builder()
59+
.documentUrl(document.getDocumentUrl())
60+
.documentBinaryUrl(document.getDocumentBinaryUrl())
61+
.documentFileName(document.getDocumentFileName())
62+
.build();
63+
}
64+
return null;
65+
}
66+
}

src/main/java/uk/gov/hmcts/reform/prl/mapper/citizen/CitizenPartyDetailsMapper.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import uk.gov.hmcts.reform.prl.models.c100rebuild.C100RebuildReasonableAdjustmentsElements;
3434
import uk.gov.hmcts.reform.prl.models.c100rebuild.C100RebuildRespondentDetailsElements;
3535
import uk.gov.hmcts.reform.prl.models.c100rebuild.C100RebuildSafetyConcernsElements;
36+
import uk.gov.hmcts.reform.prl.models.c100rebuild.C100RebuildScreeningQuestionsElements;
3637
import uk.gov.hmcts.reform.prl.models.c100rebuild.C100RebuildUrgencyElements;
3738
import uk.gov.hmcts.reform.prl.models.complextypes.Child;
3839
import uk.gov.hmcts.reform.prl.models.complextypes.ChildDetailsRevised;
@@ -104,6 +105,7 @@
104105
import static uk.gov.hmcts.reform.prl.mapper.citizen.CaseDataReasonableAdjustmentsElementsMapper.updateReasonableAdjustmentsElementsForCaseData;
105106
import static uk.gov.hmcts.reform.prl.mapper.citizen.CaseDataRespondentDetailsElementsMapper.updateRespondentDetailsElementsForCaseData;
106107
import static uk.gov.hmcts.reform.prl.mapper.citizen.CaseDataSafetyConcernsElementsMapper.updateSafetyConcernsElementsForCaseData;
108+
import static uk.gov.hmcts.reform.prl.mapper.citizen.CaseDataScreeningQuestionsElementsMapper.updateScreeningQuestionsElementsForCaseData;
107109
import static uk.gov.hmcts.reform.prl.mapper.citizen.CaseDataTypeOfOrderElementsMapper.updateTypeOfOrderElementsForCaseData;
108110
import static uk.gov.hmcts.reform.prl.mapper.citizen.CaseDataUrgencyElementsMapper.updateUrgencyElementsForCaseData;
109111
import static uk.gov.hmcts.reform.prl.utils.CommonUtils.getPartyResponse;
@@ -987,6 +989,12 @@ public CaseData buildUpdatedCaseData(CaseData caseData, C100RebuildData c100Rebu
987989
updateOtherProceedingsElementsForCaseData(caseDataBuilder, c100RebuildOtherProceedingsElements);
988990
}
989991

992+
if (StringUtils.isNotEmpty(c100RebuildData.getC100RebuildScreeningQuestions())) {
993+
C100RebuildScreeningQuestionsElements c100RebuildScreeningQuestionsElements = mapper
994+
.readValue(c100RebuildData.getC100RebuildScreeningQuestions(), C100RebuildScreeningQuestionsElements.class);
995+
updateScreeningQuestionsElementsForCaseData(caseDataBuilder, c100RebuildScreeningQuestionsElements);
996+
}
997+
990998
if (StringUtils.isNotEmpty(c100RebuildData.getC100RebuildHearingUrgency())) {
991999
C100RebuildUrgencyElements c100RebuildUrgencyElements = mapper
9921000
.readValue(c100RebuildData.getC100RebuildHearingUrgency(), C100RebuildUrgencyElements.class);

src/main/java/uk/gov/hmcts/reform/prl/mapper/welshlang/WelshLangMapper.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,10 @@ private static Map<String, String> getCaWelshLangMap() {
609609
* Attending the hearing.*/
610610
welshMap.put("isWelshNeeded_yes", "Bydd");
611611
welshMap.put("isWelshNeeded_no", WELSH_NO_NA_FYDD);
612-
welshMap.put(SpokenOrWrittenWelshEnum.spoken.getDisplayedValue(), "Byddant eisiau siarad Cymraeg");
612+
welshMap.put(SpokenOrWrittenWelshEnum.spoken.getDisplayedValue(), "Bydd eisiau siarad Cymraeg");
613613
welshMap.put(
614614
SpokenOrWrittenWelshEnum.written.getDisplayedValue(),
615-
"Byddant eisiau darllen ac ysgrifennu yn Gymraeg"
615+
"Bydd eisiau darllen ac ysgrifennu yn Gymraeg"
616616
);
617617
welshMap.put(SpokenOrWrittenWelshEnum.both.getDisplayedValue(), "Y ddau");
618618
welshMap.put("isInterpreterNeeded_yes", "Bydd");
@@ -1274,10 +1274,10 @@ private static Map<String, String> getDaWelshLangMap() {
12741274
*/
12751275
welshMap.put("isWelshNeeded_yes", "Bydd");
12761276
welshMap.put("isWelshNeeded_no", WELSH_NO_NA_FYDD);
1277-
welshMap.put(SpokenOrWrittenWelshEnum.spoken.getDisplayedValue(), "Byddant eisiau siarad Cymraeg");
1277+
welshMap.put(SpokenOrWrittenWelshEnum.spoken.getDisplayedValue(), "Bydd eisiau siarad Cymraeg");
12781278
welshMap.put(
12791279
SpokenOrWrittenWelshEnum.written.getDisplayedValue(),
1280-
"Byddant eisiau darllen ac ysgrifennu yn Gymraeg"
1280+
"Bydd eisiau darllen ac ysgrifennu yn Gymraeg"
12811281
);
12821282
welshMap.put("isInterpreterNeeded_yes", "Ydw");
12831283
welshMap.put("isInterpreterNeeded_no", WELSH_NO_NAC_YDW);
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package uk.gov.hmcts.reform.prl.models.c100rebuild;
2+
3+
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
4+
import com.fasterxml.jackson.annotation.JsonProperty;
5+
import lombok.AllArgsConstructor;
6+
import lombok.Builder;
7+
import lombok.Data;
8+
import lombok.NoArgsConstructor;
9+
import uk.gov.hmcts.reform.prl.models.documents.Document;
10+
11+
import java.util.List;
12+
13+
@Data
14+
@Builder(toBuilder = true)
15+
@NoArgsConstructor
16+
@AllArgsConstructor
17+
@JsonIgnoreProperties(ignoreUnknown = true)
18+
public class C100RebuildScreeningQuestionsElements {
19+
20+
@JsonProperty("sq_writtenAgreement")
21+
private String sqWrittenAgreement;
22+
@JsonProperty("sq_alternativeRoutes")
23+
private String sqAlternativeRoutes;
24+
@JsonProperty("sq_legalRepresentation")
25+
private String sqLegalRepresentation;
26+
@JsonProperty("sq_courtPermissionRequired")
27+
private String sqCourtPermissionRequired;
28+
@JsonProperty("sq_permissionsWhy")
29+
private List<String> sqPermissionsWhy;
30+
@JsonProperty("sq_courtOrderPrevent_subfield")
31+
private String sqCourtOrderPreventSubfield;
32+
@JsonProperty("sq_uploadDocument_subfield")
33+
private Document sqUploadDocumentSubfield;
34+
@JsonProperty("sqPermissionsRequest")
35+
private String sqPermissionsRequest;
36+
37+
}

src/main/java/uk/gov/hmcts/reform/prl/models/complextypes/applicationtab/TypeOfApplication.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ public class TypeOfApplication {
1212
private final String natureOfOrder;
1313
private final String applicationPermissionRequiredReason;
1414
private final String applicationPermissionRequired;
15+
private final String orderInPlacePermissionRequired;
16+
private final String orderDetailsForPermissions;
17+
private final String uploadOrderDocForPermission;
1518

1619
}

0 commit comments

Comments
 (0)