Skip to content

Commit

Permalink
CCLS-1843 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilDigitalJustice committed Dec 5, 2023
1 parent 3624bbf commit 6ba3cb0
Show file tree
Hide file tree
Showing 16 changed files with 1,424 additions and 174 deletions.
24 changes: 13 additions & 11 deletions caab-api/open-api-specification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ components:
$ref: "#/components/schemas/costEntry"
current_provider_billed_amount:
type: 'number'
auditTrail:
audit_trail:
$ref: "#/components/schemas/auditDetail"
costEntry:
type: 'object'
Expand Down Expand Up @@ -275,8 +275,8 @@ components:
properties:
changed:
type: 'boolean'
at_time_of_merits:
type: 'integer'
limit_at_time_of_merits:
type: 'number'
devolvedPowers:
type: 'object'
properties:
Expand Down Expand Up @@ -327,6 +327,8 @@ components:
type: 'boolean'
stage:
type: 'string'
audit_trail:
$ref: "#/components/schemas/auditDetail"
proceedingOutcome:
type: 'object'
properties:
Expand Down Expand Up @@ -425,7 +427,7 @@ components:
type: 'array'
items:
type: 'string'
auditTrail:
audit_trail:
$ref: "#/components/schemas/auditDetail"
linkedCase:
type: 'object'
Expand All @@ -450,7 +452,7 @@ components:
type: 'string'
client_surname:
type: 'string'
auditTrail:
audit_trail:
$ref: "#/components/schemas/auditDetail"
priorAuthority:
type: 'object'
Expand All @@ -473,7 +475,7 @@ components:
type: 'array'
items:
$ref: "#/components/schemas/referenceDataItem"
auditTrail:
audit_trail:
$ref: "#/components/schemas/auditDetail"
referenceDataItem:
type: 'object'
Expand Down Expand Up @@ -552,7 +554,7 @@ components:
organisation_type:
$ref: "#/components/schemas/stringDisplayValue"
currently_trading:
type: 'string'
type: 'boolean'
contact_name_role:
type: 'string'
confirmed:
Expand All @@ -576,7 +578,7 @@ components:
type: 'string'
party_id:
type: 'string'
auditTrail:
audit_trail:
$ref: "#/components/schemas/auditDetail"
recovery:
type: 'object'
Expand Down Expand Up @@ -654,7 +656,7 @@ components:
type: 'string'
opponent_id:
type: 'string'
auditTrail:
audit_trail:
$ref: "#/components/schemas/auditDetail"
baseAward:
type: 'object'
Expand Down Expand Up @@ -694,7 +696,7 @@ components:
type: 'array'
items:
$ref: '#/components/schemas/liableParty'
auditTrail:
audit_trail:
$ref: "#/components/schemas/auditDetail"
costAward:
allOf:
Expand Down Expand Up @@ -1064,7 +1066,7 @@ components:
type: 'boolean'
submitted:
type: 'boolean'
auditTrail:
audit_trail:
$ref: "#/components/schemas/auditDetail"
required:
- case_reference_number
Expand Down
2 changes: 1 addition & 1 deletion caab-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ task integrationTest(type: Test) {
}

