Skip to content

Commit

Permalink
NFDIV-4601 Updating the states for Solicitor "General Applicant" even…
Browse files Browse the repository at this point in the history
…t is available (#4311)

* NFDIV-4601 Updating the states for Solicitor  "General Applicant" event is available

* NFDIV-4601 Move Enumset to event
  • Loading branch information
pallavijustice authored Feb 11, 2025
1 parent 7457d07 commit 268c0be
Showing 1 changed file with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import uk.gov.hmcts.divorce.solicitor.event.page.GeneralApplicationSelectFee;
import uk.gov.hmcts.reform.authorisation.generators.AuthTokenGenerator;

import java.util.EnumSet;
import java.util.List;
import java.util.Objects;

Expand All @@ -36,9 +37,16 @@
import static org.apache.commons.lang3.ObjectUtils.isEmpty;
import static org.springframework.http.HttpHeaders.AUTHORIZATION;
import static org.springframework.http.HttpStatus.CREATED;
import static uk.gov.hmcts.divorce.divorcecase.model.State.Applicant2Approved;
import static uk.gov.hmcts.divorce.divorcecase.model.State.Archived;
import static uk.gov.hmcts.divorce.divorcecase.model.State.AwaitingApplicant1Response;
import static uk.gov.hmcts.divorce.divorcecase.model.State.AwaitingApplicant2Response;
import static uk.gov.hmcts.divorce.divorcecase.model.State.AwaitingPayment;
import static uk.gov.hmcts.divorce.divorcecase.model.State.AwaitingPronouncement;
import static uk.gov.hmcts.divorce.divorcecase.model.State.Draft;
import static uk.gov.hmcts.divorce.divorcecase.model.State.GeneralApplicationReceived;
import static uk.gov.hmcts.divorce.divorcecase.model.State.POST_ISSUE_STATES;
import static uk.gov.hmcts.divorce.divorcecase.model.State.Rejected;
import static uk.gov.hmcts.divorce.divorcecase.model.State.Withdrawn;
import static uk.gov.hmcts.divorce.divorcecase.model.UserRole.APPLICANT_1_SOLICITOR;
import static uk.gov.hmcts.divorce.divorcecase.model.UserRole.APPLICANT_2_SOLICITOR;
import static uk.gov.hmcts.divorce.divorcecase.model.UserRole.CASE_WORKER;
Expand All @@ -60,6 +68,17 @@ public class SolicitorGeneralApplication implements CCDConfig<CaseData, State, U
private static final String GENERAL_APPLICATION_URGENT_CASE_REASON_ERROR =
"General Application marked as urgent need an accompanying reason why it is urgent";

private static final EnumSet<State> GENERAL_APPLICATION_STATES = EnumSet.complementOf(EnumSet.of(
Draft,
AwaitingApplicant1Response,
AwaitingApplicant2Response,
Applicant2Approved,
AwaitingPayment,
Withdrawn,
Rejected,
Archived
));

@Autowired
private GeneralApplicationSelectFee generalApplicationSelectFee;

Expand Down Expand Up @@ -213,7 +232,7 @@ private PageBuilder addEventConfig(final ConfigBuilder<CaseData, State, UserRole

return new PageBuilder(configBuilder
.event(SOLICITOR_GENERAL_APPLICATION)
.forStates(POST_ISSUE_STATES)
.forStates(GENERAL_APPLICATION_STATES)
.name(GENERAL_APPLICATION)
.description(GENERAL_APPLICATION)
.showSummary()
Expand Down

0 comments on commit 268c0be

Please sign in to comment.