Skip to content

Commit

Permalink
feature(CCLS-1974) proceedings and costs amendments for ebs-api
Browse files Browse the repository at this point in the history
Includes:
- CCLS-2044 amended proceedings endpoint for lead proceedings
- CCLS-2045 client involvement type endpoint
- CCLS-2046 level of service endpoint
- CCLS-2043 matter types endpoint
  • Loading branch information
PhilDigitalJustice committed Feb 1, 2024
1 parent 5247a36 commit 25d7a0d
Show file tree
Hide file tree
Showing 29 changed files with 1,282 additions and 75 deletions.
187 changes: 187 additions & 0 deletions data-api/open-api-specification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,21 @@ paths:
schema:
type: 'boolean'
example: 'true'
- name: 'lead'
in: 'query'
schema:
type: 'boolean'
example: 'true'
- name: 'application-type'
in: 'query'
schema:
type: 'string'
example: 'ABC'
- name: 'lar-scope-flag'
in: 'query'
schema:
type: 'boolean'
example: 'true'
responses:
'200':
description: 'Successful operation'
Expand Down Expand Up @@ -579,6 +594,115 @@ paths:
description: 'Not found'
'500':
description: 'Internal server error'
/lookup/matter-types:
get:
tags:
- lookup
summary: 'Get Matter Type Lookup Values'
operationId: 'getMatterTypeLookupValues'
x-spring-paginated: true
parameters:
- name: 'description'
in: 'query'
schema:
type: 'string'
example: 'ABC'
- name: 'matter-type'
in: 'query'
schema:
type: 'string'
example: 'ABC'
- name: 'category-of-law'
in: 'query'
schema:
type: 'string'
example: 'ABC'
responses:
'200':
description: 'Successful operation'
content:
application/json:
schema:
$ref: "#/components/schemas/matterTypeLookupDetail"
'400':
description: 'Bad request'
'401':
description: 'Unauthorized'
'404':
description: 'Not found'
'500':
description: 'Internal server error'
/lookup/level-of-service:
get:
tags:
- lookup
summary: 'Get Level of service Lookup Values'
operationId: 'getLevelOfServiceLookupValues'
x-spring-paginated: true
parameters:
- name: 'proceeding-code'
in: 'query'
schema:
type: 'string'
example: 'ABC'
- name: 'matter-type'
in: 'query'
schema:
type: 'string'
example: 'ABC'
- name: 'category-of-law'
in: 'query'
schema:
type: 'string'
example: 'ABC'
responses:
'200':
description: 'Successful operation'
content:
application/json:
schema:
$ref: "#/components/schemas/levelOfServiceLookupDetail"
'400':
description: 'Bad request'
'401':
description: 'Unauthorized'
'404':
description: 'Not found'
'500':
description: 'Internal server error'
/lookup/proceeding-client-involvement-types:
get:
tags:
- lookup
summary: 'Get Proceeding client involvement type lookup values'
operationId: 'getProceedingClientInvolvementTypeLookupValues'
x-spring-paginated: true
parameters:
- name: 'proceeding-code'
in: 'query'
schema:
type: 'string'
example: 'ABC'
- name: 'client-involvement-type'
in: 'query'
schema:
type: 'string'
example: 'ABC'
responses:
'200':
description: 'Successful operation'
content:
application/json:
schema:
$ref: "#/components/schemas/clientInvolvementTypeLookupDetail"
'400':
description: 'Bad request'
'401':
description: 'Unauthorized'
'404':
description: 'Not found'
'500':
description: 'Internal server error'
/lookup/common:
get:
tags:
Expand Down Expand Up @@ -883,6 +1007,69 @@ components:
type: 'string'
copy_cost_limit:
type: 'boolean'
matterTypeLookupDetail:
allOf:
- $ref: "#/components/schemas/page"
type: 'object'
properties:
content:
type: 'array'
default: []
items:
$ref: '#/components/schemas/matterTypeLookupValueDetail'
matterTypeLookupValueDetail:
type: 'object'
properties:
matter_type:
type: 'string'
description:
type: 'string'
category_of_law_code:
type: 'string'
levelOfServiceLookupDetail:
allOf:
- $ref: "#/components/schemas/page"
type: 'object'
properties:
content:
type: 'array'
default: []
items:
$ref: '#/components/schemas/levelOfServiceLookupValueDetail'
levelOfServiceLookupValueDetail:
type: 'object'
properties:
proceeding_code:
type: 'string'
matter_type:
type: 'string'
description:
type: 'string'
category_of_law_code:
type: 'string'
level_of_service_code:
type: 'string'
default_code:
type: 'string'
clientInvolvementTypeLookupDetail:
allOf:
- $ref: "#/components/schemas/page"
type: 'object'
properties:
content:
type: 'array'
default: []
items:
$ref: '#/components/schemas/clientInvolvementTypeLookupValueDetail'
clientInvolvementTypeLookupValueDetail:
type: 'object'
properties:
proceeding_code:
type: 'string'
client_involvement_type:
type: 'string'
client_involvement_type_name:
type: 'string'
scopeLimitationDetails:
allOf:
- $ref: "#/components/schemas/page"
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package uk.gov.laa.ccms.data;

import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.DynamicPropertyRegistry;
import org.springframework.test.context.DynamicPropertySource;
import org.testcontainers.junit.jupiter.Testcontainers;