jacocoTestReport {

sourceDirectories.from files('build/generated/sources/annotationProcessor/java/main')
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect {
fileTree(dir: it, exclude: ['**/CaabApiApplication.class'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ private ApplicationDetail buildApplication(){
application.setMeritsAssessmentAmended(meritsAssessmentAmended);
CostLimit costLimitObj = new CostLimit()
.changed(costLimitChanged)
.atTimeOfMerits(Integer.valueOf(String.valueOf(costLimitAtTimeOfMerits)));
.limitAtTimeOfMerits(costLimitAtTimeOfMerits);
application.setCostLimit(costLimitObj);

DevolvedPowers devolvedPowersObj = new DevolvedPowers()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import jakarta.persistence.Access;
import jakarta.persistence.AccessType;
import jakarta.persistence.Column;
import jakarta.persistence.Convert;
import jakarta.persistence.Embedded;
Expand Down Expand Up @@ -65,7 +66,7 @@ public class Address implements Serializable {
private String careOf;

@Column(name = "PREFERRED_ADDRESS", length = 50)
@Access(jakarta.persistence.AccessType.PROPERTY)
@Access(AccessType.PROPERTY)
private String preferredAddress;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package uk.gov.laa.ccms.caab.api.entity;



import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Convert;
Expand All @@ -12,6 +11,7 @@
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.MapKey;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OrderBy;
import jakarta.persistence.SequenceGenerator;
Expand All @@ -20,6 +20,7 @@
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
Expand Down Expand Up @@ -169,6 +170,11 @@ public class Application implements Serializable {
@OrderBy("id asc")
private List<Opponent> opponents;

@OneToMany(mappedBy = "application")
@OrderBy("id asc")
private List<LinkedCase> linkedCases;


@Embedded
private AuditTrail auditTrail = new AuditTrail();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package uk.gov.laa.ccms.caab.api.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Embedded;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.SequenceGenerator;
import jakarta.persistence.Table;
import java.math.BigDecimal;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;

/**
* Represents a case outcome entity associated with the "XXCCMS_CASE_OUTCOME" table.
*
* <p>This entity is utilized to manage and persist case outcome data
* within the CCMS system. It makes use of the "XXCCMS_GENERATED_ID_S"
* sequence for generating unique identifiers.</p>
*/
@Entity
@Table(name = "XXCCMS_CASE_OUTCOME")
@SequenceGenerator(
allocationSize = 1,
sequenceName = "XXCCMS_GENERATED_ID_S",
name = "XXCCMS_CASE_OUTCOME_S")
@Getter
@Setter
@RequiredArgsConstructor
public class CaseOutcome {

@Id
@GeneratedValue(generator = "XXCCMS_CASE_OUTCOME_S")
private Long id;
/**
* audit trail info.
*/
@Embedded
private AuditTrail auditTrail;

@Column(name = "LSC_CASE_REFERENCE", length = 50, nullable = false)
private String lscCaseReference;

@Column(name = "PRE_CERTIFICATE_COSTS", precision = 10, scale = 2)
private BigDecimal preCertificateCosts = new BigDecimal("0.00");
@Column(name = "LEGAL_COSTS", precision = 10, scale = 2)
private BigDecimal legalCosts = new BigDecimal("0.00");
@Column(name = "DISCHARGE_REASON", length = 50)
private String dischargeReason;
@Column(name = "DISCHARGE_CASE_IND", length = 50)
private String dischargeCaseInd;
@Column(name = "CLIENT_CONTINUE_IND", length = 50)
private String clientContinueInd;
@Column(name = "OTHER_DETAILS", length = 1000)
private String otherDetails;
@Column(name = "OFFICE_CODE", length = 30)
private String officeCode;
@Column(name = "UNIQUE_FILE_NO", length = 30)
private String uniqueFileNo;

@Column(name = "PROVIDER_ID", length = 19, nullable = false)
private String providerId;

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

import jakarta.persistence.Column;
import jakarta.persistence.Embedded;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.SequenceGenerator;
import jakarta.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;

/**
* Represents a cost entry entity associated with the "XXCCMS_COST_ENTRY" table.
*
* <p>This entity is utilized to manage and persist cost entry data
* within the CCMS system. It makes use of the "XXCCMS_GENERATED_ID_S"
* sequence for generating unique identifiers.</p>
*/
@Entity
@Table(name = "XXCCMS_COST_ENTRY")
@SequenceGenerator(
allocationSize = 1,
sequenceName = "XXCCMS_GENERATED_ID_S",
name = "XXCCMS_COST_ENTRY_S")
@Setter
@Getter
@RequiredArgsConstructor
public class CostEntry implements Serializable {

@Id
@GeneratedValue(generator = "XXCCMS_COST_ENTRY_S")
private Long id;

/**
* The requested costs.
*/
@Column(name = "REQUESTED_COSTS", precision = 10, scale = 2)
private BigDecimal requestedCosts;

/**
* The cost category.
*/
@Column(name = "COST_CATEGORY", length = 50)
private String costCategory;

/**
* The id for this cost entry in EBS.
*/
@Column(name = "EBS_ID", length = 15)
private String ebsId;

/**
* Has this Cost Entry been seen in EBS. This is to prevent more that one 'Counsel' (CostEntry)
* being added to the case whilst in the PUI editor. To limit only one new 'Counsel' per PUI
* amendment. true (default)= its a new Entry - added during a PUI amendment false = its
* been created from an existing EBS case.
*/
@Column(name = "NEW_ENTRY")
private Boolean newEntry = Boolean.TRUE;

/**
* The LSC ID for the resource these costs belongs to.
*/
@Column(name = "LSC_RESOURCE_ID", length = 15)
private String lscResourceId;

/**
* The name of the resource these costs belongs to.
*/
@Column(name = "RESOURCE_NAME", length = 300)
private String resourceName;

/**
* The parent cost structure.
*/
@ManyToOne
@JoinColumn(name = "FK_COST_STRUCTURE", nullable = false)
private CostStructure costStructure;

@Embedded
private AuditTrail auditTrail;
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package uk.gov.laa.ccms.caab.api.entity;

import jakarta.persistence.CascadeType;
import jakarta.persistence.Column;
import jakarta.persistence.Embedded;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.OneToMany;
import jakarta.persistence.OrderBy;
import jakarta.persistence.SequenceGenerator;
import jakarta.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
Expand Down Expand Up @@ -44,6 +48,10 @@ public class CostStructure implements Serializable {
@Column(name = "GRANTED_COST_LIMITATION", precision = 10, scale = 2)
private BigDecimal grantedCostLimitation = new BigDecimal(0);

@OneToMany(mappedBy = "costStructure", cascade = CascadeType.ALL, orphanRemoval = true)
@OrderBy("id ASC ")
private List<CostEntry> costEntries;

@Embedded
private AuditTrail auditTrail;

Expand Down
Loading

0 comments on commit 6ba3cb0

Please sign in to comment.