Skip to content

Commit

Permalink
CIV-11416 li p claims to drop offline after 14 days if no c does not …
Browse files Browse the repository at this point in the history
…occur (#3565)

* CIV-11416 add addLegalRepDeadlineRes2 and addLegalRepDeadlineRes1 and update take case offline schedular

* CIV-11416 remove addLegalRedDeadlineRes1and2 from ONE_V_TWO

* Update NotifyClaimDetailsCallbackHandler.java

* CIV-11416 temporary point to ccd branch

* point ccdBranch to master

* Point to ccd branch test

* Update suppressions.xml

* Adding RPA reason for NOC scenrio

* Update Jenkinsfile_CNP

---------

Co-authored-by: mfallonhmcts <[email protected]>
Co-authored-by: kdaHMCTS <[email protected]>
Co-authored-by: Astha Malviya <[email protected]>
Co-authored-by: asthamalviya <[email protected]>
  • Loading branch information
5 people authored Dec 20, 2023
1 parent c1912e3 commit a819b2f
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ private CallbackResponse applyNoticeOfChangeDecision(CallbackParams callbackPara
CaseDetails caseDetails = callbackParams.getRequest().getCaseDetails();
CaseData preDecisionCaseData = objectMapper.convertValue(caseDetails.getData(), CaseData.class);
String authToken = callbackParams.getParams().get(BEARER_TOKEN).toString();
String caseRole = callbackParams.getCaseData().getChangeOrganisationRequestField().getCaseRoleId().getValue().getCode();

updateOrgPoliciesForLiP(callbackParams.getRequest().getCaseDetails());

Expand All @@ -69,6 +70,8 @@ private CallbackResponse applyNoticeOfChangeDecision(CallbackParams callbackPara
CaseData postDecisionCaseData = objectMapper.convertValue(applyDecision.getData(), CaseData.class);
CaseData.CaseDataBuilder<?, ?> updatedCaseDataBuilder = postDecisionCaseData.toBuilder();

setAddLegalRepDeadlinesToNull(updatedCaseDataBuilder, caseRole);

updateChangeOrganisationRequestFieldAfterNoCDecisionApplied(
updatedCaseDataBuilder,
preDecisionCaseData.getChangeOrganisationRequestField()
Expand Down Expand Up @@ -191,6 +194,14 @@ private String getOrgIdCopyIfExists(CaseDetails caseDetails, String caseRole) {
return null;
}

private void setAddLegalRepDeadlinesToNull(CaseData.CaseDataBuilder<?, ?> updatedCaseDataBuilder, String caseRole) {
if (CaseRole.RESPONDENTSOLICITORONE.getFormattedName().equals(caseRole)) {
updatedCaseDataBuilder.addLegalRepDeadlineRes1(null);
} else if (CaseRole.RESPONDENTSOLICITORTWO.getFormattedName().equals(caseRole)) {
updatedCaseDataBuilder.addLegalRepDeadlineRes2(null);
}
}

private String getFormerEmail(String caseRole, CaseData caseData) {
if (caseRole.equals(CaseRole.APPLICANTSOLICITORONE.getFormattedName())) {
return caseData.getApplicantSolicitor1UserDetails().getEmail();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ private CallbackResponse submitClaim(CallbackParams callbackParams) {
updatedCaseData = caseData.toBuilder()
.businessProcess(BusinessProcess.ready(NOTIFY_DEFENDANT_OF_CLAIM_DETAILS))
.claimDetailsNotificationDate(currentDateTime)
.addLegalRepDeadlineRes1(deadlinesCalculator.plus14DaysDeadline(notificationDateTime))
.addLegalRepDeadlineRes2(deadlinesCalculator.plus14DaysDeadline(notificationDateTime))
.respondent1ResponseDeadline(deadlinesCalculator.plus14DaysAt4pmDeadline(notificationDateTime))
.respondent2ResponseDeadline(deadlinesCalculator.plus14DaysAt4pmDeadline(notificationDateTime))
.nextDeadline(deadlinesCalculator.plus14DaysAt4pmDeadline(notificationDateTime).toLocalDate())
Expand Down Expand Up @@ -164,12 +166,25 @@ private CallbackResponse submitClaim(CallbackParams callbackParams) {
builder.respondent1ResponseDeadline(
deadlinesCalculator.plus14DaysAt4pmDeadline(notificationDateTime));
}

if (Objects.nonNull(caseData.getRespondent1())
&& NO.equals(caseData.getRespondent1Represented())) {
builder.addLegalRepDeadlineRes1(deadlinesCalculator.plus14DaysDeadline(notificationDateTime));
}

if (Objects.nonNull(caseData.getRespondent2())
&& YES.equals(caseData.getAddRespondent2())) {
builder.respondent2ResponseDeadline(
deadlinesCalculator.plus14DaysAt4pmDeadline(notificationDateTime));
}
if (areAnyRespondentsLitigantInPerson(caseData)) {

if (Objects.nonNull(caseData.getRespondent2())
&& YES.equals(caseData.getAddRespondent2())
&& NO.equals(caseData.getRespondent2Represented())) {
builder.addLegalRepDeadlineRes2(deadlinesCalculator.plus14DaysDeadline(notificationDateTime));
}

if (areAnyRespondentsLitigantInPerson(caseData)) {
if (Objects.nonNull(caseData.getCosNotifyClaimDetails1())) {
builder
.cosNotifyClaimDetails1(updateStatementOfTruthForLip(caseData.getCosNotifyClaimDetails1()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ public void takeCaseOffline(TakeCaseOfflineEvent event) {
}

private CaseDataContent getCaseContent(CaseData caseData, StartEventResponse startEventResponse) {
String rpaReason = "RPA Reason: Claim dismissed after no response from applicant past response deadline.";
if (caseData.getAddLegalRepDeadlineRes1() != null || caseData.getAddLegalRepDeadlineRes2() != null) {
rpaReason = "RPA Reason: No Defendant Solicitor appointed.";
}
return CaseDataContent.builder()
.eventToken(startEventResponse.getToken())
.event(Event.builder()
.id(startEventResponse.getEventId())
.summary("RPA Reason: Claim dismissed after no response from applicant past response deadline.")
.summary(rpaReason)
.build())
.data(new HashMap<>(startEventResponse.getCaseDetails().getData()))
.build();
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/uk/gov/hmcts/reform/civil/model/CaseData.java
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,8 @@ public boolean hasNoOngoingBusinessProcess() {
private final LocalDateTime claimDetailsNotificationDate;
private final LocalDateTime respondent1ResponseDeadline;
private final LocalDateTime respondent2ResponseDeadline;
private final LocalDateTime addLegalRepDeadlineRes1;
private final LocalDateTime addLegalRepDeadlineRes2;
private final LocalDateTime claimDismissedDeadline;
private final LocalDateTime respondent1TimeExtensionDate;
private final LocalDateTime respondent2TimeExtensionDate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static org.elasticsearch.index.query.QueryBuilders.matchQuery;
import static org.elasticsearch.index.query.QueryBuilders.rangeQuery;
import static uk.gov.hmcts.reform.civil.enums.CaseState.AWAITING_APPLICANT_INTENTION;
import static uk.gov.hmcts.reform.civil.enums.CaseState.AWAITING_RESPONDENT_ACKNOWLEDGEMENT;

@Service
public class TakeCaseOfflineSearchService extends ElasticSearchService {
Expand All @@ -26,7 +27,13 @@ public Query query(int startIndex) {
.minimumShouldMatch(1)
.should(boolQuery()
.must(rangeQuery("data.applicant1ResponseDeadline").lt("now"))
.must(beState(AWAITING_APPLICANT_INTENTION))),
.must(beState(AWAITING_APPLICANT_INTENTION)))
.should(boolQuery()
.must(rangeQuery("data.addLegalRepDeadlineRes1").lt("now"))
.must(beState(AWAITING_RESPONDENT_ACKNOWLEDGEMENT)))
.should(boolQuery()
.must(rangeQuery("data.addLegalRepDeadlineRes2").lt("now"))
.must(beState(AWAITING_RESPONDENT_ACKNOWLEDGEMENT))),
List.of("reference"),
startIndex
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ protected Query buildQuery(int fromValue) {
BoolQueryBuilder query = boolQuery()
.minimumShouldMatch(1)
.should(boolQuery()
.must(rangeQuery("data.applicant1ResponseDeadline").lt("now"))
.must(boolQuery().must(matchQuery("state", "AWAITING_APPLICANT_INTENTION"))));
.must(rangeQuery("data.applicant1ResponseDeadline").lt("now"))
.must(boolQuery().must(matchQuery("state", "AWAITING_APPLICANT_INTENTION"))))
.should(boolQuery()
.must(rangeQuery("data.addLegalRepDeadlineRes1").lt("now"))
.must(boolQuery().must(matchQuery("state", "AWAITING_RESPONDENT_ACKNOWLEDGEMENT"))))
.should(boolQuery()
.must(rangeQuery("data.addLegalRepDeadlineRes2").lt("now"))
.must(boolQuery().must(matchQuery("state", "AWAITING_RESPONDENT_ACKNOWLEDGEMENT"))));

return new Query(query, List.of("reference"), fromValue);
}
Expand Down

0 comments on commit a819b2f

Please sign in to comment.