From c3da368be19953e0f72a022917e5fa98261096c8 Mon Sep 17 00:00:00 2001 From: Miguel Molina <93722947+miguelMolina3691@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:24:27 +0000 Subject: [PATCH] CIV-15868 COR all order issued screen (#5897) Co-authored-by: mounikahmcts <43175082+mounikahmcts@users.noreply.github.com> Co-authored-by: ss-evoco <94355434+ss-evoco@users.noreply.github.com> --- .../user/ConfirmOrderReviewCallbackHandler.java | 8 ++++++++ .../uk/gov/hmcts/reform/civil/model/CaseData.java | 2 ++ .../ConfirmOrderReviewCallbackHandlerTest.java | 15 +++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/ConfirmOrderReviewCallbackHandler.java b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/ConfirmOrderReviewCallbackHandler.java index 86f14590aba..fbcefac62af 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/ConfirmOrderReviewCallbackHandler.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/handler/callback/user/ConfirmOrderReviewCallbackHandler.java @@ -10,6 +10,7 @@ import uk.gov.hmcts.reform.civil.callback.CallbackHandler; import uk.gov.hmcts.reform.civil.callback.CallbackParams; import uk.gov.hmcts.reform.civil.callback.CaseEvent; +import uk.gov.hmcts.reform.civil.enums.CaseState; import uk.gov.hmcts.reform.civil.enums.YesOrNo; import uk.gov.hmcts.reform.civil.model.CaseData; import uk.gov.hmcts.reform.civil.service.FeatureToggleService; @@ -93,6 +94,13 @@ private CallbackResponse confirmOrderReview(CallbackParams callbackParams) { .courtStaffNextSteps(null) .build(); + if (YesOrNo.YES.equals(caseData.getIsFinalOrder())) { + return AboutToStartOrSubmitCallbackResponse.builder() + .data(updatedCaseData.toMap(objectMapper)) + .state(CaseState.All_FINAL_ORDERS_ISSUED.toString()) + .build(); + } + return AboutToStartOrSubmitCallbackResponse.builder() .data(updatedCaseData.toMap(objectMapper)) .build(); diff --git a/src/main/java/uk/gov/hmcts/reform/civil/model/CaseData.java b/src/main/java/uk/gov/hmcts/reform/civil/model/CaseData.java index 6f737b12905..3c16f84ad3d 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/model/CaseData.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/model/CaseData.java @@ -753,6 +753,8 @@ public boolean hasNoOngoingBusinessProcess() { //Caseworker events private YesOrNo obligationDatePresent; private CourtStaffNextSteps courtStaffNextSteps; + private YesOrNo isFinalOrder; + private SendAndReplyOption sendAndReplyOption; private SendMessageMetadata sendMessageMetadata; private String sendMessageContent; diff --git a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/ConfirmOrderReviewCallbackHandlerTest.java b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/ConfirmOrderReviewCallbackHandlerTest.java index 2aace24ac4e..c6c58cf1e7d 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/ConfirmOrderReviewCallbackHandlerTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/handler/callback/user/ConfirmOrderReviewCallbackHandlerTest.java @@ -11,6 +11,7 @@ import uk.gov.hmcts.reform.ccd.client.model.AboutToStartOrSubmitCallbackResponse; import uk.gov.hmcts.reform.ccd.client.model.SubmittedCallbackResponse; import uk.gov.hmcts.reform.civil.callback.CallbackParams; +import uk.gov.hmcts.reform.civil.enums.CaseState; import uk.gov.hmcts.reform.civil.enums.CourtStaffNextSteps; import uk.gov.hmcts.reform.civil.enums.YesOrNo; import uk.gov.hmcts.reform.civil.handler.callback.BaseCallbackHandlerTest; @@ -135,6 +136,20 @@ void shouldReturnEmptyResponse_whenInvoked() { assertThat(response).isEqualTo(AboutToStartOrSubmitCallbackResponse.builder().build()); } + + @Test + void shouldSetAllFinalOrdersIssuedState_whenIsFinalOrder() { + Mockito.when(toggleService.isCaseEventsEnabled()).thenReturn(true); + CaseData caseData = CaseData.builder() + .isFinalOrder(YesOrNo.YES) + .build(); + + CallbackParams params = callbackParamsOf(caseData, ABOUT_TO_SUBMIT); + + var response = (AboutToStartOrSubmitCallbackResponse) handler.handle(params); + + assertThat(response.getState()).isEqualTo(CaseState.All_FINAL_ORDERS_ISSUED.name()); + } } @Nested