Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
a16676b
FPVTL-1730 WIP cos changes
Jude-hmcts Feb 2, 2026
ef3b97a
FPVTL 1733 1738 1728 Add and remove LA Social worker
Feb 3, 2026
faaf316
Some cleanup and tests
Feb 4, 2026
c27042f
Merge branch 'master' into FPVTL-1733-1738-1728-Add-and-remove-LA-soc…
dharmendrak Feb 4, 2026
461508f
resolve checkstyle issues
Feb 4, 2026
f9a679e
Merge branch 'FPVTL-1733-1738-1728-Add-and-remove-LA-social-worker' o…
Feb 4, 2026
351d8fe
resolve checkstyle issues
Feb 4, 2026
dca8537
resolve checkstyle issues
Feb 4, 2026
56fd8ca
resolve tests
Feb 4, 2026
b408e0c
Resolve tests
Feb 4, 2026
1ac3c81
resolve tests
Feb 4, 2026
06d5ef2
resolve tests
Feb 4, 2026
8d49b23
reformat
Feb 4, 2026
652205e
resolve build issues
Feb 4, 2026
eab0d86
Resolve failing test
Feb 4, 2026
4404597
Suppress code coverage
Feb 4, 2026
3b01780
Upload documents mapped to LA report types
Jude-hmcts Feb 5, 2026
d1ff134
FPVTL-1730-COS-changes: fixed failing test
mrafeeqmastek Feb 6, 2026
de134a4
Added LASOLICITOR case role w.r.t 1730
Jude-hmcts Feb 9, 2026
a3d2699
Add LA solicitors roles
Feb 9, 2026
d3dbc5c
Add local authority solicitor
Feb 9, 2026
fc56973
Add test
Feb 9, 2026
d85d4b0
Broken test fixed and added new test cases for LA look up change
Jude-hmcts Feb 10, 2026
c679009
FPVTL - 1730 Test updated
Jude-hmcts Feb 10, 2026
93d881a
Test updated
Jude-hmcts Feb 10, 2026
7d9884d
New Role LOCAL_AUTHORITY introduced to quarantine docs siilar to CafCass
Jude-hmcts Feb 12, 2026
907c4ce
Merge branch 'FPVTL-1730-COS-changes' into FPVTL-1731-Grant-local-aut…
mrafeeqhmcts Feb 12, 2026
c0880b6
Handle if no case roles for Local authority
Feb 12, 2026
e469b02
Merge branch 'master' into FPVTL-1733-1738-1728-Add-and-remove-LA-soc…
dharmendrak Feb 16, 2026
3c4e7fb
FPVTL-1731-Grant-local-authority-manage-documents-access: AC3 added
mrafeeqhmcts Feb 16, 2026
3089c52
Merge branch 'FPVTL-1733-1738-1728-Add-and-remove-LA-social-worker' i…
mrafeeqhmcts Feb 17, 2026
c12758f
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Feb 17, 2026
f4050c3
FPVTL-1531: minor refactor
mrafeeqhmcts Feb 17, 2026
2842e6a
FPVTL-1731: checkstyle fix
mrafeeqhmcts Feb 17, 2026
8bcf6dc
FPVTL-1731: fixed sonar issues
mrafeeqhmcts Feb 17, 2026
2512603
FPVTL-1731: fixed sonar issues
mrafeeqhmcts Feb 17, 2026
b1a3b22
FPVTL-1731: fixed sonar issues
mrafeeqhmcts Feb 17, 2026
b7ebc83
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Feb 18, 2026
f6714c2
Merge branch 'FPVTL-1733-1738-1728-Add-and-remove-LA-social-worker' i…
mrafeeqhmcts Feb 18, 2026
0c81e9a
FPVTL-1731: updated build.gradle
mrafeeqhmcts Feb 18, 2026
2960c9d
FPVTL-1731: updated build.gradle
mrafeeqhmcts Feb 20, 2026
1a77546
FPVTL-1731: ignored few tests
mrafeeqhmcts Feb 20, 2026
16f5fce
FPVTL-1731: ignored tests via disabled annotation
mrafeeqhmcts Feb 20, 2026
91bb940
FPVTL-1731 temprorarily disabled test
Jude-hmcts Feb 20, 2026
c7e6765
FPVTL-1731 temprorarily disabled test
Jude-hmcts Feb 20, 2026
e014581
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Feb 23, 2026
1f24570
Fix build failure with checkstyle issues
Jude-hmcts Feb 23, 2026
f698e02
FPVTL-1731: ignored tests via disabled annotation
mrafeeqhmcts Feb 23, 2026
7163da0
FPVTL-1731: ignored tests via disabled annotation
mrafeeqhmcts Feb 23, 2026
95de226
FPVTL-1731: ignored tests via disabled annotation
mrafeeqhmcts Feb 23, 2026
db919bc
FPVTL-1731: ignored tests via disabled annotation
mrafeeqhmcts Feb 23, 2026
4987561
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Feb 23, 2026
baf78cf
FPVTL-1731: integrated with jude branch
mrafeeqhmcts Feb 25, 2026
47a32e7
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Feb 25, 2026
34efa18
FPVTL-1731: removed unused import
mrafeeqhmcts Feb 25, 2026
13f4f04
FPVTL-1730 added the code change to address the problem with solicito…
Jude-hmcts Feb 25, 2026
e1d4d36
Merge branch 'FPVTL-1730-COS-changes' into FPVTL-1731-integration
mrafeeqhmcts Feb 25, 2026
372e982
FPVTL-1731: addressed checkstyle issue
mrafeeqhmcts Feb 25, 2026
7ad72f5
added test for the LA role assignment check as logged in user
Jude-hmcts Feb 25, 2026
d6c8c2a
Refactored to the filter to categories list
Jude-hmcts Feb 26, 2026
7de39fa
Merge branch 'FPVTL-1730-COS-changes' into FPVTL-1731-integration
Jude-hmcts Feb 26, 2026
b6dd628
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Feb 26, 2026
8fd9f2d
isLocalAuthorityInvolvedInCase case field
Feb 26, 2026
85b80a3
Merge branch 'master' into FPVTL-1733-1738-1728-Add-and-remove-LA-soc…
dharmendrak Feb 26, 2026
1167ce0
Action review comments
Feb 27, 2026
5d445da
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Feb 27, 2026
12344b0
Merge branch 'master' into FPVTL-1733-1738-1728-Add-and-remove-LA-soc…
dharmendrak Feb 27, 2026
6fd6e4b
Merge branch 'FPVTL-1733-1738-1728-Add-and-remove-LA-social-worker' i…
mrafeeqhmcts Feb 27, 2026
40ddf69
Re-direct the flow to LA locally to Documents
Jude-hmcts Feb 27, 2026
fcc7ef7
Document review changes for LA
Jude-hmcts Feb 27, 2026
47fa4b1
Merger FPVTL-1730-COS-changes into FPVTL-1731-integration
Jude-hmcts Feb 27, 2026
6b506e8
Merge branch 'FPVTL-2239-Review-Documents-LA' into FPVTL-1731-integra…
Jude-hmcts Feb 27, 2026
8835c49
caught up changes required to make manage documents working
Jude-hmcts Mar 2, 2026
aa15c39
quarantining the LA doc in same bucket so it is grouped properly
Jude-hmcts Mar 2, 2026
c297817
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 3, 2026
14e9079
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 5, 2026
8287f56
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 5, 2026
3540aea
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 9, 2026
83493b8
FPVTL-1731: fixed build.gradle which had a typo due to merge conflict
mrafeeqhmcts Mar 9, 2026
e805a36
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 9, 2026
3d8cb0e
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 10, 2026
3b92a55
Rebase with base changes
Mar 10, 2026
d4d11d1
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 10, 2026
f4aba74
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 10, 2026
4ead6f7
Refactored the code to remove extra implementation
Jude-hmcts Mar 11, 2026
b35fc2a
Fix the error message when org policy is not added before removal
Mar 4, 2026
84f4d51
Add about to start to warn for error if not local authority added before
Mar 5, 2026
5b96b8f
Add null check
Mar 5, 2026
ab05f6f
Correct comparison
Mar 5, 2026
1a776ad
Null check resolution
Mar 5, 2026
56fc510
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 11, 2026
0aa591e
No requirement to make the restricted reason as optional
Jude-hmcts Mar 11, 2026
103b26a
Removed disabled functional tests and commented out code
Jude-hmcts Mar 11, 2026
16b99c7
Removed disabled from functional test as now pipeline is fine with re…
Jude-hmcts Mar 11, 2026
99e1e2e
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 12, 2026
c2573ac
Merge branch 'master' into FPVTL-1731-integration
dharmendrak Mar 12, 2026
3793652
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 13, 2026
9107783
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 16, 2026
7250bfc
FPVTL-1731 - fix to address citizen front end other documents
Jude-hmcts Mar 16, 2026
3a17649
Merge branch 'master' into FPVTL-1731-integration-citizen-work-cos
Jude-hmcts Mar 16, 2026
6df0cab
Merge branch 'master' into FPVTL-1731-integration-citizen-work-cos
Jude-hmcts Mar 17, 2026
67630b0
Merge branch 'master' into FPVTL-1731-integration-citizen-work-cos
Jude-hmcts Mar 17, 2026
8a83008
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 17, 2026
036edf4
Merge branch 'master' into FPVTL-1731-integration-citizen-work-cos
Jude-hmcts Mar 17, 2026
4f9ff56
Merge branch 'master' into FPVTL-1731-integration
mrafeeqhmcts Mar 17, 2026
8d142cd
Merge branch 'FPVTL-1731-integration' into FPVTL-1731-integration-cit…
mrafeeqhmcts Mar 18, 2026
bc6651e
FPVTL-2450 - for LA there is no restriction for section 37 report
Jude-hmcts Mar 20, 2026
0ee8b37
Merge branch 'master' into FPVTL-1731-integration-citizen-work-cos
dharmendrak Mar 25, 2026
9a58dfc
Push case summary changes
Mar 25, 2026
c33aa1b
Add remove la for close case
Mar 25, 2026
fab0367
FPVTL-1946 path finder CFV to treat CIR documents as URGENT priority
Jude-hmcts Mar 25, 2026
8efdef9
FPVTL-1946 path finder CFV to treat CIR documents as URGENT priority
Jude-hmcts Mar 25, 2026
e316617
FPVTL-1946 integration changes for Path finder URGENT prioroty tasks
Jude-hmcts Mar 25, 2026
fc5dcc2
FPVTL-1946 resolving merge issues
Jude-hmcts Mar 25, 2026
c2b69e4
FPVTL-1946 resolving merge issues
Jude-hmcts Mar 25, 2026
1280b56
Merge branch 'master' into FPVTL-1731-integration-citizen-work-cos
Jude-hmcts Mar 26, 2026
bbee856
Merge branch 'master' into FPVTL-1946-Path-Finder-Integration-Cos
Jude-hmcts Mar 26, 2026
29c8de5
Merge branch 'master' into FPVTL-1946-Path-Finder-Integration-Cos
Jude-hmcts Mar 26, 2026
1cc0b23
Merge branch 'master' into FPVTL-1946-Path-Finder-CFV-cos
Jude-hmcts Mar 27, 2026
094d9cd
FPVTL-1946 added all docs to bundle but cir documents
Jude-hmcts Mar 27, 2026
fef85ca
Merge branch 'FPVTL-1946-Path-Finder-CFV-cos' into FPVTL-1946-Path-Fi…
Jude-hmcts Mar 27, 2026
313882c
Merge branch 'master' into FPVTL-1731-integration-citizen-work-cos
dharmendrak Mar 30, 2026
6026450
Merge remote-tracking branch 'origin/FPVTL-1731-integration-citizen-w…
Jude-hmcts Mar 30, 2026
d269800
Merge branch 'master' into FPVTL-1946-Path-Finder-Integration-Cos
mrafeeqhmcts Mar 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,12 @@ def sonarExclusions = [
'**uk/gov/hmcts/reform/prl/mapper/citizen/CitizenPartyDetailsMapper.java',
'**uk/gov/hmcts/reform/prl/services/DraftAnOrderService.java',
'**uk/gov/hmcts/reform/prl/services/ManageOrderService.java',
'**uk/gov/hmcts/reform/prl/services/localauthority/AbstractSocialWorkerService.java',
'**uk/gov/hmcts/reform/prl/handlers/SocialworkerChangeEventHandler.java',
'**src/main/java/uk/gov/hmcts/reform/prl/clients/ccd/CaseAssignmentService.java',
'**uk/gov/hmcts/reform/prl/controllers/localauthority/SocialWorkerController.java',
'**uk/gov/hmcts/reform/prl/services/localauthority/SocialWorkerAddService.java',
'**uk/gov/hmcts/reform/prl/services/localauthority/SocialWorkerRemoveService.java',
'**uk/gov/hmcts/reform/prl/services/ServiceOfApplicationService.java',
'**uk/gov/hmcts/reform/prl/controllers/citizen/CaseController.java',
'**uk/gov/hmcts/reform/prl/filter/requestbodylogger/*',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,9 @@ public void givenRequestBody_WhenPostRequestTestSendCafcassCymruOrderEmail() thr
.body("data.serveOtherPartiesCA", equalTo(null))
.body("data.cafcassCymruServedOptions", equalTo(null))
.body("data.emailInformationCaOnlyC47a", equalTo(null))
.body("data.localAuthoritySolicitorOrganisationPolicy", equalTo(null))
.body("data.localAuthority.isLocalAuthorityInvolvedInCase",equalTo("No"))
.body("data.localAuthority.localAuthoritySolicitorOrganisationName", equalTo(null))
.body("data.orderCollection[0].value.serveOrderDetails.cafcassCymruServed",
equalTo("Yes"))
.body("data.orderCollection[0].value.serveOrderDetails.cafcassCymruEmail",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
"performingAction": null,
"judgeLaReviewRequired": null,
"markedToServeEmailNotification": "No",
"localAuthority": {
"isLocalAuthorityInvolvedInCase": "Yes",
"localAuthoritySolicitorOrganisationName": "Local Authority Private Law AAT Test Organisation"
},
"localAuthoritySolicitorOrganisationPolicy": {
"Organisation": {
"OrganisationID": "I1SL2TZ",
"OrganisationName": "Local Authority Private Law AAT Test Organisation"
},
"OrgPolicyReference": null,
"OrgPolicyCaseAssignedRole": "[LASOLICITOR]"
},
"applicants": [
{
"id": "97e25c77-f915-4b4e-8436-89a0d1678813",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ public class ManageDocumentsCategoryConstants {
public static final String DRUG_AND_ALCOHOL_TEST = "drugAndAlcoholTest(toxicology)";
public static final String POLICE_REPORT = "policeReport";
public static final String SEC37_REPORT = "sec37Report";
public static final String CHILD_IMPACT_REPORT_1_LA = "childImpactReport1La";
public static final String CHILD_IMPACT_REPORT_2_LA = "childImpactReport2La";
public static final String SECTION_7_REPORT_LA = "section7ReportLa";
public static final String SECTION_7_ADDENDUM_REPORT_LA = "section7AddendumReportLa";
public static final String LOCAL_AUTHORITY_INVOLVEMENT_LA = "localAuthorityInvolvementLa";
public static final String SECTION_47_LA = "section47La";
public static final String CIR_EXTENSION_REQUEST_LA = "cirExtensionRequestLa";
public static final String CIR_TRANSFER_REQUEST_LA = "cirTransferRequestLa";
public static final String LA_OTHER_DOCS = "localAuthorityOtherDoc";
public static final String ORDERS_SUBMITTED_WITH_APPLICATION = "ordersSubmittedWithApplication";
public static final String APPROVED_ORDERS = "approvedOrders";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,7 @@ public class PrlAppsConstants {
public static final String HMC_STATUS_COMPLETED = "COMPLETED";

public static final String CAFCASS = "Cafcass";
public static final String LOCAL_AUTHORITY = "LOCAL_AUTHORITY";//TODO review the value later

public static final String APPLICANTS = "applicants";
public static final String RESPONDENTS = "respondents";
Expand Down Expand Up @@ -1144,6 +1145,9 @@ public class PrlAppsConstants {

public static final String IS_INVOKED_FROM_TASK = "isInvokedFromTask";
public static final String ALLOCATED_BARRISTER = "allocatedBarrister";
public static final String LOCAL_AUTHORITY_SOLICITOR_ORGANISATION_POLICY = "localAuthoritySolicitorOrganisationPolicy";
public static final String LOCAL_AUTHORITY_DATA = "localAuthority";
public static final String LOCAL_AUTHORITY_SOLICITOR_CASE_ROLE = "[LASOLICITOR]";
public static final String CAFCASS_DATE_TIME = "cafcassDateTime";
public static final String PERMISSION_REQUIRED_DOCUMENT = "uploadOrderDocForPermission";
public static final String MESSAGE_REPLY_DYNAMIC_LIST = "messageReplyDynamicList";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ public AboutToStartOrSubmitCallbackResponse sendEmailNotificationOnClosingOrder(
//SNI-4330 fix
//update caseSummaryTab with latest state
ManageOrderService.cleanUpServeOrderOptions(caseDataUpdated);

manageOrderService.removeLocalAuthorityFromCase(caseData, caseDataUpdated);

allTabService.submitAllTabsUpdate(
startAllTabsUpdateDataContent.authorisation(),
String.valueOf(callbackRequest.getCaseDetails().getId()),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
package uk.gov.hmcts.reform.prl.controllers.localauthority;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import uk.gov.hmcts.reform.ccd.client.model.AboutToStartOrSubmitCallbackResponse;
import uk.gov.hmcts.reform.ccd.client.model.CallbackRequest;
import uk.gov.hmcts.reform.prl.controllers.AbstractCallbackController;
import uk.gov.hmcts.reform.prl.enums.YesOrNo;
import uk.gov.hmcts.reform.prl.exception.InvalidClientException;
import uk.gov.hmcts.reform.prl.models.caseaccess.OrganisationPolicy;
import uk.gov.hmcts.reform.prl.models.dto.ccd.CaseData;
import uk.gov.hmcts.reform.prl.models.dto.ccd.LocalAuthority;
import uk.gov.hmcts.reform.prl.services.AuthorisationService;
import uk.gov.hmcts.reform.prl.services.EventService;
import uk.gov.hmcts.reform.prl.services.localauthority.RemoveLocalAuthoritySolicitorService;
import uk.gov.hmcts.reform.prl.utils.CaseUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import static javax.ws.rs.core.MediaType.APPLICATION_JSON;
import static uk.gov.hmcts.reform.prl.constants.PrlAppsConstants.INVALID_CLIENT;
import static uk.gov.hmcts.reform.prl.constants.PrlAppsConstants.LOCAL_AUTHORITY_DATA;
import static uk.gov.hmcts.reform.prl.constants.PrlAppsConstants.LOCAL_AUTHORITY_SOLICITOR_CASE_ROLE;
import static uk.gov.hmcts.reform.prl.constants.PrlAppsConstants.LOCAL_AUTHORITY_SOLICITOR_ORGANISATION_POLICY;
import static uk.gov.hmcts.reform.prl.constants.PrlAppsConstants.SERVICE_AUTHORIZATION_HEADER;

@Slf4j
@RestController
@SecurityRequirement(name = "Bearer Authentication")
@RequestMapping("/localauthority")
public class LocalAuthorityController extends AbstractCallbackController {
private final AuthorisationService authorisationService;
private final RemoveLocalAuthoritySolicitorService removeLocalAuthoritySolver;

@Autowired
public LocalAuthorityController(ObjectMapper objectMapper, EventService eventPublisher,
AuthorisationService authorisationService,
RemoveLocalAuthoritySolicitorService removeLocalAuthoritySolver) {
super(objectMapper, eventPublisher);
this.authorisationService = authorisationService;
this.removeLocalAuthoritySolver = removeLocalAuthoritySolver;
}

@PostMapping(path = "/add/aboutToSubmit", consumes = APPLICATION_JSON, produces = APPLICATION_JSON)
@Operation(description = "Callback to add a Local authority on about to submit")
@SecurityRequirement(name = "Bearer Authentication")
public AboutToStartOrSubmitCallbackResponse handleAddAboutToSubmit(
@RequestHeader(org.springframework.http.HttpHeaders.AUTHORIZATION) @Parameter(hidden = true) String authorisation,
@RequestHeader(SERVICE_AUTHORIZATION_HEADER) String s2sToken,
@RequestBody CallbackRequest callbackRequest) {

log.info("Inside Local authority/add/submitted for case {}", callbackRequest.getCaseDetails().getId());
if (authorisationService.isAuthorized(authorisation, s2sToken)) {
Map<String, Object> caseDataUpdated = callbackRequest.getCaseDetails().getData();
CaseData caseData = objectMapper.convertValue(
callbackRequest.getCaseDetails().getData(),
CaseData.class
);

OrganisationPolicy localAuthorityOrganisationPolicy = caseData.getLocalAuthoritySolicitorOrganisationPolicy();
caseDataUpdated.put(
LOCAL_AUTHORITY_SOLICITOR_ORGANISATION_POLICY,
localAuthorityOrganisationPolicy.toBuilder()
.orgPolicyCaseAssignedRole(LOCAL_AUTHORITY_SOLICITOR_CASE_ROLE).build()
);

String organisationName = localAuthorityOrganisationPolicy.getOrganisation().getOrganisationName();
LocalAuthority localAuthority = LocalAuthority.builder().isLocalAuthorityInvolvedInCase(YesOrNo.Yes)
.localAuthoritySolicitorOrganisationName(organisationName)
.build();
caseDataUpdated.put(LOCAL_AUTHORITY_DATA, localAuthority);

return AboutToStartOrSubmitCallbackResponse.builder().data(caseDataUpdated).build();
} else {
throw (new RuntimeException(INVALID_CLIENT));
}
}

@PostMapping(path = "/remove/about-to-start", consumes = APPLICATION_JSON, produces = APPLICATION_JSON)
@Operation(description = "Callback to remove a local authority on about-to-start")
@SecurityRequirement(name = "Bearer Authentication")
public AboutToStartOrSubmitCallbackResponse handleRemoveAboutToStart(
@RequestHeader(org.springframework.http.HttpHeaders.AUTHORIZATION) @Parameter(hidden = true) String authorisation,
@RequestHeader(SERVICE_AUTHORIZATION_HEADER) String s2sToken,
@RequestBody CallbackRequest callbackRequest) {

log.info("Inside localauthority/remove/about-to-start for case {}", callbackRequest.getCaseDetails().getId());
if (authorisationService.isAuthorized(authorisation, s2sToken)) {
CaseData caseData = CaseUtils.getCaseData(callbackRequest.getCaseDetails(), objectMapper);
List<String> errorList = new ArrayList<>();

if (null == caseData.getLocalAuthoritySolicitorOrganisationPolicy()
|| null == caseData.getLocalAuthoritySolicitorOrganisationPolicy().getOrganisation()) {
log.info("No Local authority currently assigned to the case.");
errorList.add("No Local authority currently assigned to the case.");
}

return AboutToStartOrSubmitCallbackResponse.builder()
.data(callbackRequest.getCaseDetails().getData())
.errors(errorList).build();
} else {
throw (new InvalidClientException(INVALID_CLIENT));
}
}

@PostMapping(path = "/remove/aboutToSubmit", consumes = APPLICATION_JSON, produces = APPLICATION_JSON)
@Operation(description = "Callback to remove a local authority on about to submit")
@SecurityRequirement(name = "Bearer Authentication")
public AboutToStartOrSubmitCallbackResponse handleRemoveAboutToSubmit(
@RequestHeader(org.springframework.http.HttpHeaders.AUTHORIZATION) @Parameter(hidden = true) String authorisation,
@RequestHeader(SERVICE_AUTHORIZATION_HEADER) String s2sToken,
@RequestBody CallbackRequest callbackRequest) {

log.info("Inside local authority/remove/about to submit for case {}", callbackRequest.getCaseDetails().getId());
if (authorisationService.isAuthorized(authorisation, s2sToken)) {

CaseData caseData = objectMapper.convertValue(
callbackRequest.getCaseDetails().getData(),
CaseData.class
);
List<String> errorList = new ArrayList<>();
Map<String, Object> caseDataUpdated = callbackRequest.getCaseDetails().getData();

if (null != caseData.getLocalAuthoritySolicitorOrganisationPolicy()
&& null != caseData.getLocalAuthoritySolicitorOrganisationPolicy().getOrganisation()) {
removeLocalAuthoritySolver.removeLocalAuthoritySolicitor(caseData);
caseDataUpdated.remove(LOCAL_AUTHORITY_SOLICITOR_ORGANISATION_POLICY);

LocalAuthority localAuthority = LocalAuthority.builder().isLocalAuthorityInvolvedInCase(YesOrNo.No)
.localAuthoritySolicitorOrganisationName(null)
.build();
caseDataUpdated.put(LOCAL_AUTHORITY_DATA, localAuthority);
} else {
errorList.add("No Local authority currently assigned to the case");
}

return AboutToStartOrSubmitCallbackResponse.builder().data(caseDataUpdated)
.errors(errorList)
.build();
} else {
throw (new RuntimeException(INVALID_CLIENT));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,19 @@ public enum DocTypeOtherDocumentsEnum {
@JsonProperty("otherDocs")
otherDocs("otherDocs", "Cafcass/Cafcass Cymru other documents"),
@JsonProperty("sec37Report")
sec37Report("sec37Report","Section 37 report"),
sec37Report("sec37Report","Section 37 (S37) report"),
@JsonProperty("childImpactReport1La")
childImpactReport1La("childImpactReport1La","Child Impact Report 1"),
@JsonProperty("childImpactReport2La")
childImpactReport2La("childImpactReport2La","Child Impact Report 2"),
@JsonProperty("section7ReportLa")
section7ReportLa("section7ReportLa","Section 7 report"),
@JsonProperty("section7AddendumReportLa")
section7AddendumReportLa("section7AddendumReportLa","Section 7 addendum report"),
@JsonProperty("localAuthorityInvolvementLa")
localAuthorityInvolvementLa("localAuthorityInvolvementLa","Local Authority involvement letter"),
@JsonProperty("section47La")
section47La("section47La","Section 47 enquiry"),
@JsonProperty("localAuthorityOtherDoc")
localAuthorityOtherDoc("localAuthorityOtherDoc","Local Authority other documents"),
@JsonProperty("medicalReports")
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/uk/gov/hmcts/reform/prl/enums/Roles.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ public enum Roles {
BULK_SCAN("BULK_SCAN","caseworker-privatelaw-bulkscan"),
SYSTEM_UPDATE("SYSTEM_UPDATE","caseworker-privatelaw-systemupdate"),
COURTNAV("COURTNAV","courtnav"),
ALLOCATED_LEGAL_ADVISER("ALLOCATED_LEGAL_ADVISER","allocated-legal-adviser");
ALLOCATED_LEGAL_ADVISER("ALLOCATED_LEGAL_ADVISER","allocated-legal-adviser"),
LOCAL_AUTHORITY_STAFF("LASOCIALWORKER", "[LASOCIALWORKER]"),
LOCAL_AUTHORITY_SOLICITOR("LASOLICITOR","[LASOLICITOR]");


private final String id;
private final String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ public enum InternalCaseworkerAmRolesEnum {
COURT_ADMIN("COURT_ADMIN", List.of("hearing-centre-admin", "ctsc")),
COURT_ADMIN_TEAM_LEADER("COURT_ADMIN_TEAM_LEADER", List.of("hearing-centre-admin", "ctsc", "team-leader")),
CTSC("CTSC", List.of("ctsc")),
CAFCASS_CYMRU("CAFCASS_CYMRU", List.of("caseworker-privatelaw-externaluser-viewonly"));
CAFCASS_CYMRU("CAFCASS_CYMRU", List.of("caseworker-privatelaw-externaluser-viewonly")),
LOCAL_AUTHORITY("LOCAL_AUTHORITY", List.of("[LASOCIALWORKER]", "[LASOLICITOR]"));

private final String user;
private final List<String> roles;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,30 @@ public enum BundlingDocGroupEnum {
@JsonProperty("laSection37Report")
laSection37Report("laSection37Report", "laSection37Report"),

@JsonProperty("laSectionChildImpactReport1Report")
laSectionChildImpactReport1Report("laSectionChildImpactReport1Report", "laSectionChildImpactReport1Report"),

@JsonProperty("laSectionChildImpactReport2Report")
laSectionChildImpactReport2Report("laSectionChildImpactReport2Report", "laSectionChildImpactReport2Report"),

@JsonProperty("laSectionSection7ReportReport")
laSectionSection7ReportReport("laSectionSection7ReportReport", "laSectionSection7ReportReport"),

@JsonProperty("laSectionSection7AddendumReportReport")
laSectionSection7AddendumReportReport("laSectionSection7AddendumReportReport", "laSectionSection7AddendumReportReport"),

@JsonProperty("laSectionLocalAuthorityInvolvementReport")
laSectionLocalAuthorityInvolvementReport("laSectionLocalAuthorityInvolvementReport", "laSectionLocalAuthorityInvolvementReport"),

@JsonProperty("laSectionSection47EnquiryReport")
laSectionSection47EnquiryReport("laSectionSection47EnquiryReport", "laSectionSection47EnquiryReport"),

@JsonProperty("laSectionCirExtensionRequestReport")
laSectionCirExtensionRequestReport("laSectionCirExtensionRequestReport", "laSectionCirExtensionRequestReport"),

@JsonProperty("laSectionCirTransferRequestReport")
laSectionCirTransferRequestReport("laSectionCirTransferRequestReport", "laSectionCirTransferRequestReport"),

@JsonProperty("laOtherDocuments")
laOtherDocuments("laOtherDocuments", "laOtherDocuments"),

Expand Down
Loading