diff --git a/pom.xml b/pom.xml index 5b79a3990..941902e6a 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ uk.gov.moj.cpp.sjp sjp-parent - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT pom diff --git a/sjp-command/pom.xml b/sjp-command/pom.xml index 8b31ea279..1ba419de6 100644 --- a/sjp-command/pom.xml +++ b/sjp-command/pom.xml @@ -3,7 +3,7 @@ sjp-parent uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-command/sjp-command-api/pom.xml b/sjp-command/sjp-command-api/pom.xml index d2c24531a..b1b82ec54 100644 --- a/sjp-command/sjp-command-api/pom.xml +++ b/sjp-command/sjp-command-api/pom.xml @@ -3,7 +3,7 @@ sjp-command uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-command/sjp-command-controller/pom.xml b/sjp-command/sjp-command-controller/pom.xml index ab62dcabe..d3630f447 100644 --- a/sjp-command/sjp-command-controller/pom.xml +++ b/sjp-command/sjp-command-controller/pom.xml @@ -3,7 +3,7 @@ sjp-command uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-command/sjp-command-handler/pom.xml b/sjp-command/sjp-command-handler/pom.xml index 7841b522b..42f8afd40 100644 --- a/sjp-command/sjp-command-handler/pom.xml +++ b/sjp-command/sjp-command-handler/pom.xml @@ -3,7 +3,7 @@ sjp-command uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-domain/pom.xml b/sjp-domain/pom.xml index 6bd60d8d5..847b87c19 100644 --- a/sjp-domain/pom.xml +++ b/sjp-domain/pom.xml @@ -5,7 +5,7 @@ uk.gov.moj.cpp.sjp sjp-parent - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT sjp-domain diff --git a/sjp-domain/sjp-domain-aggregate/pom.xml b/sjp-domain/sjp-domain-aggregate/pom.xml index 01e235717..8887697a4 100644 --- a/sjp-domain/sjp-domain-aggregate/pom.xml +++ b/sjp-domain/sjp-domain-aggregate/pom.xml @@ -5,7 +5,7 @@ uk.gov.moj.cpp.sjp sjp-domain - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT sjp-domain-aggregate diff --git a/sjp-domain/sjp-domain-common/pom.xml b/sjp-domain/sjp-domain-common/pom.xml index 5ecc36b3f..6dbd2340d 100644 --- a/sjp-domain/sjp-domain-common/pom.xml +++ b/sjp-domain/sjp-domain-common/pom.xml @@ -5,7 +5,7 @@ uk.gov.moj.cpp.sjp sjp-domain - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT diff --git a/sjp-domain/sjp-domain-event-processor/pom.xml b/sjp-domain/sjp-domain-event-processor/pom.xml index 9ee17ad91..07d4d909a 100644 --- a/sjp-domain/sjp-domain-event-processor/pom.xml +++ b/sjp-domain/sjp-domain-event-processor/pom.xml @@ -3,7 +3,7 @@ sjp-domain uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-domain/sjp-domain-event/pom.xml b/sjp-domain/sjp-domain-event/pom.xml index a9cf91ba9..50f0db845 100644 --- a/sjp-domain/sjp-domain-event/pom.xml +++ b/sjp-domain/sjp-domain-event/pom.xml @@ -5,7 +5,7 @@ uk.gov.moj.cpp.sjp sjp-domain - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT sjp-domain-event diff --git a/sjp-domain/sjp-domain-prosecution/pom.xml b/sjp-domain/sjp-domain-prosecution/pom.xml index c6da0c848..411e63b77 100644 --- a/sjp-domain/sjp-domain-prosecution/pom.xml +++ b/sjp-domain/sjp-domain-prosecution/pom.xml @@ -4,7 +4,7 @@ sjp-domain uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT sjp-domain-prosecution diff --git a/sjp-domain/sjp-domain-transformation/pom.xml b/sjp-domain/sjp-domain-transformation/pom.xml index 193379832..086e9683a 100644 --- a/sjp-domain/sjp-domain-transformation/pom.xml +++ b/sjp-domain/sjp-domain-transformation/pom.xml @@ -3,7 +3,7 @@ sjp-domain uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-domain/sjp-domain-transformation/sjp-domain-transformation-anonymise/pom.xml b/sjp-domain/sjp-domain-transformation/sjp-domain-transformation-anonymise/pom.xml index e532265df..895b81ef9 100644 --- a/sjp-domain/sjp-domain-transformation/sjp-domain-transformation-anonymise/pom.xml +++ b/sjp-domain/sjp-domain-transformation/sjp-domain-transformation-anonymise/pom.xml @@ -3,7 +3,7 @@ sjp-domain-transformation uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-domain/sjp-domain-transformation/sjp-domain-transformation-postcode/pom.xml b/sjp-domain/sjp-domain-transformation/sjp-domain-transformation-postcode/pom.xml index 1e3025fbb..c1bf4dc7b 100644 --- a/sjp-domain/sjp-domain-transformation/sjp-domain-transformation-postcode/pom.xml +++ b/sjp-domain/sjp-domain-transformation/sjp-domain-transformation-postcode/pom.xml @@ -3,7 +3,7 @@ sjp-domain-transformation uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-event-sources/pom.xml b/sjp-event-sources/pom.xml index 7a308bd37..88cc8622d 100644 --- a/sjp-event-sources/pom.xml +++ b/sjp-event-sources/pom.xml @@ -3,7 +3,7 @@ sjp-parent uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT ../pom.xml 4.0.0 diff --git a/sjp-event/pom.xml b/sjp-event/pom.xml index ce38ff28d..e924093f6 100644 --- a/sjp-event/pom.xml +++ b/sjp-event/pom.xml @@ -3,7 +3,7 @@ sjp-parent uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-event/sjp-event-indexer/pom.xml b/sjp-event/sjp-event-indexer/pom.xml index dad43fc1e..b1f145dd9 100644 --- a/sjp-event/sjp-event-indexer/pom.xml +++ b/sjp-event/sjp-event-indexer/pom.xml @@ -3,7 +3,7 @@ sjp-event uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-event/sjp-event-indexer/src/test/java/uk/gov/moj/cpp/indexer/jolt/CaseReceivedTransformationTest.java b/sjp-event/sjp-event-indexer/src/test/java/uk/gov/moj/cpp/indexer/jolt/CaseReceivedTransformationTest.java index da6a44762..ef5baca39 100644 --- a/sjp-event/sjp-event-indexer/src/test/java/uk/gov/moj/cpp/indexer/jolt/CaseReceivedTransformationTest.java +++ b/sjp-event/sjp-event-indexer/src/test/java/uk/gov/moj/cpp/indexer/jolt/CaseReceivedTransformationTest.java @@ -50,6 +50,24 @@ public void shouldTransformCaseReceivedEvent() throws IOException { verifyCase(inputCourtApplication, transformedJson, false); } + @Test + public void shouldTransformCaseReceivedEventWithPncIdentifier() throws IOException { + + final JsonObject specJson = readJsonViaPath("src/transformer/sjp.events.case-received-spec.json"); + assertNotNull(specJson); + + final JsonObject inputJson = readJson("/sjp.events.case-received-with-pnc-identifier.json"); + final DocumentContext inputCourtApplication = parse(inputJson); + final JsonObject transformedJson = joltTransformer.transformWithJolt(specJson.toString(), inputJson); + + verifyCase(inputCourtApplication, transformedJson, false); + + final JsonObject inputDefendant = inputCourtApplication.read("$.defendant"); + final JsonObject outputParties = (JsonObject) transformedJson.getJsonArray("parties").get(0); + + assertThat(outputParties.getString("pncId"), is(inputDefendant.getString("pncIdentifier"))); + } + private void verifyCase(final DocumentContext inputCase, final JsonObject outputCase, final boolean isCompany) { assertThat(outputCase.getString("caseId"), is(((JsonString) inputCase.read("$.caseId")).getString())); diff --git a/sjp-event/sjp-event-indexer/src/test/resources/sjp.events.case-received-with-pnc-identifier.json b/sjp-event/sjp-event-indexer/src/test/resources/sjp.events.case-received-with-pnc-identifier.json new file mode 100644 index 000000000..7173b1350 --- /dev/null +++ b/sjp-event/sjp-event-indexer/src/test/resources/sjp.events.case-received-with-pnc-identifier.json @@ -0,0 +1,44 @@ +{ + "caseId": "7e2f843e-d639-40b3-8611-8015f3a18958", + "urn": "22C22222222", + "enterpriseId": "2K2SLYFC743H", + "prosecutingAuthority": "TFL", + "costs": 1.23, + "postingDate": "2015-12-02", + "defendant": { + "id": "f06f6539-2a7c-4bc8-bca3-f1b17ebcfa47", + "title": "Mr", + "firstName": "David", + "lastName": "LLOYD", + "dateOfBirth": "1980-07-15", + "gender": "Male", + "numPreviousConvictions": 2, + "address": { + "address1": "14 Tottenham Court Road", + "address2": "London", + "address3": "England", + "address4": "UK", + "address5": "Greater London", + "postcode": "W1T 1JY" + }, + "asn": "asnNumber", + "offences": [ + { + "id": "7e2f843e-d639-40b3-8611-8015f3a18954", + "offenceSequenceNo": 1, + "libraOffenceCode": "PS00001", + "chargeDate": "2016-01-01", + "libraOffenceDateCode": 1, + "offenceCommittedDate": "2016-01-01", + "offenceWording": "Committed some offence", + "offenceWordingWelsh": "Welsh wording: Committed some offence", + "prosecutionFacts": "No ticket at the gates, forgery", + "witnessStatement": "Jumped over the barriers", + "compensation": 2.34 + } + ], + "pncIdentifier": "2026/1234567D" + }, + "createdOn": "2018-01-11T16:17:15.294Z", + "expectedDateReady": "2015-12-30" +} diff --git a/sjp-event/sjp-event-indexer/src/transformer/sjp.events.case-received-spec.json b/sjp-event/sjp-event-indexer/src/transformer/sjp.events.case-received-spec.json index 7c7497066..6fb3d9f4c 100644 --- a/sjp-event/sjp-event-indexer/src/transformer/sjp.events.case-received-spec.json +++ b/sjp-event/sjp-event-indexer/src/transformer/sjp.events.case-received-spec.json @@ -26,7 +26,8 @@ "address5": "parties[0].address5", "postcode": "parties[0].postCode" }, - "asn": "parties[0].arrestSummonsNumber" + "asn": "parties[0].arrestSummonsNumber", + "pncIdentifier": "parties[0].pncId" } } }, diff --git a/sjp-event/sjp-event-listener/pom.xml b/sjp-event/sjp-event-listener/pom.xml index bdaebacaf..a61c667d9 100644 --- a/sjp-event/sjp-event-listener/pom.xml +++ b/sjp-event/sjp-event-listener/pom.xml @@ -3,7 +3,7 @@ sjp-event uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-event/sjp-event-processor/pom.xml b/sjp-event/sjp-event-processor/pom.xml index 13b1a02d0..41aa405ec 100644 --- a/sjp-event/sjp-event-processor/pom.xml +++ b/sjp-event/sjp-event-processor/pom.xml @@ -3,7 +3,7 @@ sjp-event uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-healthchecks/pom.xml b/sjp-healthchecks/pom.xml index 28eed83d8..1ade8030c 100644 --- a/sjp-healthchecks/pom.xml +++ b/sjp-healthchecks/pom.xml @@ -3,7 +3,7 @@ sjp-parent uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-integration-test/pom.xml b/sjp-integration-test/pom.xml index ff8ca3ac0..722d6e777 100644 --- a/sjp-integration-test/pom.xml +++ b/sjp-integration-test/pom.xml @@ -4,7 +4,7 @@ uk.gov.moj.cpp.sjp sjp-parent - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-json/pom.xml b/sjp-json/pom.xml index 725e28fa5..137f3a1fd 100644 --- a/sjp-json/pom.xml +++ b/sjp-json/pom.xml @@ -2,7 +2,7 @@ sjp-parent uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-json/src/main/resources/json/schema/events/case-received.defendant.json b/sjp-json/src/main/resources/json/schema/events/case-received.defendant.json index 61c1b6a79..dcd09e77f 100644 --- a/sjp-json/src/main/resources/json/schema/events/case-received.defendant.json +++ b/sjp-json/src/main/resources/json/schema/events/case-received.defendant.json @@ -47,6 +47,9 @@ "items": { "$ref" : "http://justice.gov.uk/json/schemas/domains/sjp/events/case-received.offence.json" } + }, + "pncIdentifier": { + "type": "string" } } } diff --git a/sjp-query/pom.xml b/sjp-query/pom.xml index 928ee0f78..fba150fe7 100644 --- a/sjp-query/pom.xml +++ b/sjp-query/pom.xml @@ -3,7 +3,7 @@ sjp-parent uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-query/sjp-query-api/pom.xml b/sjp-query/sjp-query-api/pom.xml index 21982fd20..e1c49fd81 100644 --- a/sjp-query/sjp-query-api/pom.xml +++ b/sjp-query/sjp-query-api/pom.xml @@ -3,7 +3,7 @@ sjp-query uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-query/sjp-query-view/pom.xml b/sjp-query/sjp-query-view/pom.xml index 412ea0df9..456449381 100644 --- a/sjp-query/sjp-query-view/pom.xml +++ b/sjp-query/sjp-query-view/pom.xml @@ -3,7 +3,7 @@ sjp-query uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 diff --git a/sjp-service/pom.xml b/sjp-service/pom.xml index b1b7fdcca..469b9aff0 100644 --- a/sjp-service/pom.xml +++ b/sjp-service/pom.xml @@ -5,7 +5,7 @@ uk.gov.moj.cpp.sjp sjp-parent - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT sjp-service war diff --git a/sjp-viewstore/pom.xml b/sjp-viewstore/pom.xml index 7944e8a03..8dd93d946 100644 --- a/sjp-viewstore/pom.xml +++ b/sjp-viewstore/pom.xml @@ -3,7 +3,7 @@ sjp-parent uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0 sjp-viewstore diff --git a/sjp-viewstore/sjp-viewstore-liquibase/pom.xml b/sjp-viewstore/sjp-viewstore-liquibase/pom.xml index cae85b9e0..a8431c4e0 100644 --- a/sjp-viewstore/sjp-viewstore-liquibase/pom.xml +++ b/sjp-viewstore/sjp-viewstore-liquibase/pom.xml @@ -5,7 +5,7 @@ uk.gov.moj.cpp.sjp sjp-viewstore - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT sjp-viewstore-liquibase diff --git a/sjp-viewstore/sjp-viewstore-persistence/pom.xml b/sjp-viewstore/sjp-viewstore-persistence/pom.xml index 7e7123fb3..0e56bc7a7 100644 --- a/sjp-viewstore/sjp-viewstore-persistence/pom.xml +++ b/sjp-viewstore/sjp-viewstore-persistence/pom.xml @@ -3,7 +3,7 @@ sjp-viewstore uk.gov.moj.cpp.sjp - 17.103.175-SNAPSHOT + 17.103.175-CADB-3-SNAPSHOT 4.0.0