Skip to content

Commit

Permalink
Revert changes to caseworker events, knock on effect to field permiss…
Browse files Browse the repository at this point in the history
…ions (#960)

* Revert "ADOP-2544 removal of states in case list filters (#954)"

This reverts commit 1ba0ead.

* KEEP the state + citizen event changes

* keep readme too

* keep parts of revert around draft states

* checkstyle
  • Loading branch information
DanCatchpole authored and hfilmore committed Nov 28, 2024
1 parent 5b2d466 commit 50e533a
Show file tree
Hide file tree
Showing 15 changed files with 62 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.Parent;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.ManageHearingOptions;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.ManageHearingDetails;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.CcdPageConfiguration;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;
import uk.gov.hmcts.reform.adoption.document.CaseDataDocumentService;
Expand Down Expand Up @@ -113,12 +114,13 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_MANAGE_HEARING)
.forAllStates()
.forStates(State.LaSubmitted)
.name(MANAGE_HEARINGS)
.description(MANAGE_HEARINGS)
.showSummary()
.aboutToSubmitCallback(this::aboutToSubmit)
);
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE));
}

public AboutToStartOrSubmitResponse<CaseData, State> aboutToSubmit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.CaseData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.State;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;

/**
Expand Down Expand Up @@ -37,10 +38,11 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_AMEND_APPLICANT)
.forAllStates()
.forStates(State.LaSubmitted)
.name(AMEND_APPLICANT_DETAILS)
.description(AMEND_APPLICANT_DETAILS)
.showSummary()
);
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.CaseData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.State;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;

/**
Expand Down Expand Up @@ -38,10 +39,11 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_AMEND_CASE)
.forAllStates()
.forStates(State.LaSubmitted)
.name(AMEND_CASE_DETAILS)
.description(AMEND_CASE_DETAILS)
.showSummary()
);
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.State;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.YesNoNotSure;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.CcdPageConfiguration;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;

Expand All @@ -35,10 +36,12 @@ public void configure(final ConfigBuilder<CaseData, State, UserRole> configBuild
public PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_AMEND_OTHER_PARTIES_DETAILS)
.forAllStates()
.forStates(State.LaSubmitted)
.name(AMEND_OTHER_PARTIES_DETAILS)
.description(AMEND_OTHER_PARTIES_DETAILS)
.showSummary()
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE)
.aboutToSubmitCallback(this::aboutToSubmit));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.CaseNote;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.State;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.CcdPageConfiguration;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;
import uk.gov.hmcts.reform.adoption.idam.IdamService;
Expand Down Expand Up @@ -61,10 +62,12 @@ public void configure(final ConfigBuilder<CaseData, State, UserRole> configBuild
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_ADD_CASE_NOTE)
.forAllStates()
.forStates(State.LaSubmitted)
.name(ADD_CASE_NOTE)
.description(ADD_CASE_NOTE)
.showSummary()
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE)
.aboutToSubmitCallback(this::aboutToSubmit));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.ManageOrdersData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.OrderCheckAndSend;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.AdoptionOrderData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.MessageSendDetails;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.DirectionsOrderData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.OrderData;
Expand Down Expand Up @@ -98,10 +99,12 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_CHECK_AND_SEND_ORDERS)
.forAllStates()
.forStates(State.LaSubmitted)
.name(check_and_send_orders)
.showSummary()
.aboutToStartCallback(this::aboutToStart)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE)
.aboutToSubmitCallback(this::aboutToSubmit));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.ManageOrdersData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.DirectionsOrderData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.LanguagePreference;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.CcdPageConfiguration;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;
import uk.gov.hmcts.reform.adoption.document.CaseDataDocumentService;
Expand Down Expand Up @@ -83,12 +84,13 @@ public void configure(final ConfigBuilder<CaseData, State, UserRole> configBuild
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_MANAGE_ORDERS)
.forAllStates()
.forStates(State.LaSubmitted)
.name(MANAGE_ORDERS)
.description(MANAGE_ORDERS)
.showSummary()
.aboutToSubmitCallback(this::aboutToSubmit)
);
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.CaseData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.State;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.CcdPageConfiguration;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;

Expand All @@ -26,11 +27,12 @@ public void configure(final ConfigBuilder<CaseData, State, UserRole> configBuild
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_AMEND_CASE)
.forStates(State.Draft)
.forStates(State.LaSubmitted)
.name("Request Annex-A")
.description("Request Annex-A")
.showSummary()
.showEventNotes()
);
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.CaseData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.State;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.CcdPageConfiguration;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;
import uk.gov.hmcts.reform.adoption.document.model.AdoptionDocument;
Expand Down Expand Up @@ -56,12 +57,12 @@ public void configure(final ConfigBuilder<CaseData, State, UserRole> configBuild
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_REVIEW_DOCUMENT)
.forAllStates()
.forStates(State.LaSubmitted)
.name(SCANNED_DOCUMENT)
.description(SCANNED_DOCUMENT)
.showSummary()
.aboutToSubmitCallback(this::aboutToSubmit)
);
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER));
}

public AboutToStartOrSubmitResponse<CaseData, State> aboutToSubmit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.LanguagePreference;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.State;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.CcdPageConfiguration;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;
import uk.gov.hmcts.reform.adoption.document.CaseDataDocumentService;
Expand Down Expand Up @@ -94,10 +95,12 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_SEEK_FURTHER_INFORMATION)
.forAllStates()
.forStates(State.LaSubmitted)
.name(SEEK_FURTHER_INFORMATION_HEADING)
.description(SEEK_FURTHER_INFORMATION_HEADING)
.showSummary()
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE)
.aboutToStartCallback(this::seekFurtherInformationData)
.aboutToSubmitCallback(this::aboutToSubmit));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.CaseData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.State;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.CcdPageConfiguration;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;
import uk.gov.hmcts.reform.adoption.idam.IdamService;
Expand Down Expand Up @@ -46,10 +47,12 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
private PageBuilder addConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_SEND_OR_REPLY)
.forAllStates()
.forStates(State.LaSubmitted)
.name(SEND_OR_REPLY_HEADING)
.description(SEND_OR_REPLY_HEADING)
.showSummary()
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE)
.aboutToStartCallback(this::beforeStartEvent)
.aboutToSubmitCallback(this::aboutToSubmit));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.CaseData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.State;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.CcdPageConfiguration;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;

Expand All @@ -33,10 +34,12 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_TRANSFER_COURT)
.forAllStates()
.forStates(State.LaSubmitted)
.name(TRANSFER_COURT_HEADING)
.description(TRANSFER_COURT_HEADING)
.showSummary()
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE)
.aboutToSubmitCallback(this::aboutToSubmit));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.CaseData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.State;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.CcdPageConfiguration;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;
import uk.gov.hmcts.reform.adoption.document.model.AdoptionUploadDocument;
Expand Down Expand Up @@ -51,12 +52,13 @@ public void configure(final ConfigBuilder<CaseData, State, UserRole> configBuild
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_UPLOAD_DOCUMENT)
.forAllStates()
.forStates(State.LaSubmitted)
.name(MANAGE_DOCUMENT)
.description(MANAGE_DOCUMENT)
.showSummary()
.aboutToSubmitCallback(this::aboutToSubmit)
);
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import uk.gov.hmcts.reform.adoption.adoptioncase.model.CaseData;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.State;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole;
import uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions;
import uk.gov.hmcts.reform.adoption.common.ccd.CcdPageConfiguration;
import uk.gov.hmcts.reform.adoption.common.ccd.PageBuilder;

Expand All @@ -36,10 +37,12 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
return new PageBuilder(configBuilder
.event(CASEWORKER_ALLOCATE_JUDGE)
.forAllStates()
.forStates(State.LaSubmitted)
.name(ALLOCATE_JUDGE)
.description(ALLOCATE_JUDGE)
.showSummary()
.grant(Permissions.CREATE_READ_UPDATE, UserRole.CASE_WORKER)
.grant(Permissions.CREATE_READ_UPDATE, UserRole.DISTRICT_JUDGE)
.aboutToSubmitCallback(this::aboutToSubmit));
}

Expand Down
Loading

0 comments on commit 50e533a

Please sign in to comment.