Skip to content

Commit

Permalink
ADOP-2544 removal of states in case list filters (#954)
Browse files Browse the repository at this point in the history
* Updating to reflect changes made as part of ADOP-2522 and add info about generating CCD spreadsheets
  • Loading branch information
hfilmore authored Nov 20, 2024
1 parent cc07c4a commit 1ba0ead
Show file tree
Hide file tree
Showing 26 changed files with 141 additions and 184 deletions.
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,7 @@ You should get a response similar to this:

Preliminary steps:

* Open file `/bin/generate-ccd-definition.sh` and amend:

`docker run --pull always --user $UID --rm --name json2xlsx \`

by removing "--user $UID" to:

`docker run --pull always --rm --name json2xlsx \`

* Then build:
* To build:

`./gradlew build`

Expand All @@ -91,11 +83,17 @@ You can now run the full CCD and XUI stack locally using:
* Then you can access XUI on `http://localhost:3000`


### Generate CCD Excel Spreadsheet

To generate the CCD Excel files run the following from the root of the project:

./gradlew buildCCDXlsx

### Generate CCD JSON files

To generate the CCD JSON files from the Java Model run the following from the root of the project:

./gradlew ccd-definitions:generateCCDConfig
./gradlew generateCCDConfig

### Generate TypeScript definitions for CCD definition

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,9 @@
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.State.Draft;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.State.LaSubmitted;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.State.Submitted;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole.CASE_WORKER;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole.CITIZEN;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole.COURT_ADMIN;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole.DISTRICT_JUDGE;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole.LEGAL_ADVISOR;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole.SOLICITOR;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole.SUPER_USER;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.UserRole.SYSTEM_UPDATE;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions.CREATE_READ_UPDATE;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.access.Permissions.READ;
import static uk.gov.hmcts.reform.adoption.adoptioncase.model.State.AwaitingPayment;


Expand All @@ -28,29 +21,15 @@ public class Adoption implements CCDConfig<CaseData, State, UserRole> {
public static final String CASE_TYPE = "A58";
public static final String JURISDICTION = "ADOPTION";

//@Autowired
//private AddSystemUpdateRole addSystemUpdateRole;

@Override
public void configure(final ConfigBuilder<CaseData, State, UserRole> configBuilder) {
configBuilder.setCallbackHost(System.getenv().getOrDefault("CASE_API_URL", "http://localhost:4550"));
/*configBuilder.caseType(CASE_TYPE, "Post Placement", "Post Placement");
configBuilder.caseType(CASE_TYPE, "Step Parent", "Step Parent");
configBuilder.caseType(CASE_TYPE, "Relinquished", "Relinquished");
configBuilder.caseType(CASE_TYPE, "International", "International");*/
configBuilder.caseType(CASE_TYPE, "New Adoption case", "New Adoption case");
configBuilder.jurisdiction(JURISDICTION, "Adoption", "Child adoption");

configBuilder.grant(Draft, CREATE_READ_UPDATE, CITIZEN);
configBuilder.grant(Draft, READ, SOLICITOR);
configBuilder.grant(Draft, READ, SUPER_USER);
configBuilder.grant(Draft, READ, CASE_WORKER);
configBuilder.grant(Draft, READ, COURT_ADMIN);
configBuilder.grant(Draft, READ, SUPER_USER);
configBuilder.grant(AwaitingPayment, READ, SYSTEM_UPDATE);
configBuilder.grant(Draft, READ, LEGAL_ADVISOR);
configBuilder.grant(Draft, READ, DISTRICT_JUDGE);
configBuilder.grant(Draft, CREATE_READ_UPDATE, SYSTEM_UPDATE);
configBuilder.grant(AwaitingPayment, CREATE_READ_UPDATE, SYSTEM_UPDATE);
configBuilder.grant(Submitted, CREATE_READ_UPDATE, SYSTEM_UPDATE);
configBuilder.grant(LaSubmitted, CREATE_READ_UPDATE, SYSTEM_UPDATE);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
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 @@ -112,18 +111,14 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
* @return - PageBuilder updated to use on overridden method.
*/
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
configBuilder.grant(State.Draft, Permissions.READ_UPDATE, UserRole.CASE_WORKER, UserRole.COURT_ADMIN,
UserRole.LEGAL_ADVISOR, UserRole.DISTRICT_JUDGE
);
return new PageBuilder(configBuilder
.event(CASEWORKER_MANAGE_HEARING)
.forAllStates()
.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,7 +8,6 @@
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 @@ -42,7 +41,6 @@ private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> conf
.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,7 +8,6 @@
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 @@ -43,7 +42,6 @@ private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> conf
.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,7 +12,6 @@
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 @@ -34,17 +33,12 @@ public void configure(final ConfigBuilder<CaseData, State, UserRole> configBuild
}

public PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
configBuilder.grant(State.Draft, Permissions.READ_UPDATE, UserRole.CASE_WORKER, UserRole.COURT_ADMIN,
UserRole.LEGAL_ADVISOR, UserRole.DISTRICT_JUDGE
);
return new PageBuilder(configBuilder
.event(CASEWORKER_AMEND_OTHER_PARTIES_DETAILS)
.forAllStates()
.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,7 +13,6 @@
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 @@ -60,17 +59,12 @@ public void configure(final ConfigBuilder<CaseData, State, UserRole> configBuild
}

private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
configBuilder.grant(State.Draft, Permissions.READ_UPDATE, UserRole.CASE_WORKER, UserRole.COURT_ADMIN,
UserRole.LEGAL_ADVISOR, UserRole.DISTRICT_JUDGE
);
return new PageBuilder(configBuilder
.event(CASEWORKER_ADD_CASE_NOTE)
.forAllStates()
.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,7 +18,6 @@
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 @@ -97,16 +96,12 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
* @return - PageBuilder updated to use on overridden method.
*/
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
configBuilder.grant(State.Draft, Permissions.READ_UPDATE, UserRole.CASE_WORKER, UserRole.COURT_ADMIN,
UserRole.LEGAL_ADVISOR, UserRole.DISTRICT_JUDGE);
return new PageBuilder(configBuilder
.event(CASEWORKER_CHECK_AND_SEND_ORDERS)
.forAllStates()
.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,7 +18,6 @@
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 @@ -82,18 +81,14 @@ public void configure(final ConfigBuilder<CaseData, State, UserRole> configBuild
* @return - PageBuilder updated to use on overridden method.
*/
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
configBuilder.grant(State.Draft, Permissions.READ_UPDATE, UserRole.CASE_WORKER, UserRole.COURT_ADMIN,
UserRole.LEGAL_ADVISOR, UserRole.DISTRICT_JUDGE
);
return new PageBuilder(configBuilder
.event(CASEWORKER_MANAGE_ORDERS)
.forAllStates()
.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,7 +8,6 @@
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 @@ -32,7 +31,6 @@ private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> conf
.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,7 +12,6 @@
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 @@ -55,15 +54,14 @@ public void configure(final ConfigBuilder<CaseData, State, UserRole> configBuild
}

private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
configBuilder.grant(State.Draft, Permissions.READ_UPDATE, UserRole.CASE_WORKER);
return new PageBuilder(configBuilder
.event(CASEWORKER_REVIEW_DOCUMENT)
.forAllStates()
.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,7 +18,6 @@
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 @@ -93,17 +92,12 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
* @return - PageBuilder updated to use on overridden method.
*/
private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
configBuilder.grant(State.Draft, Permissions.READ_UPDATE, UserRole.CASE_WORKER, UserRole.COURT_ADMIN,
UserRole.LEGAL_ADVISOR, UserRole.DISTRICT_JUDGE
);
return new PageBuilder(configBuilder
.event(CASEWORKER_SEEK_FURTHER_INFORMATION)
.forAllStates()
.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,7 +12,6 @@
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 @@ -51,8 +50,6 @@ private PageBuilder addConfig(ConfigBuilder<CaseData, State, UserRole> configBui
.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,7 +10,6 @@
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 @@ -32,17 +31,12 @@ public void configure(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
}

private PageBuilder addEventConfig(ConfigBuilder<CaseData, State, UserRole> configBuilder) {
configBuilder.grant(State.Draft, Permissions.READ_UPDATE, UserRole.CASE_WORKER, UserRole.COURT_ADMIN,
UserRole.LEGAL_ADVISOR, UserRole.DISTRICT_JUDGE
);
return new PageBuilder(configBuilder
.event(CASEWORKER_TRANSFER_COURT)
.forAllStates()
.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
Loading

0 comments on commit 1ba0ead

Please sign in to comment.