Skip to content

Commit

Permalink
Merge branch 'ia-case-api-dlrm' into RIA-8101_dlrm_judge_rework
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/main/java/uk/gov/hmcts/reform/iacaseapi/domain/entities/DecideFtpaApplicationType.java
#	src/main/java/uk/gov/hmcts/reform/iacaseapi/domain/handlers/presubmit/FtpaDecisionMidEvent.java
#	src/main/java/uk/gov/hmcts/reform/iacaseapi/domain/handlers/presubmit/UpperTribunalBundlePreparer.java
#	src/test/java/uk/gov/hmcts/reform/iacaseapi/domain/handlers/presubmit/FtpaDecisionMidEventTest.java
#	src/test/java/uk/gov/hmcts/reform/iacaseapi/domain/handlers/presubmit/UpperTribunalBundlePreparerTest.java
  • Loading branch information
JamieClarkeV1 committed Jan 26, 2024
2 parents 9e5174c + e2a8eb4 commit eb50711
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 172 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
public enum DecideFtpaApplicationType {
PARTIALLY_GRANTED("partiallyGranted"),
GRANTED("granted"),
PARTIALLY_GRANTED("partiallyGranted"),
REFUSED("refused"),
APPLICATION_NOT_ADMITTED("notAdmitted"),
WITHDRAWN("withdrawn"),
REHEARD_RULE35("reheardRule35"),
REHEARD_RULE32("reheardRule32"),
REMADE_RULE31("remadeRule31"),
REMADE_RULE32("remadeRule32");

@JsonValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import static uk.gov.hmcts.reform.iacaseapi.domain.entities.Parties.RESPONDENT;

import java.util.Optional;

import org.springframework.stereotype.Component;
import uk.gov.hmcts.reform.iacaseapi.domain.entities.*;
import uk.gov.hmcts.reform.iacaseapi.domain.entities.ccd.Event;
Expand Down Expand Up @@ -49,13 +50,12 @@ public PreSubmitCallbackResponse<AsylumCase> handle(
.orElseThrow(() -> new IllegalStateException("FtpaApplicantType is not present"));

Optional<String> ftpaRjDecisionOutcomeType = asylumCase.read(ftpaApplicantType.equals(APPELLANT.toString())
? FTPA_APPELLANT_RJ_DECISION_OUTCOME_TYPE
: FTPA_RESPONDENT_RJ_DECISION_OUTCOME_TYPE, String.class);
? FTPA_APPELLANT_RJ_DECISION_OUTCOME_TYPE
: FTPA_RESPONDENT_RJ_DECISION_OUTCOME_TYPE, String.class);

if (!HandlerUtils.isRepJourney(asylumCase) && ftpaRjDecisionOutcomeType.isPresent()) {
String ftpaRjDecisionOutcomeTypeValue = ftpaRjDecisionOutcomeType.get();
if (ftpaRjDecisionOutcomeTypeValue.equals(DecideFtpaApplicationType.REHEARD_RULE35.toString())
|| ftpaRjDecisionOutcomeTypeValue.equals(DecideFtpaApplicationType.REHEARD_RULE32.toString())
|| ftpaRjDecisionOutcomeTypeValue.equals(DecideFtpaApplicationType.REMADE_RULE32.toString())) {
PreSubmitCallbackResponse<AsylumCase> response = new PreSubmitCallbackResponse<>(asylumCase);
response.addError("For Legal Representative Journey Only");
Expand Down Expand Up @@ -93,18 +93,12 @@ public PreSubmitCallbackResponse<AsylumCase> handle(

private void setDecideFtpaApplicationDecisionPagesVisibility(AsylumCase asylumCase) {

final YesOrNo isFtpaAppellantNoticeOfDecisionSetAside = asylumCase.read(IS_FTPA_APPELLANT_NOTICE_OF_DECISION_SET_ASIDE, YesOrNo.class).orElse(YesOrNo.NO);
final String ftpaAppellantRjDecisionOutcomeType = asylumCase.read(FTPA_APPELLANT_RJ_DECISION_OUTCOME_TYPE, String.class).orElse("");

final YesOrNo isFtpaRespondentNoticeOfDecisionSetAside = asylumCase.read(IS_FTPA_RESPONDENT_NOTICE_OF_DECISION_SET_ASIDE, YesOrNo.class).orElse(YesOrNo.NO);
final String ftpaRespondentRjDecisionOutcomeType = asylumCase.read(FTPA_RESPONDENT_RJ_DECISION_OUTCOME_TYPE, String.class).orElse("");

// Page 3
setNoticeOfDecisionSetAsideVisibility(asylumCase, ftpaAppellantRjDecisionOutcomeType, ftpaRespondentRjDecisionOutcomeType);

// Page 4
setDecisionObjectionsPageVisibility(asylumCase, isFtpaAppellantNoticeOfDecisionSetAside, ftpaAppellantRjDecisionOutcomeType,
isFtpaRespondentNoticeOfDecisionSetAside, ftpaRespondentRjDecisionOutcomeType);
setNoticeOfDecisionSetAsideVisibility(asylumCase, ftpaAppellantRjDecisionOutcomeType, ftpaRespondentRjDecisionOutcomeType);

// Page 5
setDecisionReasonsNotesVisibility(asylumCase, ftpaAppellantRjDecisionOutcomeType, ftpaRespondentRjDecisionOutcomeType);
Expand All @@ -115,17 +109,13 @@ private void setDecideFtpaApplicationDecisionPagesVisibility(AsylumCase asylumCa

private void setDecisionListingVisibility(AsylumCase asylumCase, String ftpaAppellantRjDecisionOutcomeType, String ftpaRespondentRjDecisionOutcomeType) {

if (ftpaAppellantRjDecisionOutcomeType.equals(DecideFtpaApplicationType.REHEARD_RULE35.toString())
|| ftpaAppellantRjDecisionOutcomeType.equals(DecideFtpaApplicationType.REHEARD_RULE32.toString())) {

if (ftpaAppellantRjDecisionOutcomeType.equals(DecideFtpaApplicationType.REHEARD_RULE35.toString())) {
asylumCase.write(AsylumCaseFieldDefinition.FTPA_APPELLANT_DECISION_LISTING_VISIBLE, YesOrNo.YES);
} else {
asylumCase.write(AsylumCaseFieldDefinition.FTPA_APPELLANT_DECISION_LISTING_VISIBLE, YesOrNo.NO);
}

if (ftpaRespondentRjDecisionOutcomeType.equals(DecideFtpaApplicationType.REHEARD_RULE35.toString())
|| ftpaRespondentRjDecisionOutcomeType.equals(DecideFtpaApplicationType.REHEARD_RULE32.toString())) {

if (ftpaRespondentRjDecisionOutcomeType.equals(DecideFtpaApplicationType.REHEARD_RULE35.toString())) {
asylumCase.write(AsylumCaseFieldDefinition.FTPA_RESPONDENT_DECISION_LISTING_VISIBLE, YesOrNo.YES);
} else {
asylumCase.write(AsylumCaseFieldDefinition.FTPA_RESPONDENT_DECISION_LISTING_VISIBLE, YesOrNo.NO);
Expand Down Expand Up @@ -206,7 +196,8 @@ private void setNoticeOfDecisionSetAsideVisibility(

if (ftpaAppellantRjDecisionOutcomeType.equals(DecideFtpaApplicationType.GRANTED.toString())
|| ftpaAppellantRjDecisionOutcomeType.equals(DecideFtpaApplicationType.PARTIALLY_GRANTED.toString())
|| ftpaAppellantRjDecisionOutcomeType.equals(DecideFtpaApplicationType.REFUSED.toString())) {
|| ftpaAppellantRjDecisionOutcomeType.equals(DecideFtpaApplicationType.REFUSED.toString())
|| ftpaAppellantRjDecisionOutcomeType.equals(DecideFtpaApplicationType.APPLICATION_NOT_ADMITTED.toString())) {

asylumCase.write(AsylumCaseFieldDefinition.FTPA_APPELLANT_NOTICE_OF_DECISION_SET_ASIDE_VISIBLE, YesOrNo.YES);
} else {
Expand All @@ -215,7 +206,8 @@ private void setNoticeOfDecisionSetAsideVisibility(

if (ftpaRespondentRjDecisionOutcomeType.equals(DecideFtpaApplicationType.GRANTED.toString())
|| ftpaRespondentRjDecisionOutcomeType.equals(DecideFtpaApplicationType.PARTIALLY_GRANTED.toString())
|| ftpaRespondentRjDecisionOutcomeType.equals(DecideFtpaApplicationType.REFUSED.toString())) {
|| ftpaRespondentRjDecisionOutcomeType.equals(DecideFtpaApplicationType.REFUSED.toString())
|| ftpaRespondentRjDecisionOutcomeType.equals(DecideFtpaApplicationType.APPLICATION_NOT_ADMITTED.toString())) {

asylumCase.write(AsylumCaseFieldDefinition.FTPA_RESPONDENT_NOTICE_OF_DECISION_SET_ASIDE_VISIBLE, YesOrNo.YES);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@ public PreSubmitCallbackResponse<AsylumCase> handle(PreSubmitCallbackStage callb

boolean setAsideRespondentDecisionExists =
ftpaRespondentRjDecisionOutcomeType.isPresent()
&& (ftpaRespondentRjDecisionOutcomeType.get().equals(DecideFtpaApplicationType.REHEARD_RULE32.toString())
|| ftpaRespondentRjDecisionOutcomeType.get().equals(DecideFtpaApplicationType.REHEARD_RULE35.toString())
&& (ftpaRespondentRjDecisionOutcomeType.get().equals(DecideFtpaApplicationType.REHEARD_RULE35.toString())
|| ftpaRespondentRjDecisionOutcomeType.get().equals(DecideFtpaApplicationType.REMADE_RULE32.toString()));

boolean setAsideAppellantDecisionExists =
ftpaAppellantRjDecisionOutcomeType.isPresent()
&& (ftpaAppellantRjDecisionOutcomeType.get().equals(DecideFtpaApplicationType.REHEARD_RULE32.toString())
|| ftpaAppellantRjDecisionOutcomeType.get().equals(DecideFtpaApplicationType.REHEARD_RULE35.toString())
&& (ftpaAppellantRjDecisionOutcomeType.get().equals(DecideFtpaApplicationType.REHEARD_RULE35.toString())
|| ftpaAppellantRjDecisionOutcomeType.get().equals(DecideFtpaApplicationType.REMADE_RULE32.toString()));

if (setAsideRespondentDecisionExists || setAsideAppellantDecisionExists) {
Expand Down
Loading

0 comments on commit eb50711

Please sign in to comment.