Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,14 @@ public JsonEnvelope getDailyList(final JsonEnvelope query) {
final String welshCourtCentreName = courtCentreJson.getString("oucodeL3WelshName", null);
final String address1 = courtCentreJson.getString("address1", null);
final String address2 = courtCentreJson.getString("address2", null);
final String welshAddress1 = courtCentreJson.getString("welshAddress1", null);
final String welshAddress2 = courtCentreJson.getString("welshAddress2", null);

final JsonObject responsePayload = response.payloadAsJsonObject();
final JsonObjectBuilder enrichedBuilder = JsonObjects.createObjectBuilder();
responsePayload.forEach((key, value) -> {
if (COURT_LISTS.equals(key)) {
enrichedBuilder.add(COURT_LISTS, enrichCourtListsWithAddress(responsePayload.getJsonArray(COURT_LISTS), address1, address2));
enrichedBuilder.add(COURT_LISTS, enrichCourtListsWithAddress(responsePayload.getJsonArray(COURT_LISTS), address1, address2, welshAddress1, welshAddress2));
} else {
enrichedBuilder.add(key, value);
}
Expand All @@ -256,7 +258,7 @@ public JsonEnvelope getDailyList(final JsonEnvelope query) {
return envelopeFrom(metadataFrom(query.metadata()).withName("listing.search.daily.list.payload"), enrichedBuilder.build());
}

private JsonArray enrichCourtListsWithAddress(final JsonArray courtLists, final String address1, final String address2) {
private JsonArray enrichCourtListsWithAddress(final JsonArray courtLists, final String address1, final String address2, final String welshAddress1, final String welshAddress2) {
final JsonArrayBuilder enrichedCourtListsBuilder = createArrayBuilder();
courtLists.getValuesAs(JsonObject.class).forEach(courtList -> {
final JsonObject crestCourtSite = courtList.getJsonObject(CREST_COURT_SITE);
Expand All @@ -268,6 +270,12 @@ private JsonArray enrichCourtListsWithAddress(final JsonArray courtLists, final
if (address2 != null) {
enrichedSiteBuilder.add("courtCentreAddress2", address2);
}
if (welshAddress1 != null) {
enrichedSiteBuilder.add("welshCourtCentreAddress1", welshAddress1);
}
if (welshAddress2 != null) {
enrichedSiteBuilder.add("welshCourtCentreAddress2", welshAddress2);
}
final JsonObjectBuilder enrichedCourtListBuilder = JsonObjects.createObjectBuilder();
courtList.forEach((key, value) -> {
if (CREST_COURT_SITE.equals(key)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,85 +1,90 @@
{
"courtCentreId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"sittingDate": "2026-05-07",
"publishedAt": "2026-05-06",
"documentType": "DAILY_LIST",
"documentCounter": 1,
"isWelsh": false,
"courtCentreName": "Kingston Crown Court",
"welshCourtCentreName": "Llys y Goron Kingston",
"courtCentreId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"sittingDate": "2026-06-09",
"weekCommencingStartDate": "2026-06-09",
"weekCommencingEndDate": "2026-06-13",
"publishedAt": "2026-06-08",
"documentType": "FINAL",
"documentCounter": 2,
"isWelsh": true,
"courtCentreName": "Cardiff Crown Court",
"welshCourtCentreName": "Llys y Goron Caerdydd",
"courtLists": [
{
"crestCourtSite": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"oucode": "KGN",
"crestCourtId": "415",
"crestCourtSiteId": "415",
"crestCourtSiteName": "Kingston Crown Court",
"welshCrestCourtSiteName": "Llys y Goron Kingston",
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"oucode": "CDF",
"crestCourtId": "100",
"crestCourtSiteId": "100",
"crestCourtSiteName": "Cardiff Crown Court",
"welshCrestCourtSiteName": "Llys y Goron Caerdydd",
"validFrom": "2000-01-01",
"validTo": "9999-12-31",
"crestCourtName": "Kingston-upon-Thames",
"welshCrestCourtName": "Kingston-upon-Thames",
"crestCourtShortName": "Kingston",
"welshCrestCourtShortName": "Kingston",
"crestCourtFullName": "Kingston Crown Court",
"welshCrestCourtFullName": "Llys y Goron Kingston",
"crestCourtSiteCode": "KGN01",
"crestCourtName": "Cardiff",
"welshCrestCourtName": "Caerdydd",
"crestCourtShortName": "Cardiff",
"welshCrestCourtShortName": "Caerdydd",
"crestCourtFullName": "Cardiff Crown Court",
"welshCrestCourtFullName": "Llys y Goron Caerdydd",
"crestCourtSiteCode": "CDF01",
"courtType": "CROWN",
"courtCentreAddress1": "The Queen Elizabeth II Law Courts",
"courtCentreAddress2": "Derby Square, Liverpool L2 1XA"
"courtCentreAddress1": "Cardiff Crown Court",
"courtCentreAddress2": "2 Park Street, Cardiff CF10 1ET",
"welshCourtCentreAddress1": "Llys y Goron Caerdydd",
"welshCourtCentreAddress2": "2 Stryd y Parc, Caerdydd CF10 1ET"
},
"sittings": [
{
"sittingDate": "2026-05-07",
"courtRoomId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"sittingDate": "2026-06-09",
"courtRoomId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
"courtRoomName": "Court Room 1",
"welshCourtRoomName": "Ystafell Llys 1",
"weekCommencing": false,
"weekCommencing": true,
"judiciary": [
{
"isBenchChairman": false,
"isDeputy": false,
"judicialId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"judiciaryName": "His Honour Judge Smith",
"judicialId": "d4e5f6a7-b8c9-0123-defa-234567890123",
"judiciaryName": "His Honour Judge Williams",
"judicialRoleType": {
"judiciaryType": "CIRCUIT_JUDGE"
}
}
],
"hearings": [
{
"startTime": "2026-05-07T10:00:00",
"endTime": "2026-05-07T11:00:00",
"startTime": "2026-06-09T10:00:00",
"endTime": "2026-06-09T11:00:00",
"hearingType": {
"id": "d4e5f6a7-b8c9-0123-defa-234567890123",
"id": "e5f6a7b8-c9d0-1234-efab-345678901234",
"description": "Trial",
"welshDescription": "Treial"
},
"restrictFromCourtList": false,
"weekCommencing": false,
"weekCommencing": true,
"hasVideoLink": false,
"publicListNote": "Reporting restrictions apply under s.4(2) of the Contempt of Court Act 1981",
"publicListNote": "Mae cyfyngiadau adrodd yn gymwys",
"committingCourtCentreId": "f6a7b8c9-d0e1-2345-fabc-456789012345",
"caseIdentifier": {
"caseReference": "T20260001",
"authorityCode": "CPS001"
"caseReference": "T20260002",
"authorityCode": "CPS002"
},
"prosecutor": {
"organisationName": "Crown Prosecution Service"
},
"defendants": [
{
"id": "e5f6a7b8-c9d0-1234-efab-345678901234",
"firstName": "Robert",
"lastName": "Brown",
"id": "a7b8c9d0-e1f2-3456-abcd-567890123456",
"firstName": "Dafydd",
"lastName": "Jones",
"restrictFromCourtList": false,
"defenceOrganisation": "Smith & Co Solicitors",
"defenceOrganisation": "Morgan & Co Solicitors",
"offences": [
{
"offenceCode": "TH68001",
"statementOfOffence": {
"title": "Theft contrary to section 1(1) and 7 of the Theft Act 1968"
"title": "Theft contrary to section 1(1) and 7 of the Theft Act 1968",
"welshTitle": "Lladrad yn groes i adran 1(1) a 7 o Ddeddf Lladrad 1968"
},
"restrictFromCourtList": false,
"reportingRestrictions": [
Expand All @@ -90,29 +95,29 @@
],
"committingCourt": {
"courtCentreId": "f6a7b8c9-d0e1-2345-fabc-456789012345",
"courtHouseName": "Croydon Magistrates Court"
"courtHouseName": "Cardiff Magistrates Court"
}
}
]
}
]
},
{
"startTime": "2026-05-07T14:00:00",
"endTime": "2026-05-07T14:30:00",
"startTime": "2026-06-09T14:00:00",
"endTime": "2026-06-09T14:30:00",
"hearingType": {
"id": "d0e1f2a3-b4c5-6789-defa-890123456789",
"description": "Application",
"welshDescription": "Cais"
},
"restrictFromCourtList": false,
"weekCommencing": false,
"weekCommencing": true,
"hasVideoLink": false,
"publicListNote": "Bail application",
"applicationReference": "APP20260001",
"publicListNote": "Cais am fechnïaeth",
"applicationReference": "APP20260002",
"applicant": {
"firstName": "Linda",
"lastName": "Martin",
"firstName": "Siân",
"lastName": "Morgan",
"restrictFromCourtList": false
},
"respondents": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
"id": "http://justice.gov.uk/listing/query/listing.search.daily.list.payload.json",
"type": "object",
"properties": {
"courtCentreId": { "type": "string" },
"sittingDate": { "type": "string", "format": "date" },
"publishedAt": { "type": "string", "format": "date" },
"documentType": { "type": "string" },
"documentCounter": { "type": "integer" },
"isWelsh": { "type": "boolean" },
"courtCentreName":{ "type": "string" },
"welshCourtCentreName":{ "type": "string" },
"courtCentreId": { "type": "string" },
"sittingDate": { "type": "string", "format": "date" },
"weekCommencingStartDate": { "type": "string", "format": "date" },
"weekCommencingEndDate": { "type": "string", "format": "date" },
"publishedAt": { "type": "string", "format": "date" },
"documentType": { "type": "string" },
"documentCounter": { "type": "integer" },
"isWelsh": { "type": "boolean" },
"courtCentreName": { "type": "string" },
"welshCourtCentreName": { "type": "string" },
"courtLists": {
"type": "array",
"items": {
Expand All @@ -35,8 +37,10 @@
"welshCrestCourtFullName": { "type": "string" },
"crestCourtSiteCode": { "type": "string" },
"courtType": { "type": "string" },
"courtCentreAddress1": { "type": "string" },
"courtCentreAddress2": { "type": "string" }
"courtCentreAddress1": { "type": "string" },
"courtCentreAddress2": { "type": "string" },
"welshCourtCentreAddress1": { "type": "string" },
"welshCourtCentreAddress2": { "type": "string" }
},
"required": ["crestCourtSiteId", "crestCourtSiteName", "courtType"]
},
Expand Down Expand Up @@ -120,7 +124,8 @@
"statementOfOffence": {
"type": "object",
"properties": {
"title": { "type": "string" }
"title": { "type": "string" },
"welshTitle": { "type": "string" }
}
},
"restrictFromCourtList": { "type": "boolean" },
Expand Down
Loading
Loading