From 9557ac3d429d91ef26f3d53cb0e22cdebbf1eab5 Mon Sep 17 00:00:00 2001 From: dtortolaV1 <93722198+dtortolaV1@users.noreply.github.com> Date: Mon, 6 Nov 2023 11:39:31 +0100 Subject: [PATCH] CIV-10437 spec and unspec can add notes to offline cases (#3484) * CIV-10437 spec and unspec can add notes to offline cases * CIV-10437 spec and unspec can add notes to offline cases * CIV-10437 spec and unspec can add notes to offline cases --------- Co-authored-by: kdaHMCTS <128375235+kdaHMCTS@users.noreply.github.com> --- .../FlowStateAllowedEventService.java | 118 ++++++++++++++---- .../FlowStateAllowedEventServiceTest.java | 2 + 2 files changed, 96 insertions(+), 24 deletions(-) diff --git a/src/main/java/uk/gov/hmcts/reform/civil/service/flowstate/FlowStateAllowedEventService.java b/src/main/java/uk/gov/hmcts/reform/civil/service/flowstate/FlowStateAllowedEventService.java index f38fd3c46ce..2b39e00bdd3 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/service/flowstate/FlowStateAllowedEventService.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/service/flowstate/FlowStateAllowedEventService.java @@ -6,7 +6,6 @@ import uk.gov.hmcts.reform.civil.callback.CaseEvent; import uk.gov.hmcts.reform.civil.helpers.CaseDetailsConverter; import uk.gov.hmcts.reform.civil.model.CaseData; -import uk.gov.hmcts.reform.civil.service.FeatureToggleService; import uk.gov.hmcts.reform.civil.stateflow.StateFlow; import java.util.List; @@ -29,68 +28,69 @@ import static uk.gov.hmcts.reform.civil.callback.CaseEvent.APPLICATION_OFFLINE_UPDATE_CLAIM; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.APPLY_NOC_DECISION; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.BUNDLE_CREATION_NOTIFICATION; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.LIP_CLAIM_SETTLED; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CLAIMANT_RESPONSE_CUI; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CREATE_CLAIM_SPEC_AFTER_PAYMENT; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CREATE_CLAIM_AFTER_PAYMENT; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CASE_PROCEEDS_IN_CASEMAN; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CHANGE_SOLICITOR_EMAIL; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CLAIMANT_RESPONSE; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CLAIMANT_RESPONSE_CUI; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CLAIMANT_RESPONSE_SPEC; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CREATE_CLAIM; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CREATE_CLAIM_AFTER_PAYMENT; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CREATE_CLAIM_SPEC; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CREATE_CLAIM_SPEC_AFTER_PAYMENT; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CREATE_LIP_CLAIM; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.CREATE_SDO; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.DEFAULT_JUDGEMENT; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.MANAGE_CONTACT_INFORMATION; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.NOTIFY_HEARING_PARTIES; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.REQUEST_JUDGEMENT_ADMISSION_SPEC; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.DEFAULT_JUDGEMENT_SPEC; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.DEFENDANT_RESPONSE; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.DEFENDANT_RESPONSE_CUI; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.DEFENDANT_RESPONSE_SPEC; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.DISCONTINUE_CLAIM; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.DISMISS_CLAIM; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.ENTER_BREATHING_SPACE_SPEC; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.ENTER_BREATHING_SPACE_LIP; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.ENTER_BREATHING_SPACE_SPEC; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.EVIDENCE_UPLOAD_APPLICANT; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.EVIDENCE_UPLOAD_JUDGE; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.EVIDENCE_UPLOAD_RESPONDENT; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.EXTEND_RESPONSE_DEADLINE; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.HEARING_FEE_UNPAID; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.GENERATE_DIRECTIONS_ORDER; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.HEARING_FEE_PAID; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.HEARING_FEE_UNPAID; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.HEARING_SCHEDULED; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.INFORM_AGREED_EXTENSION_DATE; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.INFORM_AGREED_EXTENSION_DATE_SPEC; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.INITIATE_GENERAL_APPLICATION; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.JUDGMENT_PAID_IN_FULL; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.LIFT_BREATHING_SPACE_SPEC; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.LIP_CLAIM_SETTLED; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.MANAGE_CONTACT_INFORMATION; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.MEDIATION_SUCCESSFUL; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.MEDIATION_UNSUCCESSFUL; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.RESET_PIN; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.TRIAL_READINESS; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.UPLOAD_TRANSLATED_DOCUMENT; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.migrateCase; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.MOVE_TO_DECISION_OUTCOME; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.NOC_REQUEST; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.NOTIFY_DEFENDANT_CUI_FOR_DEADLINE_EXTENSION; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.NOTIFY_CLAIMANT_CUI_FOR_DEADLINE_EXTENSION; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.NOTIFY_DEFENDANT_CUI_FOR_DEADLINE_EXTENSION; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.NOTIFY_DEFENDANT_OF_CLAIM; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.NOTIFY_DEFENDANT_OF_CLAIM_DETAILS; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.NOTIFY_HEARING_PARTIES; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.NotSuitable_SDO; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.RECORD_JUDGMENT; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.REFER_TO_JUDGE; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.REQUEST_JUDGEMENT_ADMISSION_SPEC; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.RESET_PIN; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.RESUBMIT_CLAIM; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.SERVICE_REQUEST_RECEIVED; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.SET_ASIDE_JUDGMENT; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.STANDARD_DIRECTION_ORDER_DJ; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.TAKE_CASE_OFFLINE; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.TRIAL_READY_NOTIFICATION; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.TRANSFER_ONLINE_CASE; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.TRIAL_READINESS; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.TRIAL_READY_CHECK; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.GENERATE_DIRECTIONS_ORDER; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.TRIAL_READY_NOTIFICATION; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.UPLOAD_TRANSLATED_DOCUMENT; import static uk.gov.hmcts.reform.civil.callback.CaseEvent.WITHDRAW_CLAIM; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.SET_ASIDE_JUDGMENT; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.JUDGMENT_PAID_IN_FULL; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.RECORD_JUDGMENT; -import static uk.gov.hmcts.reform.civil.callback.CaseEvent.TRANSFER_ONLINE_CASE; -import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.PREPARE_FOR_HEARING_CONDUCT_HEARING; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.asyncStitchingComplete; +import static uk.gov.hmcts.reform.civil.callback.CaseEvent.migrateCase; +import static uk.gov.hmcts.reform.civil.enums.CaseCategory.SPEC_CLAIM; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.AWAITING_RESPONSES_FULL_DEFENCE_RECEIVED; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.AWAITING_RESPONSES_NOT_FULL_DEFENCE_RECEIVED; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.CLAIM_DETAILS_NOTIFIED; @@ -123,17 +123,18 @@ import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.PAST_CLAIM_DISMISSED_DEADLINE_AWAITING_CAMUNDA; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.PAST_CLAIM_NOTIFICATION_DEADLINE_AWAITING_CAMUNDA; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.PENDING_CLAIM_ISSUED_UNREPRESENTED_DEFENDANT; +import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.PREPARE_FOR_HEARING_CONDUCT_HEARING; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.RESPONDENT_RESPONSE_LANGUAGE_IS_BILINGUAL; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.SPEC_DRAFT; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.TAKEN_OFFLINE_AFTER_CLAIM_DETAILS_NOTIFIED; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.TAKEN_OFFLINE_AFTER_CLAIM_NOTIFIED; +import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.TAKEN_OFFLINE_AFTER_SDO; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.TAKEN_OFFLINE_BY_STAFF; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.TAKEN_OFFLINE_PAST_APPLICANT_RESPONSE_DEADLINE; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.TAKEN_OFFLINE_SDO_NOT_DRAWN; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.TAKEN_OFFLINE_UNREGISTERED_DEFENDANT; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.TAKEN_OFFLINE_UNREPRESENTED_DEFENDANT; import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.TAKEN_OFFLINE_UNREPRESENTED_UNREGISTERED_DEFENDANT; -import static uk.gov.hmcts.reform.civil.service.flowstate.FlowState.Main.TAKEN_OFFLINE_AFTER_SDO; @Service @RequiredArgsConstructor @@ -141,7 +142,6 @@ public class FlowStateAllowedEventService { private final StateFlowEngine stateFlowEngine; private final CaseDetailsConverter caseDetailsConverter; - private final FeatureToggleService toggleService; private static final Map> ALLOWED_EVENTS_ON_FLOW_STATE = Map.ofEntries( entry( @@ -1335,6 +1335,76 @@ public class FlowStateAllowedEventService { List.of( asyncStitchingComplete ) + ), + entry( + TAKEN_OFFLINE_BY_STAFF.fullName(), + List.of( + ADD_CASE_NOTE, + APPLICATION_OFFLINE_UPDATE_CLAIM, + migrateCase + ) + ), + entry( + TAKEN_OFFLINE_UNREGISTERED_DEFENDANT.fullName(), + List.of( + ADD_CASE_NOTE, + APPLICATION_OFFLINE_UPDATE_CLAIM, + migrateCase + ) + ), + entry( + TAKEN_OFFLINE_UNREPRESENTED_DEFENDANT.fullName(), + List.of( + ADD_CASE_NOTE, + APPLICATION_OFFLINE_UPDATE_CLAIM, + migrateCase + ) + ), + entry( + TAKEN_OFFLINE_UNREPRESENTED_UNREGISTERED_DEFENDANT.fullName(), + List.of( + ADD_CASE_NOTE, + APPLICATION_OFFLINE_UPDATE_CLAIM, + migrateCase + ) + ), + entry( + TAKEN_OFFLINE_PAST_APPLICANT_RESPONSE_DEADLINE.fullName(), + List.of( + ADD_CASE_NOTE, + APPLICATION_OFFLINE_UPDATE_CLAIM, + migrateCase + ) + ), + entry( + TAKEN_OFFLINE_AFTER_CLAIM_DETAILS_NOTIFIED.fullName(), + List.of( + ADD_CASE_NOTE, + APPLICATION_OFFLINE_UPDATE_CLAIM, + migrateCase + ) + ), + entry( + TAKEN_OFFLINE_AFTER_CLAIM_NOTIFIED.fullName(), + List.of( + ADD_CASE_NOTE, + APPLICATION_OFFLINE_UPDATE_CLAIM, + migrateCase + ) + ), + entry( + TAKEN_OFFLINE_SDO_NOT_DRAWN.fullName(), + List.of( + ADD_CASE_NOTE, + migrateCase + ) + ), + entry( + TAKEN_OFFLINE_AFTER_SDO.fullName(), + List.of( + ADD_CASE_NOTE, + AMEND_PARTY_DETAILS + ) ) ); diff --git a/src/test/java/uk/gov/hmcts/reform/civil/service/flowstate/FlowStateAllowedEventServiceTest.java b/src/test/java/uk/gov/hmcts/reform/civil/service/flowstate/FlowStateAllowedEventServiceTest.java index cae90e7ca58..3046d377756 100644 --- a/src/test/java/uk/gov/hmcts/reform/civil/service/flowstate/FlowStateAllowedEventServiceTest.java +++ b/src/test/java/uk/gov/hmcts/reform/civil/service/flowstate/FlowStateAllowedEventServiceTest.java @@ -137,6 +137,8 @@ class FlowStateAllowedEventServiceTest { @Autowired FlowStateAllowedEventService flowStateAllowedEventService; + // used by StateFlowEngine bean + @SuppressWarnings("unused") @MockBean private FeatureToggleService toggleService;