diff --git a/src/main/java/uk/gov/hmcts/reform/civil/documentmanagement/model/DocumentType.java b/src/main/java/uk/gov/hmcts/reform/civil/documentmanagement/model/DocumentType.java index b806e652..2a6ac033 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/documentmanagement/model/DocumentType.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/documentmanagement/model/DocumentType.java @@ -19,6 +19,8 @@ public enum DocumentType { COURT_OFFICER_ORDER, DEFENCE_TRANSLATED_DOCUMENT, DRAFT_CLAIM_FORM, + REQUEST_FOR_RECONSIDERATION, + FIXED_RECOVERABLE_COST_SUPPORTING_DOCUMENT, //General Application Document Type GENERAL_ORDER, DIRECTION_ORDER, diff --git a/src/main/java/uk/gov/hmcts/reform/civil/referencedata/LocationRefDataService.java b/src/main/java/uk/gov/hmcts/reform/civil/referencedata/LocationRefDataService.java index 53d8a843..0744c835 100644 --- a/src/main/java/uk/gov/hmcts/reform/civil/referencedata/LocationRefDataService.java +++ b/src/main/java/uk/gov/hmcts/reform/civil/referencedata/LocationRefDataService.java @@ -58,6 +58,31 @@ public LocationRefData getCcmccLocation(String authToken) { return LocationRefData.builder().build(); } + public LocationRefData getCnbcLocation(String authToken) { + try { + ResponseEntity> responseEntity = restTemplate.exchange( + buildURIforCnbcSpec(), + HttpMethod.GET, + getHeaders(authToken), + new ParameterizedTypeReference>() { + } + ); + List cnbcLocations = responseEntity.getBody(); + if (cnbcLocations == null || cnbcLocations.isEmpty()) { + log.warn("Location Reference Data Lookup did not return any CNBC location"); + return LocationRefData.builder().build(); + } else { + if (cnbcLocations.size() > 1) { + log.warn("Location Reference Data Lookup returned more than one CNBC location"); + } + return cnbcLocations.get(0); + } + } catch (Exception e) { + log.error("Location Reference Data Lookup Failed - " + e.getMessage(), e); + } + return LocationRefData.builder().build(); + } + public List getCourtLocationsForDefaultJudgments(String authToken) { try { ResponseEntity> responseEntity = restTemplate.exchange( @@ -140,6 +165,13 @@ private URI buildURIforCcmcc() { return builder.buildAndExpand(new HashMap<>()).toUri(); } + private URI buildURIforCnbcSpec() { + String queryURL = lrdConfiguration.getUrl() + lrdConfiguration.getEndpoint(); + UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(queryURL) + .queryParam("court_venue_name", "Civil National Business Centre"); + return builder.buildAndExpand(new HashMap<>()).toUri(); + } + private URI buildURIForDefaultJudgments() { String queryURL = lrdConfiguration.getUrl() + lrdConfiguration.getEndpoint(); UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(queryURL)