Skip to content

Commit

Permalink
CIV-15042 CLAIMANT_RESPONSE_SPEC modify and use already created Camun…
Browse files Browse the repository at this point in the history
…da BPMN LR vs LR (#5396)

* CIV-15042 Update service and unit Test

* CIV-15042 Update service and unit Test

* CIV-15042 Sonar fix

* CIV-15042 Sonar fix

* CIV-15042 Sonar fix

* CIV-15042 Sonar fix

* CIV-15042 Sonar fix

* CIV-15042 Sonar fix

* CIV-15042 RespondToDefenceSpecCallbackHandler refactor

* CIV-15042 RespondToDefenceSpecCallbackHandler refactor

* CIV-15042 Comments related the checks to review NonDivergent Scenario

* CIV-15042 Style fixes

* CIV-15042 delete not

* CIV-15042 delete not

* CIV-15042 fix for one condition

* CIV-15042 Refactor one of the conditions.

* CIV-15042 Refactor one of the conditions.

* updated code for only 1v1

* readd test

* fixed 1v1 scenario

* set pay immediately cases to new state after claimant response

* added jo online flag

---------

Co-authored-by: Azam <[email protected]>
Co-authored-by: Sherlyn Khaw <[email protected]>
Co-authored-by: sherlynkhaw <[email protected]>
  • Loading branch information
4 people authored Oct 8, 2024
1 parent 23e5328 commit 19d7e63
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import static uk.gov.hmcts.reform.civil.callback.CallbackType.SUBMITTED;
import static uk.gov.hmcts.reform.civil.callback.CaseEvent.JUDGEMENT_BY_ADMISSION_NON_DIVERGENT_SPEC;
import static uk.gov.hmcts.reform.civil.callback.CaseEvent.REQUEST_JUDGEMENT_ADMISSION_SPEC;
import static uk.gov.hmcts.reform.civil.enums.MultiPartyScenario.isOneVOne;

@Service
@RequiredArgsConstructor
Expand Down Expand Up @@ -106,7 +107,7 @@ private CallbackResponse updateBusinessProcessToReady(CallbackParams callbackPar
data.getCcjPaymentDetails();

if (featureToggleService.isJudgmentOnlineLive()
&& JudgmentsOnlineHelper.isNonDivergentForDJ(data)
&& isOneVOne(data)
&& data.isPayImmediately()) {

nextState = CaseState.All_FINAL_ORDERS_ISSUED.name();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CLAIMANT_RESPONSE_SPEC;
import static uk.gov.hmcts.reform.civil.callback.CaseEvent.JUDGEMENT_BY_ADMISSION_NON_DIVERGENT_SPEC;
import static uk.gov.hmcts.reform.civil.enums.MultiPartyScenario.isOneVOne;
import static uk.gov.hmcts.reform.civil.enums.RespondentResponsePartAdmissionPaymentTimeLRspec.IMMEDIATELY;
import static uk.gov.hmcts.reform.civil.utils.CaseStateUtils.shouldMoveToInMediationState;

@Component
Expand Down Expand Up @@ -46,6 +47,8 @@ && isOneVOne(caseData)) {
Pair<String, BusinessProcess> result = handleAcceptedRepaymentPlan(caseData, builder, businessProcess);
nextState = result.getLeft();
businessProcess = result.getRight();
} else if (isDefenceAdmitPayImmediately(caseData)) {
nextState = CaseState.All_FINAL_ORDERS_ISSUED.name();
} else if (caseData.hasApplicantRejectedRepaymentPlan()) {
nextState = CaseState.PROCEEDS_IN_HERITAGE_SYSTEM.name();
} else if (isClaimNotSettled(caseData)) {
Expand All @@ -67,6 +70,11 @@ && isOneVOne(caseData)) {
return nextState;
}

private boolean isDefenceAdmitPayImmediately(CaseData caseData) {
return featureToggleService.isJudgmentOnlineLive()
&& IMMEDIATELY.equals(caseData.getDefenceAdmitPartPaymentTimeRouteRequired());
}

private static boolean isClaimNotSettled(CaseData caseData) {
return caseData.isClaimantNotSettlePartAdmitClaim()
&& ((caseData.hasClaimantNotAgreedToFreeMediation()
Expand All @@ -85,11 +93,9 @@ private Pair<String, BusinessProcess> handleAcceptedRepaymentPlan(CaseData caseD
BusinessProcess businessProcess) {
String nextState;
if (featureToggleService.isJudgmentOnlineLive()
&& (caseData.isPayByInstallment() || caseData.isPayBySetDate())
&& caseData.isLRvLipOneVOne()) {
&& (caseData.isPayByInstallment() || caseData.isPayBySetDate())) {
nextState = CaseState.All_FINAL_ORDERS_ISSUED.name();
businessProcess = BusinessProcess.ready(JUDGEMENT_BY_ADMISSION_NON_DIVERGENT_SPEC);

} else {
nextState = CaseState.PROCEEDS_IN_HERITAGE_SYSTEM.name();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ void shouldChangeCaseState_WhenRespondentRepaymentPlanAndFlagV2WithJudgementLive
}

@Test
void shouldChangeCaseState_WhenRespondentRepaymentPlanAndFlagV2WithJudgementLiveAndNotLrVLiP() {
void shouldChangeCaseState_WhenRespondentRepaymentPlanAndFlagV2WithJudgementLiveAndLrVLr() {
given(featureToggleService.isPinInPostEnabled()).willReturn(true);
given(featureToggleService.isJudgmentOnlineLive()).willReturn(true);
CCJPaymentDetails ccjPaymentDetails = CCJPaymentDetails.builder()
Expand Down Expand Up @@ -1413,7 +1413,7 @@ void shouldChangeCaseState_WhenRespondentRepaymentPlanAndFlagV2WithJudgementLive
AboutToStartOrSubmitCallbackResponse response = (AboutToStartOrSubmitCallbackResponse) handler
.handle(params);
assertThat(response.getState())
.isEqualTo(CaseState.PROCEEDS_IN_HERITAGE_SYSTEM.name());
.isEqualTo(CaseState.All_FINAL_ORDERS_ISSUED.name());
}

@Test
Expand Down

0 comments on commit 19d7e63

Please sign in to comment.