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 Jan 31, 2024
1 parent 5247a36 commit 4f1512b
Show file tree
Hide file tree
Showing 17 changed files with 698 additions and 20 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: 'app-or-cert-type'
in: 'query'
schema:
type: 'string'
example: 'ABC'
- name: 'lar-scope'
in: 'query'
schema:
type: 'string'
example: 'ABC'
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
import uk.gov.laa.ccms.data.model.AwardTypeLookupDetail;
import uk.gov.laa.ccms.data.model.CaseStatusLookupDetail;
import uk.gov.laa.ccms.data.model.CategoryOfLawLookupDetail;
import uk.gov.laa.ccms.data.model.ClientInvolvementTypeLookupDetail;
import uk.gov.laa.ccms.data.model.CommonLookupDetail;
import uk.gov.laa.ccms.data.model.LevelOfServiceLookupDetail;
import uk.gov.laa.ccms.data.model.MatterTypeLookupDetail;
import uk.gov.laa.ccms.data.model.OutcomeResultLookupDetail;
import uk.gov.laa.ccms.data.model.RelationshipToCaseLookupDetail;
import uk.gov.laa.ccms.data.model.StageEndLookupDetail;
Expand Down Expand Up @@ -66,6 +69,46 @@ public ResponseEntity<CommonLookupDetail> getCountriesLookupValues(
return ResponseEntity.ok(lookupService.getCountryLookupValues(code, pageable));
}

@Override
public ResponseEntity<LevelOfServiceLookupDetail> getLevelOfServiceLookupValues(
final String proceedingCode,
final String matterType,
final String categoryOfLaw,
final Pageable pageable) {

return ResponseEntity.ok(lookupService.getLevelOfServiceLookupValues(
proceedingCode,
matterType,
categoryOfLaw,
pageable));
}

@Override
public ResponseEntity<MatterTypeLookupDetail> getMatterTypeLookupValues(
final String description,
final String matterType,
final String categoryOfLaw,
final Pageable pageable) {

return ResponseEntity.ok(lookupService.getMatterTypeLookupValues(
description,
matterType,
categoryOfLaw,
pageable));
}

@Override
public ResponseEntity<ClientInvolvementTypeLookupDetail>
getProceedingClientInvolvementTypeLookupValues(
final String proceedingCode,
final String clientInvolvementType,
final Pageable pageable) {

return ResponseEntity.ok(lookupService.getClientInvolvementTypeLookupValues(
proceedingCode,
clientInvolvementType,
pageable));
}


/**
Expand Down Expand Up @@ -134,6 +177,8 @@ public ResponseEntity<RelationshipToCaseLookupDetail> getPersonToCaseRelationshi
code, description, pageable));
}



/**
* GET organisation to case relationship lookup values.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,45 @@ public class ProceedingController implements ProceedingsApi {
* GET Proceedings by category of law, matter type, whether they are enabled,
* and whether they are amendment-only proceedings.
*
* @param categoryOfLawCode - the category of law code
* @param categoryOfLaw - the category of law code
* @param matterType - the matter type
* @param enabled - whether the proceeding is enabled
* @param amendmentOnly - whether the proceeding is amendment-only
* @param pageable - the pagination settings
* @return ResponseEntity with the results of the search
*/
@Override
public ResponseEntity<ProceedingDetails> getProceedings(String categoryOfLawCode,
String matterType, Boolean amendmentOnly, Boolean enabled, Pageable pageable) {
return ResponseEntity.ok(proceedingService.getProceedings(
categoryOfLawCode,
matterType,
enabled,
amendmentOnly,
pageable));
public ResponseEntity<ProceedingDetails> getProceedings(
final String categoryOfLaw,
final String matterType,
final Boolean amendmentOnly,
final Boolean enabled,
final Boolean lead,
final String appOrCertType,
final String larScope,
final Pageable pageable) {

if (lead != null && lead) {
return ResponseEntity.ok(proceedingService.getLeadProceedings(
categoryOfLaw,
matterType,
amendmentOnly,
enabled,
appOrCertType,
larScope,
pageable));
} else {
return ResponseEntity.ok(proceedingService.getProceedings(
categoryOfLaw,
matterType,
amendmentOnly,
enabled,
larScope,
pageable));
}
}


/**
* Retrieves a proceeding by its code.
*
Expand All @@ -61,4 +82,5 @@ public ResponseEntity<ProceedingDetail> getProceeding(String code) {
.map(ResponseEntity::ok)
.orElse(ResponseEntity.notFound().build());
}

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

import com.fasterxml.jackson.databind.PropertyNamingStrategies;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import jakarta.persistence.Column;
import jakarta.persistence.EmbeddedId;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Immutable;

/**
* Represents a Level Of service lookup value entity.
*/
@Entity
@Data
@NoArgsConstructor
@Table(name = "XXCCMS_LEVEL_OF_SERVICE_V")
@Immutable
@JsonNaming(PropertyNamingStrategies.SnakeCaseStrategy.class)
public class LevelOfService {

@EmbeddedId
private LevelOfServiceId id;

@Column(name = "LEVEL_OF_SERVICE_CODE")
private String levelOfServiceCode;

@Column(name = "DESCRIPTION")
private String description;

@Column(name = "DEFAULT_CODE")
private String defaultCode;
}
Loading

0 comments on commit 4f1512b

Please sign in to comment.