Skip to content

Commit

Permalink
CIV-11603 Fast Track Claimant Intent (#3720)
Browse files Browse the repository at this point in the history
* CIV-11571 Fix court location if no specific court (#3569)

* CIV-11571: Add null checking

* CIV-11571: Add unit test

---------

Co-authored-by: jarekPierchala <[email protected]>

* CIV-8241 Manual Determination - Lip Notifications (#3529)

* added changes for claimant response cui event.

* CIV-8291 : Functional code - Need to refactor

* CIV-8291 : Refactor duplicated methods to a common service

* CIV-8291 : Handler Test

* CIV-8291 : Fix checkStyle

* CIV-8291 : Fix checkStyle

* CIV-8291 : Adding mocks

* CIV-8291 : Adding mocks

* CIV-8291 : Adding mocks

* CIV-8291 : Change final state to PROCEEDS_IN_HERITAGE_SYSTEM

* CIV-8291 : Dev comments

* CIV-8291 : Dev comments

* CIV-8291 : Dev comments

* CIV-8291 : Dev comments

* CIV-8241: Set Up Notification

* CIV-8241: Set Up Notification

* CIV-8241: Set Up Notification

* CIV-8241: Set Up Notification

* CIV-8241: Set Up Notification

* CIV-8241: Set Up Notification Test

* CIV-8241: Set Up Notification Test

* CIV-8241: Roll back one line

* CIV-8241: Change method name

* Update build.gradle

* Update build.gradle

---------

Co-authored-by: neeta-hmcts <[email protected]>
Co-authored-by: sankhajuria <[email protected]>
Co-authored-by: hmcts-version1-pablo <[email protected]>
Co-authored-by: Pablo Ortiz <[email protected]>
Co-authored-by: Raja Mani <[email protected]>
Co-authored-by: jarekPierchala <[email protected]>

* CIV-10727 Assisted order uplift (#3550)

* CIV-11158 Save hearing location in case data
* Added setting assisted order courtLocation to hearingLocation or caseManagementLocation is hearingLocation is not defined
* Fixed not filtering courtLocations by caseTypeId
---------

Co-authored-by: sankaviv1 <[email protected]>
Co-authored-by: sankaviv1 <[email protected]>
Co-authored-by: GarethLancaster <[email protected]>
Co-authored-by: douglasrice <[email protected]>

* CIV-11695 - Update ClaimantResponseCuiCallbackHandler.java (#3616)

* Update ClaimantResponseCuiCallbackHandler.java

* fix for judicial referral

* fixed claim state issue and unit tests.

---------

Co-authored-by: neeta-hmcts <[email protected]>
Co-authored-by: neeta-hmcts <[email protected]>
Co-authored-by: Pablo Ortiz <[email protected]>
Co-authored-by: annika-moorthy <[email protected]>

* CIV-8905 Claimant Dashboard Status "Mediation E2E, Manual Determination (org), ITP failed" (#3564)

* CIV-8905 Added functionality for dashboard status

* CIV-8905 Added functionality for dashboard status

* CIV-8905 Fixed AC 4

* CIV-11363 add trigger event (#3633)

* CIV-11363 add trigger event

* CIV-8905 Merged with bulk_tasks

---------

Co-authored-by: Pablo Ortiz <[email protected]>
Co-authored-by: MMNycz <[email protected]>

* CIV-8454 Trigger service request after CCD case creation (#3597)

* CIV-8454 Trigger service request after CCD case creation

* CIV-8454 Move Service Request creation to Camunda

* CIV-8454 Undo flow state change - not required

* CIV-8454 Remove empty lines

* CIV-8454 Add test for service request handler CUI

* CIV-8454 Only create service request when no help with fees

* CIV-8454 Change event name

* CIV-11144 updated witness summary to add date (#3623)

* updated witness summary to add date

* Update Jenkinsfile_CNP point at CCD

* Update Jenkinsfile_CNP

* CIV-11363 add caseId to caseIdForRetrigger.txt (#3646)

* CIV-11363 add caseId to caseIdForRetrigger.txt

* adding not suitable for sdo too

* update caseIdForRetriger

---------

Co-authored-by: Astha Malviya <[email protected]>

* testing master build (#3650)

Co-authored-by: sankhajuria <[email protected]>

---------

Co-authored-by: Raja Mani <[email protected]>
Co-authored-by: drummondjm <[email protected]>
Co-authored-by: MMNycz <[email protected]>
Co-authored-by: Astha Malviya <[email protected]>
Co-authored-by: asthamalviya <[email protected]>
Co-authored-by: sankhajuria <[email protected]>
Co-authored-by: jarekPierchala <[email protected]>

* CIV-11603 Set Up Case State

* CIV-11603 Set Up Translation

* CIV-11603 Update Mediation Check

* CIV-11603 Remove unused import

* CIV-11603 Update Unit Test

* CIV-11603 Adding more unit test

* CIV-11603 Update from review

* CIV-11603 Merged with master

---------

Co-authored-by: jarekPierchala <[email protected]>
Co-authored-by: jarekPierchala <[email protected]>
Co-authored-by: neeta-hmcts <[email protected]>
Co-authored-by: sankhajuria <[email protected]>
Co-authored-by: hmcts-version1-pablo <[email protected]>
Co-authored-by: Pablo Ortiz <[email protected]>
Co-authored-by: Raja Mani <[email protected]>
Co-authored-by: Gareth Lancaster <[email protected]>
Co-authored-by: sankaviv1 <[email protected]>
Co-authored-by: sankaviv1 <[email protected]>
Co-authored-by: GarethLancaster <[email protected]>
Co-authored-by: douglasrice <[email protected]>
Co-authored-by: jeswanth-hmcts <[email protected]>
Co-authored-by: neeta-hmcts <[email protected]>
Co-authored-by: annika-moorthy <[email protected]>
Co-authored-by: marianadpereira <[email protected]>
Co-authored-by: Manish Garg <[email protected]>
Co-authored-by: MMNycz <[email protected]>
Co-authored-by: Paul Pearson <[email protected]>
Co-authored-by: drummondjm <[email protected]>
Co-authored-by: Astha Malviya <[email protected]>
Co-authored-by: asthamalviya <[email protected]>
Co-authored-by: Harry H <[email protected]>
Co-authored-by: marianadpereira <[email protected]>
  • Loading branch information
25 people authored Jan 4, 2024
1 parent d541fcc commit e353c9f
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,25 +93,11 @@ private CallbackResponse aboutToSubmit(CallbackParams callbackParams) {
AboutToStartOrSubmitCallbackResponse.builder()
.data(updatedData.toMap(objectMapper));

updateClaimStateJudicialReferral(response, updatedData);
updateClaimEndState(response, updatedData);

return response.build();
}

private void updateClaimStateJudicialReferral(
AboutToStartOrSubmitCallbackResponse.AboutToStartOrSubmitCallbackResponseBuilder response,
CaseData caseData) {
if (isJudicialReferralAllowed(caseData)) {
response.state(CaseState.JUDICIAL_REFERRAL.name());
}
}

private boolean isJudicialReferralAllowed(CaseData caseData) {
return (caseData.isClaimantNotSettlePartAdmitClaim() || caseData.isFullDefence())
&& (Objects.nonNull(caseData.getCaseDataLiP()) && caseData.getCaseDataLiP().hasClaimantNotAgreedToFreeMediation());
}

private boolean isProceedsInHeritageSystemAllowed(CaseData caseData) {
ClaimantLiPResponse applicant1Response = Optional.ofNullable(caseData.getCaseDataLiP())
.map(CaseDataLiP::getApplicant1LiPResponse)
Expand All @@ -134,17 +120,21 @@ private boolean isProceedsInHeritageSystemAllowed(CaseData caseData) {
|| isCourtDecisionRejected;
}

private void updateClaimEndState(AboutToStartOrSubmitCallbackResponse.AboutToStartOrSubmitCallbackResponseBuilder response, CaseData updatedData) {
if (updatedData.hasDefendantAgreedToFreeMediation() && updatedData.hasClaimantAgreedToFreeMediation()) {
response.state(CaseState.IN_MEDIATION.name());
private String setUpCaseState(AboutToStartOrSubmitCallbackResponse.AboutToStartOrSubmitCallbackResponseBuilder response, CaseData updatedData) {
if (isJudicialReferralAllowed(updatedData)) {
return CaseState.JUDICIAL_REFERRAL.name();
} else if (updatedData.hasDefendantAgreedToFreeMediation() && updatedData.hasClaimantAgreedToFreeMediation()) {
return CaseState.IN_MEDIATION.name();
} else if (updatedData.hasApplicant1SignedSettlementAgreement() && updatedData.hasApplicantAcceptedRepaymentPlan()) {
response.state(CaseState.All_FINAL_ORDERS_ISSUED.name());
return CaseState.All_FINAL_ORDERS_ISSUED.name();
} else if (Objects.nonNull(updatedData.getApplicant1PartAdmitIntentionToSettleClaimSpec()) && updatedData.isClaimantIntentionSettlePartAdmit()) {
response.state(CaseState.CASE_SETTLED.name());
return CaseState.CASE_SETTLED.name();
} else if (updatedData.hasApplicantNotProceededWithClaim()) {
response.state(CaseState.CASE_DISMISSED.name());
return CaseState.CASE_DISMISSED.name();
} else if (isProceedsInHeritageSystemAllowed(updatedData)) {
response.state(CaseState.PROCEEDS_IN_HERITAGE_SYSTEM.name());
return CaseState.PROCEEDS_IN_HERITAGE_SYSTEM.name();
} else {
return response.build().getState();
}
}

Expand All @@ -159,4 +149,23 @@ private boolean hasCcjRequest(CaseData caseData) {
return (caseData.isLipvLipOneVOne() && featureToggleService.isLipVLipEnabled()
&& caseData.hasApplicant1AcceptedCcj() && caseData.isCcjRequestJudgmentByAdmission());
}

private boolean isJudicialReferralAllowed(CaseData caseData) {
return isProceedOrNotSettleClaim(caseData)
&& (isClaimantOrDefendantRejectMediation(caseData)
|| caseData.isFastTrackClaim());
}

private boolean isProceedOrNotSettleClaim(CaseData caseData) {
return caseData.isClaimantNotSettlePartAdmitClaim() || caseData.isFullDefence() || caseData.isFullDefenceNotPaid();
}

private boolean isClaimantOrDefendantRejectMediation(CaseData caseData) {
return (Objects.nonNull(caseData.getCaseDataLiP()) && caseData.getCaseDataLiP().hasClaimantNotAgreedToFreeMediation())
|| caseData.hasDefendantNotAgreedToFreeMediation();
}

private void updateClaimEndState(AboutToStartOrSubmitCallbackResponse.AboutToStartOrSubmitCallbackResponseBuilder response, CaseData updatedData) {
response.state(setUpCaseState(response, updatedData));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ private CaseData getUpdatedCaseData(CallbackParams callbackParams) {
.respondent1ResponseDate(responseDate)
.respondent1GeneratedResponseDocument(dummyDocument)
.respondent1ClaimResponseDocumentSpec(dummyDocument)
.responseClaimTrack(AllocatedTrack.getAllocatedTrack(caseData.getTotalClaimAmount(), null).name())
.applicant1ResponseDeadline(deadlinesCalculator.calculateApplicantResponseDeadline(
responseDate,
allocatedTrack
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@

import static java.math.BigDecimal.ZERO;
import static java.util.Optional.ofNullable;
import static uk.gov.hmcts.reform.civil.enums.YesOrNo.NO;
import static uk.gov.hmcts.reform.civil.enums.YesOrNo.YES;

@Jacksonized
Expand Down Expand Up @@ -411,6 +412,7 @@ public class CaseDataParent implements MappableObject {
*/
private final ResponseOneVOneShowTag showResponseOneVOneFlag;
private final YesOrNo applicant1AcceptAdmitAmountPaidSpec;
private final YesOrNo applicant1FullDefenceConfirmAmountPaidSpec;
private final YesOrNo applicant1PartAdmitConfirmAmountPaidSpec;
private final YesOrNo applicant1PartAdmitIntentionToSettleClaimSpec;
private final YesOrNo applicant1AcceptFullAdmitPaymentPlanSpec;
Expand All @@ -435,7 +437,7 @@ public class CaseDataParent implements MappableObject {

@JsonIgnore
public boolean isApplicantNotRepresented() {
return this.applicant1Represented == YesOrNo.NO;
return this.applicant1Represented == NO;
}

/**
Expand Down Expand Up @@ -810,4 +812,10 @@ public String getHearingLocationText() {
.map(DynamicListElement::getLabel)
.orElse(null);
}

@JsonIgnore
public boolean isFullDefenceNotPaid() {
return NO.equals(getApplicant1FullDefenceConfirmAmountPaidSpec());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
import static uk.gov.hmcts.reform.civil.callback.CallbackType.ABOUT_TO_START;
import static uk.gov.hmcts.reform.civil.callback.CallbackType.ABOUT_TO_SUBMIT;
import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CLAIMANT_RESPONSE_CUI;
import static uk.gov.hmcts.reform.civil.enums.AllocatedTrack.FAST_CLAIM;
import static uk.gov.hmcts.reform.civil.enums.YesOrNo.NO;
import static uk.gov.hmcts.reform.civil.enums.YesOrNo.YES;
import static uk.gov.hmcts.reform.civil.model.Party.Type.COMPANY;
Expand Down Expand Up @@ -253,6 +254,21 @@ void shouldUpdateCaseStateToJudicialReferral_WhenFullDefence_NotPaid_NoMediation

}

@Test
void shouldUpdateCaseStateToJudicialReferral_WhenFullDefence_NotPaid_FastTrack() {

CaseData caseData =
CaseDataBuilder.builder().applicant1PartAdmitIntentionToSettleClaimSpec(NO)
.responseClaimTrack(FAST_CLAIM.name())
.atStateClaimIssued()
.build();
CallbackParams params = callbackParamsOf(caseData, ABOUT_TO_SUBMIT);

var response = (AboutToStartOrSubmitCallbackResponse) handler.handle(params);
assertEquals(CaseState.JUDICIAL_REFERRAL.name(), response.getState());

}

@Test
void shouldUpdateCaseStateToJudicialReferral_WhenFullDefence() {
CaseDataLiP caseDataLiP = CaseDataLiP.builder()
Expand All @@ -269,6 +285,21 @@ void shouldUpdateCaseStateToJudicialReferral_WhenFullDefence() {
assertEquals(CaseState.JUDICIAL_REFERRAL.name(), response.getState());
}

@Test
void shouldUpdateCaseStateToCaseDismissed_WhenFullDefence_FastTrack() {

CaseData caseData =
CaseDataBuilder.builder().applicant1ProceedWithClaim(NO)
.responseClaimTrack(FAST_CLAIM.name())
.atStateClaimIssued()
.build();
CallbackParams params = callbackParamsOf(caseData, ABOUT_TO_SUBMIT);

var response = (AboutToStartOrSubmitCallbackResponse) handler.handle(params);
assertEquals(CaseState.CASE_DISMISSED.name(), response.getState());

}

@Test
void shouldOnlyUpdateClaimStatus_whenPartAdmitNotSettled_NoMediation_NoBaseCourt() {
Applicant1DQ applicant1DQ =
Expand Down Expand Up @@ -608,6 +639,21 @@ void shouldUpdateCCJRequestPaymentDetails() {
private CaseData getCaseData(AboutToStartOrSubmitCallbackResponse response) {
return mapper.convertValue(response.getData(), CaseData.class);
}

@Test
void shouldChangeCaseState_whenApplicantAgreeClaimSettlement() {
CaseData caseData = CaseDataBuilder.builder()
.atStateClaimIssued()
.applicant1PartAdmitIntentionToSettleClaimSpec(YES)
.applicant1PartAdmitConfirmAmountPaidSpec(YES)
.build().toBuilder()
.responseClaimMediationSpecRequired(YES).build();

CallbackParams params = callbackParamsOf(caseData, ABOUT_TO_SUBMIT);
var response = (AboutToStartOrSubmitCallbackResponse) handler.handle(params);

assertThat(response.getState()).isEqualTo(CaseState.CASE_SETTLED.name());
}
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import uk.gov.hmcts.reform.civil.service.DeadlinesCalculator;
import uk.gov.hmcts.reform.civil.service.Time;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -83,6 +84,7 @@ void setup() {
void shouldUpdateBusinessProcessAndClaimStatus_whenDefendantResponseLangIsEnglish() {
CaseData caseData = CaseDataBuilder.builder()
.atStateClaimIssued()
.totalClaimAmount(BigDecimal.valueOf(5000))
.caseDataLip(CaseDataLiP.builder().respondent1LiPResponse(RespondentLiPResponse.builder().respondent1ResponseLanguage("ENGLISH").build()).build())
.build();

Expand All @@ -105,6 +107,7 @@ void shouldUpdateBusinessProcessAndClaimStatus_whenDefendantResponseLangIsEnglis
void shouldOnlyUpdateClaimStatus_whenDefendantResponseLangIsBilingual() {
CaseData caseData = CaseDataBuilder.builder()
.atStateClaimIssued()
.totalClaimAmount(BigDecimal.valueOf(5000))
.caseDataLip(CaseDataLiP.builder().respondent1LiPResponse(RespondentLiPResponse.builder().respondent1ResponseLanguage("BOTH").build()).build())
.build();
CallbackParams params = callbackParamsOf(caseData, ABOUT_TO_SUBMIT);
Expand Down

0 comments on commit e353c9f

Please sign in to comment.