@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
@Testcontainers
@DirtiesContext
public interface IntegrationTestInterface {

OracleContainerSingleton oracleContainerSingleton = OracleContainerSingleton.getInstance();

@DynamicPropertySource
static void properties(DynamicPropertyRegistry registry) {
registry.add("spring.datasource.url", oracleContainerSingleton.getOracleContainer()::getJdbcUrl);
registry.add("spring.datasource.username", oracleContainerSingleton.getOracleContainer()::getUsername);
registry.add("spring.datasource.password", oracleContainerSingleton.getOracleContainer()::getPassword);
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package uk.gov.laa.ccms.data;

import org.testcontainers.containers.OracleContainer;

public class OracleContainerSingleton {

private static OracleContainerSingleton instance;
private final OracleContainer oracleContainer;

private OracleContainerSingleton() {
oracleContainer = new OracleContainer("gvenzl/oracle-xe:21-slim-faststart");
oracleContainer.start();
}

public static synchronized OracleContainerSingleton getInstance() {
if (instance == null) {
instance = new OracleContainerSingleton();
}
return instance;
}

public OracleContainer getOracleContainer() {
return oracleContainer;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import org.springframework.data.domain.Pageable;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.jdbc.SqlMergeMode;
import uk.gov.laa.ccms.data.AbstractIntegrationTest;
import uk.gov.laa.ccms.data.IntegrationTestInterface;
import uk.gov.laa.ccms.data.model.AwardTypeLookupDetail;
import uk.gov.laa.ccms.data.model.CaseStatusLookupDetail;
import uk.gov.laa.ccms.data.model.CategoryOfLawLookupDetail;
Expand All @@ -29,7 +29,7 @@
@SqlMergeMode(MERGE)
@Sql(executionPhase=BEFORE_TEST_METHOD,scripts="/sql/lookup_create_schema.sql" )
@Sql(executionPhase=AFTER_TEST_METHOD,scripts="/sql/lookup_drop_schema.sql")
public class LookupServiceIntegrationTest extends AbstractIntegrationTest {
public class LookupServiceIntegrationTest implements IntegrationTestInterface {

@Autowired
private LookupService lookupService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
import org.springframework.data.domain.Pageable;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.jdbc.SqlMergeMode;
import uk.gov.laa.ccms.data.AbstractIntegrationTest;
import uk.gov.laa.ccms.data.IntegrationTestInterface;
import uk.gov.laa.ccms.data.model.PriorAuthorityTypeDetails;


@SpringBootTest
@SqlMergeMode(MERGE)
@Sql(executionPhase=BEFORE_TEST_METHOD,scripts="/sql/prior_authority_create_schema.sql" )
@Sql(executionPhase=AFTER_TEST_METHOD,scripts="/sql/prior_authority_drop_schema.sql")
public class PriorAuthorityServiceIntegrationTest extends AbstractIntegrationTest {
public class PriorAuthorityServiceIntegrationTest implements IntegrationTestInterface {

@Autowired
private PriorAuthorityService priorAuthorityService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
import org.springframework.data.domain.Pageable;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.jdbc.SqlMergeMode;
import uk.gov.laa.ccms.data.AbstractIntegrationTest;
import uk.gov.laa.ccms.data.IntegrationTestInterface;
import uk.gov.laa.ccms.data.model.ProceedingDetail;
import uk.gov.laa.ccms.data.model.ProceedingDetails;

@SpringBootTest
@SqlMergeMode(MERGE)
@Sql(executionPhase = BEFORE_TEST_METHOD, scripts = "/sql/proceedings_create_schema.sql")
@Sql(executionPhase = AFTER_TEST_METHOD, scripts = "/sql/proceedings_drop_schema.sql")
public class ProceedingServiceIntegrationTest extends AbstractIntegrationTest {
public class ProceedingServiceIntegrationTest implements IntegrationTestInterface {

@Autowired
private ProceedingService proceedingService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.jdbc.SqlMergeMode;
import uk.gov.laa.ccms.data.AbstractIntegrationTest;
import uk.gov.laa.ccms.data.entity.ProviderContact;
import uk.gov.laa.ccms.data.IntegrationTestInterface;
import uk.gov.laa.ccms.data.model.ContactDetail;
import uk.gov.laa.ccms.data.model.OfficeDetail;
import uk.gov.laa.ccms.data.model.ProviderDetail;
Expand All @@ -24,7 +23,7 @@
@SqlMergeMode(MERGE)
@Sql(executionPhase = BEFORE_TEST_METHOD, scripts = "/sql/providers_create_schema.sql")
@Sql(executionPhase = AFTER_TEST_METHOD, scripts = "/sql/providers_drop_schema.sql")
public class ProviderServiceIntegrationTest extends AbstractIntegrationTest {
public class ProviderServiceIntegrationTest implements IntegrationTestInterface {

@Autowired
private ProviderService providerService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
import org.springframework.data.domain.Pageable;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.jdbc.SqlMergeMode;
import uk.gov.laa.ccms.data.AbstractIntegrationTest;
import uk.gov.laa.ccms.data.IntegrationTestInterface;
import uk.gov.laa.ccms.data.model.ScopeLimitationDetails;

@SpringBootTest
@SqlMergeMode(MERGE)
@Sql(executionPhase = BEFORE_TEST_METHOD, scripts = "/sql/scope_limitations_create_schema.sql")
@Sql(executionPhase = AFTER_TEST_METHOD, scripts = "/sql/scope_limitations_drop_schema.sql")
public class ScopeLimitationServiceIntegrationTest extends AbstractIntegrationTest {
public class ScopeLimitationServiceIntegrationTest implements IntegrationTestInterface {

@Autowired
private ScopeLimitationService scopeLimitationService;
Expand Down
Loading

0 comments on commit 25d7a0d

Please sign in to comment.