diff --git a/crime-evidence/build.gradle b/crime-evidence/build.gradle index 9c82fd5..c63b7db 100644 --- a/crime-evidence/build.gradle +++ b/crime-evidence/build.gradle @@ -17,6 +17,7 @@ jacoco { def versions = [ pitest : "1.16.0", crimeCommonsClasses : "3.4.0", + commonsModSchemas : "1.3.3", commonsRestClient : "3.4.0", wmStubRunnerVersion : "4.1.2", springDocWebMVCVersion: "2.5.0", @@ -40,6 +41,7 @@ repositories { dependencies { implementation "uk.gov.justice.service.laa-crime:crime-commons-spring-boot-starter-rest-client:$versions.commonsRestClient:all" implementation "uk.gov.justice.service.laa-crime:crime-commons-classes:$versions.crimeCommonsClasses" + implementation "uk.gov.justice.service.laa-crime:crime-commons-mod-schemas:$versions.commonsModSchemas" implementation "org.springframework.boot:spring-boot-starter-validation" implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server" diff --git a/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/builder/CapitalEvidenceDTOBuilder.java b/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/builder/CapitalEvidenceDTOBuilder.java index eabb6c8..cf9a8aa 100644 --- a/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/builder/CapitalEvidenceDTOBuilder.java +++ b/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/builder/CapitalEvidenceDTOBuilder.java @@ -4,7 +4,7 @@ import lombok.NoArgsConstructor; import org.springframework.stereotype.Component; import uk.gov.justice.laa.crime.evidence.dto.CapitalEvidenceDTO; -import uk.gov.justice.laa.crime.evidence.model.common.ApiCalculateEvidenceFeeRequest; +import uk.gov.justice.laa.crime.common.model.evidence.ApiCalculateEvidenceFeeRequest; import java.util.List; diff --git a/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/builder/CrimeEvidenceDTOBuilder.java b/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/builder/CrimeEvidenceDTOBuilder.java index 8b7e755..718defb 100644 --- a/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/builder/CrimeEvidenceDTOBuilder.java +++ b/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/builder/CrimeEvidenceDTOBuilder.java @@ -4,7 +4,7 @@ import lombok.NoArgsConstructor; import org.springframework.stereotype.Component; import uk.gov.justice.laa.crime.evidence.dto.CrimeEvidenceDTO; -import uk.gov.justice.laa.crime.evidence.model.common.ApiCalculateEvidenceFeeRequest; +import uk.gov.justice.laa.crime.common.model.evidence.ApiCalculateEvidenceFeeRequest; @Component @NoArgsConstructor(access = AccessLevel.PRIVATE) diff --git a/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/builder/EvidenceFeeDTOBuilder.java b/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/builder/EvidenceFeeDTOBuilder.java index d0fadfc..d8bbb9b 100644 --- a/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/builder/EvidenceFeeDTOBuilder.java +++ b/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/builder/EvidenceFeeDTOBuilder.java @@ -4,7 +4,7 @@ import lombok.NoArgsConstructor; import org.springframework.stereotype.Component; import uk.gov.justice.laa.crime.evidence.dto.EvidenceFeeDTO; -import uk.gov.justice.laa.crime.evidence.model.common.ApiCalculateEvidenceFeeRequest; +import uk.gov.justice.laa.crime.common.model.evidence.ApiCalculateEvidenceFeeRequest; @Component @NoArgsConstructor(access = AccessLevel.PRIVATE) diff --git a/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/controller/CrimeEvidenceController.java b/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/controller/CrimeEvidenceController.java index 216d95a..35feeb5 100644 --- a/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/controller/CrimeEvidenceController.java +++ b/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/controller/CrimeEvidenceController.java @@ -19,8 +19,8 @@ import uk.gov.justice.laa.crime.evidence.builder.CrimeEvidenceDTOBuilder; import uk.gov.justice.laa.crime.evidence.dto.CrimeEvidenceDTO; import uk.gov.justice.laa.crime.evidence.dto.ErrorDTO; -import uk.gov.justice.laa.crime.evidence.model.common.ApiCalculateEvidenceFeeRequest; -import uk.gov.justice.laa.crime.evidence.model.common.ApiCalculateEvidenceFeeResponse; +import uk.gov.justice.laa.crime.common.model.evidence.ApiCalculateEvidenceFeeRequest; +import uk.gov.justice.laa.crime.common.model.evidence.ApiCalculateEvidenceFeeResponse; import uk.gov.justice.laa.crime.evidence.service.EvidenceService; @Slf4j diff --git a/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/service/EvidenceService.java b/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/service/EvidenceService.java index cede7a8..5360ee7 100644 --- a/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/service/EvidenceService.java +++ b/crime-evidence/src/main/java/uk/gov/justice/laa/crime/evidence/service/EvidenceService.java @@ -7,8 +7,8 @@ import uk.gov.justice.laa.crime.evidence.common.Constants; import uk.gov.justice.laa.crime.evidence.dto.CrimeEvidenceDTO; import uk.gov.justice.laa.crime.evidence.dto.EvidenceFeeRulesDTO; -import uk.gov.justice.laa.crime.evidence.model.common.ApiCalculateEvidenceFeeResponse; -import uk.gov.justice.laa.crime.evidence.model.common.ApiEvidenceFee; +import uk.gov.justice.laa.crime.common.model.evidence.ApiCalculateEvidenceFeeResponse; +import uk.gov.justice.laa.crime.common.model.evidence.ApiEvidenceFee; import uk.gov.justice.laa.crime.enums.EvidenceFeeLevel; import uk.gov.justice.laa.crime.evidence.staticdata.enums.EvidenceFeeRules; diff --git a/crime-evidence/src/main/resources/schemas/apiCalculateEvidenceFeeRequest.json b/crime-evidence/src/main/resources/schemas/apiCalculateEvidenceFeeRequest.json deleted file mode 100644 index 7321a5f..0000000 --- a/crime-evidence/src/main/resources/schemas/apiCalculateEvidenceFeeRequest.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "apiCalculateEvidenceFeeRequest.json", - "type": "object", - "title": "Calculate Evidence Fee Request", - "description": "Data Contract for Calculate Evidence Fee Request", - "properties": { - "repId": { - "type": "integer", - "description": "MAAT / Rep Id" - }, - "magCourtOutcome": { - "type": "string", - "description": "Magistrate Court Outcome" - }, - "evidenceFee": { - "type": "object", - "description": "Evidence Fee", - "$ref": "common/apiEvidenceFee.json" - }, - "capitalEvidence": { - "type": "array", - "description": "List of Capital Evidence", - "items": { - "$ref": "common/apiCapitalEvidence.json" - } - }, - "incomeEvidenceReceivedDate": { - "description": "Income Evidence Received Date", - "type": "string", - "format": "date-time" - }, - "capitalEvidenceReceivedDate": { - "description": "Capital Evidence Received Date", - "type": "string", - "format": "date-time" - }, - "emstCode": { - "description": "Applicant Employment Status Code", - "type": "string" - } - }, - "additionalProperties": false, - "required": ["repId", "magCourtOutcome", "capitalEvidence", "emstCode"] -} diff --git a/crime-evidence/src/main/resources/schemas/apiCalculateEvidenceFeeResponse.json b/crime-evidence/src/main/resources/schemas/apiCalculateEvidenceFeeResponse.json deleted file mode 100644 index f8d9cc1..0000000 --- a/crime-evidence/src/main/resources/schemas/apiCalculateEvidenceFeeResponse.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "apiCalculateEvidenceFeeResponse.json", - "type": "object", - "title": "Calculate Evidence Fee Response", - "description": "Data contract for Calculate Evidence Fee Response", - "properties": { - "evidenceFee": { - "type": "object", - "description": "Evidence Fee", - "$ref": "common/apiEvidenceFee.json" - } - }, - "additionalProperties": false -} diff --git a/crime-evidence/src/main/resources/schemas/common/apiCapitalEvidence.json b/crime-evidence/src/main/resources/schemas/common/apiCapitalEvidence.json deleted file mode 100644 index 4338d19..0000000 --- a/crime-evidence/src/main/resources/schemas/common/apiCapitalEvidence.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "apiCapitalEvidence.json", - "description": "Capital Evidence", - "type": "object", - "properties": { - "evidenceType": { - "description": "Capital Evidence Type", - "type": "string" - }, - "dateReceived": { - "description": "Capital Evidence Date Received", - "type": "string", - "format": "date-time" - } - }, - "additionalProperties": false -} diff --git a/crime-evidence/src/main/resources/schemas/common/apiEvidenceFee.json b/crime-evidence/src/main/resources/schemas/common/apiEvidenceFee.json deleted file mode 100644 index 890beb6..0000000 --- a/crime-evidence/src/main/resources/schemas/common/apiEvidenceFee.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "id": "apiEvidenceFee.json", - "description": "Evidence Fee", - "type": "object", - "properties": { - "feeLevel": { - "description": "Evidence Fee Level", - "type": "string" - }, - "description": { - "description": "Evidence description", - "type": "string" - } - }, - "additionalProperties": false -} diff --git a/crime-evidence/src/test/java/uk/gov/justice/laa/crime/evidence/builder/EvidenceFeeDTOBuilderTest.java b/crime-evidence/src/test/java/uk/gov/justice/laa/crime/evidence/builder/EvidenceFeeDTOBuilderTest.java index 0c20872..5a56339 100644 --- a/crime-evidence/src/test/java/uk/gov/justice/laa/crime/evidence/builder/EvidenceFeeDTOBuilderTest.java +++ b/crime-evidence/src/test/java/uk/gov/justice/laa/crime/evidence/builder/EvidenceFeeDTOBuilderTest.java @@ -7,7 +7,7 @@ import org.junit.jupiter.api.extension.ExtendWith; import uk.gov.justice.laa.crime.evidence.data.builder.TestModelDataBuilder; import uk.gov.justice.laa.crime.evidence.dto.EvidenceFeeDTO; -import uk.gov.justice.laa.crime.evidence.model.common.ApiCalculateEvidenceFeeRequest; +import uk.gov.justice.laa.crime.common.model.evidence.ApiCalculateEvidenceFeeRequest; import uk.gov.justice.laa.crime.enums.EvidenceFeeLevel; import static org.assertj.core.api.Assertions.assertThat; diff --git a/crime-evidence/src/test/java/uk/gov/justice/laa/crime/evidence/data/builder/TestModelDataBuilder.java b/crime-evidence/src/test/java/uk/gov/justice/laa/crime/evidence/data/builder/TestModelDataBuilder.java index 121612d..6959dcb 100644 --- a/crime-evidence/src/test/java/uk/gov/justice/laa/crime/evidence/data/builder/TestModelDataBuilder.java +++ b/crime-evidence/src/test/java/uk/gov/justice/laa/crime/evidence/data/builder/TestModelDataBuilder.java @@ -5,10 +5,10 @@ import uk.gov.justice.laa.crime.evidence.dto.CapitalEvidenceDTO; import uk.gov.justice.laa.crime.evidence.dto.CrimeEvidenceDTO; import uk.gov.justice.laa.crime.evidence.dto.EvidenceFeeDTO; -import uk.gov.justice.laa.crime.evidence.model.common.ApiCalculateEvidenceFeeRequest; -import uk.gov.justice.laa.crime.evidence.model.common.ApiCalculateEvidenceFeeResponse; -import uk.gov.justice.laa.crime.evidence.model.common.ApiCapitalEvidence; -import uk.gov.justice.laa.crime.evidence.model.common.ApiEvidenceFee; +import uk.gov.justice.laa.crime.common.model.evidence.ApiCalculateEvidenceFeeRequest; +import uk.gov.justice.laa.crime.common.model.evidence.ApiCalculateEvidenceFeeResponse; +import uk.gov.justice.laa.crime.common.model.evidence.ApiCapitalEvidence; +import uk.gov.justice.laa.crime.common.model.evidence.ApiEvidenceFee; import uk.gov.justice.laa.crime.enums.EvidenceFeeLevel; import java.time.LocalDateTime; diff --git a/crime-evidence/src/test/java/uk/gov/justice/laa/crime/evidence/service/EvidenceServiceTest.java b/crime-evidence/src/test/java/uk/gov/justice/laa/crime/evidence/service/EvidenceServiceTest.java index 70364e8..acd9745 100644 --- a/crime-evidence/src/test/java/uk/gov/justice/laa/crime/evidence/service/EvidenceServiceTest.java +++ b/crime-evidence/src/test/java/uk/gov/justice/laa/crime/evidence/service/EvidenceServiceTest.java @@ -11,7 +11,7 @@ import uk.gov.justice.laa.crime.evidence.common.Constants; import uk.gov.justice.laa.crime.evidence.data.builder.TestModelDataBuilder; import uk.gov.justice.laa.crime.evidence.dto.CrimeEvidenceDTO; -import uk.gov.justice.laa.crime.evidence.model.common.ApiCalculateEvidenceFeeResponse; +import uk.gov.justice.laa.crime.common.model.evidence.ApiCalculateEvidenceFeeResponse; import uk.gov.justice.laa.crime.enums.EvidenceFeeLevel; import static org.assertj.core.api.AssertionsForClassTypes.assertThat;