From 85761d3e0e7137fb888cd9a0ce7c5d628c1bd8aa Mon Sep 17 00:00:00 2001 From: Phil Payne Date: Thu, 18 Jan 2024 13:05:41 +0000 Subject: [PATCH] PR Amendments --- caab-api/open-api-specification.yml | 16 +++++++++------- ...BaseApplicationControllerIntegrationTest.java | 6 +++--- .../api/controller/ApplicationController.java | 6 +++--- .../laa/ccms/caab/api/entity/Application.java | 2 +- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/caab-api/open-api-specification.yml b/caab-api/open-api-specification.yml index 5280700..0a48eaf 100644 --- a/caab-api/open-api-specification.yml +++ b/caab-api/open-api-specification.yml @@ -354,7 +354,7 @@ paths: get: tags: - applications - summary: 'Get an application''s prior authorities' + summary: 'Get an application''s cost structure' operationId: 'getApplicationCostStructure' parameters: - name: 'id' @@ -417,6 +417,7 @@ paths: /applications/{id}/linked-cases: get: tags: + - applications - linked cases summary: 'Get an application''s linked cases' operationId: 'getApplicationLinkedCases' @@ -447,6 +448,7 @@ paths: description: 'Internal server error' post: tags: + - applications - linked cases summary: 'Add a linked case to an application' operationId: 'addApplicationLinkedCase' @@ -484,8 +486,8 @@ paths: delete: tags: - linked cases - summary: 'Remove a linked case from an application' - operationId: 'removeApplicationLinkedCase' + summary: 'Remove a linked case' + operationId: 'removeLinkedCase' parameters: - name: 'linked-case-id' in: 'path' @@ -513,8 +515,8 @@ paths: patch: tags: - linked cases - summary: 'Update a linked case of an application' - operationId: 'updateApplicationLinkedCase' + summary: 'Update a linked case ' + operationId: 'updateLinkedCase' parameters: - name: 'linked-case-id' in: 'path' @@ -680,8 +682,8 @@ paths: get: tags: - scope limitations - summary: 'Get a proceedings''s scope limitations' - operationId: 'getApplicationScopeLimitations' + summary: 'Get a proceeding''s scope limitations' + operationId: 'getProceedingsScopeLimitations' parameters: - name: 'proceeding-id' in: 'path' diff --git a/caab-service/src/integrationTest/java/uk/gov/laa/ccms/data/api/controller/BaseApplicationControllerIntegrationTest.java b/caab-service/src/integrationTest/java/uk/gov/laa/ccms/data/api/controller/BaseApplicationControllerIntegrationTest.java index cd8c6fd..0d8928b 100644 --- a/caab-service/src/integrationTest/java/uk/gov/laa/ccms/data/api/controller/BaseApplicationControllerIntegrationTest.java +++ b/caab-service/src/integrationTest/java/uk/gov/laa/ccms/data/api/controller/BaseApplicationControllerIntegrationTest.java @@ -413,7 +413,7 @@ public void deleteLinkedCase() { Long caseRef = 41L; Long linkedCaseRef = 2L; - applicationController.removeApplicationLinkedCase(linkedCaseRef, caabUserLoginId); + applicationController.removeLinkedCase(linkedCaseRef, caabUserLoginId); ResponseEntity> responseEntity = applicationController.getApplicationLinkedCases(caseRef); assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); @@ -511,7 +511,7 @@ public void updateScopeLimitationInProceeding() throws IOException { public void getScopeLimitationsForProceeding() { Long proceedingId = 2L; - ResponseEntity> responseEntity = applicationController.getApplicationScopeLimitations(proceedingId); + ResponseEntity> responseEntity = applicationController.getProceedingsScopeLimitations(proceedingId); assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); assertNotNull(responseEntity.getBody()); @@ -531,7 +531,7 @@ public void removeScopeLimitationFromProceeding() { ResponseEntity response = applicationController.removeScopeLimitation(scopeLimitationId, caabUserLoginId); assertEquals(HttpStatus.NO_CONTENT, response.getStatusCode()); - ResponseEntity> responseEntity = applicationController.getApplicationScopeLimitations(2L); + ResponseEntity> responseEntity = applicationController.getProceedingsScopeLimitations(2L); assertEquals(HttpStatus.OK, responseEntity.getStatusCode()); assertNotNull(responseEntity.getBody()); diff --git a/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/controller/ApplicationController.java b/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/controller/ApplicationController.java index 5c27d96..3e89d13 100644 --- a/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/controller/ApplicationController.java +++ b/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/controller/ApplicationController.java @@ -276,7 +276,7 @@ public ResponseEntity addApplicationLinkedCase( * @return a ResponseEntity with no content */ @Override - public ResponseEntity updateApplicationLinkedCase( + public ResponseEntity updateLinkedCase( final Long linkedCaseId, final String caabUserLoginId, final LinkedCase linkedCase) { @@ -292,7 +292,7 @@ public ResponseEntity updateApplicationLinkedCase( * @return a ResponseEntity indicating the case was successfully removed */ @Override - public ResponseEntity removeApplicationLinkedCase( + public ResponseEntity removeLinkedCase( final Long linkedCaseId, final String caabUserLoginId) { linkedCaseService.removeLinkedCase(linkedCaseId); @@ -346,7 +346,7 @@ public ResponseEntity addProceedingScopeLimitation( } @Override - public ResponseEntity> getApplicationScopeLimitations( + public ResponseEntity> getProceedingsScopeLimitations( final Long proceedingId) { List scopeLimitations = proceedingService.getScopeLimitationsForProceeding(proceedingId); diff --git a/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/entity/Application.java b/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/entity/Application.java index 90ab118..1d4d0de 100644 --- a/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/entity/Application.java +++ b/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/entity/Application.java @@ -160,7 +160,7 @@ public class Application implements Serializable { private Address correspondenceAddress; @OneToMany(mappedBy = "application", cascade = CascadeType.ALL, orphanRemoval = true) - @OrderBy("id asc") + @OrderBy("leadProceedingInd desc, id asc") private List proceedings; @OneToMany(mappedBy = "application", cascade = CascadeType.ALL, orphanRemoval = true)