Skip to content

Commit

Permalink
CIV-15868 COR all order issued screen (#5897)
Browse files Browse the repository at this point in the history
Co-authored-by: mounikahmcts <[email protected]>
Co-authored-by: ss-evoco <[email protected]>
  • Loading branch information
3 people authored Dec 13, 2024
1 parent b046dcd commit c3da368
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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();
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 @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c3da368

Please sign in to comment.