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) diff --git a/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/LinkedCaseRepository.java b/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/LinkedCaseRepository.java index 26576b4..6181715 100644 --- a/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/LinkedCaseRepository.java +++ b/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/LinkedCaseRepository.java @@ -4,7 +4,7 @@ import uk.gov.laa.ccms.caab.api.entity.LinkedCase; /** - * Repository interface for managing {@link uk.gov.laa.ccms.caab.api.entity.Application} entities. + * Repository interface for managing {@link uk.gov.laa.ccms.caab.api.entity.LinkedCase} entities. * *

This interface provides CRUD (Create, Read, Update, Delete) operations * for the {@link uk.gov.laa.ccms.caab.api.entity.LinkedCase} entity, leveraging the power of diff --git a/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/PriorAuthorityRepository.java b/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/PriorAuthorityRepository.java index e34bc05..4d2ac3a 100644 --- a/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/PriorAuthorityRepository.java +++ b/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/PriorAuthorityRepository.java @@ -5,7 +5,8 @@ import uk.gov.laa.ccms.caab.api.entity.Proceeding; /** - * Repository interface for managing {@link uk.gov.laa.ccms.caab.api.entity.Application} entities. + * Repository interface for managing {@link uk.gov.laa.ccms.caab.api.entity.PriorAuthority} + * entities. * *

This interface provides CRUD (Create, Read, Update, Delete) operations * for the {@link uk.gov.laa.ccms.caab.api.entity.PriorAuthority} entity, leveraging the power of diff --git a/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/ProceedingRepository.java b/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/ProceedingRepository.java index 8b0e512..ddc3dea 100644 --- a/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/ProceedingRepository.java +++ b/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/ProceedingRepository.java @@ -5,7 +5,7 @@ import uk.gov.laa.ccms.caab.api.entity.Proceeding; /** - * Repository interface for managing {@link uk.gov.laa.ccms.caab.api.entity.Application} entities. + * Repository interface for managing {@link uk.gov.laa.ccms.caab.api.entity.Proceeding} entities. * *

This interface provides CRUD (Create, Read, Update, Delete) operations * for the {@link uk.gov.laa.ccms.caab.api.entity.Proceeding} entity, leveraging the power of diff --git a/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/ScopeLimitationRepository.java b/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/ScopeLimitationRepository.java index 1970f6d..cdc5199 100644 --- a/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/ScopeLimitationRepository.java +++ b/caab-service/src/main/java/uk/gov/laa/ccms/caab/api/repository/ScopeLimitationRepository.java @@ -5,7 +5,8 @@ import uk.gov.laa.ccms.caab.api.entity.ScopeLimitation; /** - * Repository interface for managing {@link uk.gov.laa.ccms.caab.api.entity.Application} entities. + * Repository interface for managing {@link uk.gov.laa.ccms.caab.api.entity.ScopeLimitation} + * entities. * *

This interface provides CRUD (Create, Read, Update, Delete) operations * for the {@link uk.gov.laa.ccms.caab.api.entity.ScopeLimitation} entity, leveraging the power of