Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
d8329a3
CCT-2353 - openspec files archived (#309)
aykutdanisman May 19, 2026
94b7986
updating poms for 17.0.262-SNAPSHOT development
May 19, 2026
8cbc398
updating poms for 17.0.262 branch with snapshot versions
May 19, 2026
064b895
updating poms for 17.0.263-SNAPSHOT development
May 19, 2026
7d1d3eb
updating poms for branch'dev/release-17.0.262' with non-snapshot vers…
May 19, 2026
6c69a17
Merge branch 'dev/release-17.0.262' into dev/release
May 19, 2026
a72329e
updating develop poms to master versions to avoid merge conflicts
May 19, 2026
026dee5
Merge branch 'dev/release' into main
May 19, 2026
75db17f
Updating develop poms back to pre merge state
May 19, 2026
8275d78
PEG-2848-R14: switch azure-pipelines ref from main to dev/enforcer-di…
May 19, 2026
55984df
PEG-2848 refactor and bump Framework (#8)
zozd-hmcts Dec 29, 2025
8567f84
PEG-2848 Testing Framework-D improvement
zozd-hmcts Jan 12, 2026
60a2fae
PEG-2848 Testing Framework-D improvement
zozd-hmcts Feb 3, 2026
b956c42
dummy commit to get new image in pom.xml
vmuthuhm Mar 9, 2026
172cac9
dummy commit
Mar 10, 2026
d3bd672
Rebase from RELEASE-ENGG-2609, Update version to 17.104.48-RBSD-2609-…
Apr 17, 2026
34b2a8a
Fix referencedata.version to 17.103.131 and PostalAddressee construct…
Apr 17, 2026
eb833ad
Fix CI test compilation: Json.createObjectBuilder migration and getAp…
Apr 17, 2026
2d85630
Fix DefaultQueryApiCourtlistResourceTest: replace CourtlistQueryServi…
Apr 17, 2026
bab1de5
Fix build: restore release-engg-2609 base for source files and apply …
Apr 17, 2026
e031dfc
PEG-2848-R14: post-merge fixes for IT helpers, stubs, query views, an…
May 21, 2026
c55a970
PEG-2848-R14: clean up remaining post-merge differences
May 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 3 additions & 2 deletions azure-pipelines.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ resources:
type: github
name: hmcts/cpp-azure-devops-templates
endpoint: 'hmcts'
ref: 'main'
ref: 'dev/enforcer-disabled'

pool:
name: "MDV-ADO-AGENT-AKS-01"
demands:
- identifier -equals centos8-j17
- identifier -equals ubuntu-j17


variables:
Expand All @@ -50,3 +50,4 @@ stages:
sonarQubeType: 'sonarQubeAKS'
serviceName: ${{ variables['service_Name'] }}
itTestFolder: ${{ variables['itTest_Folder'] }}
aksDeployBranch: "dev/PEG-2744-proactive-processing"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Design

See CHD-2445.
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Spec: AAAG Linked Case Offences

## Capability

The Application At A Glance (AAAG) query returns offences associated with an application across one or more linked prosecution cases. Each offence must carry enough data for the UI to display the correct sequence number, charge details, results, and restrictions — without needing to call any secondary endpoint.

**Query**: `progression.query.application.aaag`
**Response type**: `application/vnd.progression.query.application.aaag+json`
**Relevant path**: `response.linkedCases[].offences[]`

---

## Data Lineage

```
PostgreSQL view store
offence.order_index (int, NOT NULL)
offence.offence_code (varchar)
offence.offence_title (varchar)
...
↓ loaded into domain model
uk.gov.justice.core.courts.Offence
.getOrderIndex() → Integer
.getOffenceCode() → String
...
↓ mapped by ApplicationQueryView.getOffence()
↓ into generated DTO (from progression.query.application.aaag.json schema)
uk.gov.justice.courts.progression.query.Offences
→ serialised into JSON response
```

The view store is the authoritative source. The domain object and DTO must faithfully relay the value without transformation.

---

## Field Contract

Each offence object in `linkedCases[].offences[]` MUST include the following fields:

| Field | Type | Nullable | Description |
|---|---|---|---|
| `id` | UUID | No | Offence identifier |
| `offenceCode` | string | No | Statutory offence code |
| `offenceTitle` | string | No | English offence title |
| `offenceTitleWelsh` | string | Yes | Welsh offence title |
| `offenceLegislation` | string | No | Legislation text |
| `offenceLegislationWelsh` | string | Yes | Welsh legislation text |
| `wording` | string | No | Specific wording for this charge |
| `wordingWelsh` | string | Yes | Welsh wording |
| `startDate` | date (yyyy-MM-dd) | No | Offence start date |
| `endDate` | date (yyyy-MM-dd) | Yes | Offence end date |
| `count` | integer ≥ 0 | Yes | Offence count |
| **`orderIndex`** | **integer ≥ 1** | **No** | **Sequence number of the offence within its prosecution case. Determines display order and labelling.** |
| `plea` | object | Yes | Entered plea, if any |
| `verdict` | object | Yes | Verdict, if any |
| `aagResults` | array | Yes | Judicial results to display on AAAG |
| `custodyTimeLimit` | object | Yes | CTL details, if applicable |
| `reportingRestrictions` | array | Yes | Reporting restrictions on this offence |

### `orderIndex` rules

- MUST match the `order_index` column stored in the view store for this offence.
- MUST be unique within a single prosecution case (no two offences in the same case share the same `orderIndex`).
- Is case-scoped: offence 2 from Case A and offence 2 from Case B are both `orderIndex: 2`. Consumers must not assume global uniqueness across cases.
- MUST NOT be derived from the position of the offence in the API response array. The ordering of offences in the array is not guaranteed to match `orderIndex`.

---

## Acceptance Criteria

### AC1 — Single case application, single offence
**Given** an application linked to one case with one offence (orderIndex = 1)
**When** the AAAG query is called
**Then** `linkedCases[0].offences[0].orderIndex` equals `1`

### AC2 — Single case application, multiple offences
**Given** an application linked to one case with two offences (orderIndex = 1 and orderIndex = 2)
**When** the AAAG query is called
**Then** `linkedCases[0].offences` contains both `orderIndex: 1` and `orderIndex: 2`
**And** the `orderIndex` values are not derived from array position

### AC3 — Multi-case application (the CHD-2445 scenario)
**Given** an application linked to Case A (with offences at orderIndex 1 and 2) where offence 1 has been disposed
**And** the application selects only the active offence from Case A (orderIndex = 2)
**And** two offences from Case B (orderIndex = 1 and 2)
**When** the AAAG query is called
**Then** the offence from Case A has `orderIndex: 2` (not 1)
**And** the two offences from Case B have `orderIndex: 1` and `orderIndex: 2` respectively
**And** `orderIndex` values are scoped per case — Case A's `orderIndex: 2` and Case B's `orderIndex: 2` are independent

### AC4 — `orderIndex` is always present
**Given** any application with linked cases
**When** the AAAG query is called
**Then** every offence in `linkedCases[].offences[]` has a non-null `orderIndex`

---

## Related Changes

- [CHD-2445: Add orderIndex to AAAG response](../changes/chd-2445-offence-order-index/proposal.md) — the change that implements this spec
- Downstream: `cpp-ui-prosecution-casefile` AAAG template must display `offence.orderIndex` rather than loop position
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Specs

See CHD-2474.
9 changes: 6 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<parent>
<groupId>uk.gov.moj.cpp.common</groupId>
<artifactId>service-parent-pom</artifactId>
<version>17.103.3</version>
<version>17.103.9</version>
</parent>


<groupId>uk.gov.moj.cpp.progression</groupId>
<artifactId>progression-parent</artifactId>
<version>17.0.261-SNAPSHOT</version>
<version>17.0.263-SNAPSHOT</version>
<packaging>pom</packaging>

<name>Progression services application</name>
Expand Down Expand Up @@ -68,7 +68,7 @@
<access.control.version>6.4.1</access.control.version>
<referencedata.version>17.103.131</referencedata.version>
<listing.version>17.103.162</listing.version>
<hearing.version>17.0.150</hearing.version>
<hearing.version>17.104.168</hearing.version>
<usersgroups.version>17.104.48</usersgroups.version>
<defence.version>17.0.85</defence.version>
<referencedata.offence.version>17.103.42</referencedata.offence.version>
Expand Down Expand Up @@ -197,3 +197,6 @@
</dependencies>
</dependencyManagement>
</project>



2 changes: 1 addition & 1 deletion progression-command/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>uk.gov.moj.cpp.progression</groupId>
<artifactId>progression-parent</artifactId>
<version>17.0.261-SNAPSHOT</version>
<version>17.0.263-SNAPSHOT</version>
</parent>
<artifactId>progression-command</artifactId>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion progression-command/progression-command-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>uk.gov.moj.cpp.progression</groupId>
<artifactId>progression-command</artifactId>
<version>17.0.261-SNAPSHOT</version>
<version>17.0.263-SNAPSHOT</version>
</parent>
<artifactId>progression-command-api</artifactId>
<packaging>war</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.json.Json;
import uk.gov.justice.services.messaging.JsonObjects;
import javax.json.JsonObjectBuilder;

@Provider
Expand All @@ -23,7 +23,7 @@ public class CourtDocumentCommandProvider {

public Action getDocumentTypeId(final Action action) {

final JsonObjectBuilder jsonObjectBuilder = Json.createObjectBuilder().add("courtDocumentId", action.envelope().payloadAsJsonObject().getString("courtDocumentId"));
final JsonObjectBuilder jsonObjectBuilder = JsonObjects.createObjectBuilder().add("courtDocumentId", action.envelope().payloadAsJsonObject().getString("courtDocumentId"));

final MetadataBuilder metadataBuilder = metadataFrom(action.metadata()).withName("progression.query.courtdocument");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import uk.gov.moj.cpp.progression.domain.constant.CaseStatusEnum;

import javax.inject.Inject;
import javax.json.Json;
import uk.gov.justice.services.messaging.JsonObjects;
import javax.json.JsonObject;

@ServiceComponent(COMMAND_API)
Expand All @@ -25,7 +25,7 @@ public class CaseStatusApi {
@Handles("progression.inactive-case-bdf")
public void handleCaseInactiveViaBdf(final JsonEnvelope envelope) {
final JsonObject payload = envelope.payloadAsJsonObject();
final JsonObject jsonObject = Json.createObjectBuilder()
final JsonObject jsonObject = JsonObjects.createObjectBuilder()
.add("prosecutionCaseId", payload.getString("prosecutionCaseId"))
.add("caseStatus", CaseStatusEnum.INACTIVE.name())
.build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package uk.gov.moj.cpp.progression.command;

import static javax.json.Json.createObjectBuilder;
import static uk.gov.justice.services.messaging.JsonObjects.createObjectBuilder;
import static uk.gov.justice.services.core.annotation.Component.COMMAND_API;
import static uk.gov.justice.services.messaging.Envelope.envelopeFrom;
import static uk.gov.justice.services.messaging.Envelope.metadataFrom;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import uk.gov.justice.services.messaging.JsonEnvelope;

import javax.inject.Inject;
import javax.json.Json;
import uk.gov.justice.services.messaging.JsonObjects;
import javax.json.JsonArray;
import javax.json.JsonObject;

Expand All @@ -31,7 +31,7 @@ public void handle(final JsonEnvelope envelope) {
for (int i = 0; i < caseHearings.size(); i++) {
final JsonObject caseHearing = caseHearings.getJsonObject(i);

final JsonObject jsonObject = Json.createObjectBuilder()
final JsonObject jsonObject = JsonObjects.createObjectBuilder()
.add("caseId", caseHearing.getString("caseId"))
.add("hearingId", caseHearing.getString("hearingId"))
.add("resultDate", caseHearing.getString("resultDate"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import uk.gov.justice.services.messaging.JsonEnvelope;

import javax.inject.Inject;
import javax.json.Json;
import uk.gov.justice.services.messaging.JsonObjects;
import javax.json.JsonArray;
import javax.json.JsonObject;
import javax.json.JsonObjectBuilder;
Expand All @@ -32,7 +32,7 @@ public void handle(final JsonEnvelope envelope) {
for (int i = 0; i < applications.size(); i++) {
final JsonObject application = applications.getJsonObject(i);

final JsonObjectBuilder jsonObject = Json.createObjectBuilder()
final JsonObjectBuilder jsonObject = JsonObjects.createObjectBuilder()
.add(ID, application.getString(ID));
if (application.containsKey(APPLICATION_STATUS)) {
jsonObject.add(APPLICATION_STATUS, application.getString(APPLICATION_STATUS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import uk.gov.justice.services.messaging.JsonEnvelope;

import javax.inject.Inject;
import javax.json.Json;
import uk.gov.justice.services.messaging.JsonObjects;
import javax.json.JsonArray;
import javax.json.JsonObject;

Expand All @@ -26,7 +26,7 @@ public void handle(final JsonEnvelope envelope) {
final JsonArray jsonArrayOfCaseIds = payload.getJsonArray("caseIds");

jsonArrayOfCaseIds.forEach(caseId ->
sender.send(envelop(Json.createObjectBuilder().add("caseId", caseId).build())
sender.send(envelop(JsonObjects.createObjectBuilder().add("caseId", caseId).build())
.withName("progression.command.handler.reapply-media-reporting-restrictions")
.withMetadataFrom(envelope))
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import static java.util.Objects.nonNull;
import static java.util.UUID.fromString;
import static java.util.stream.Stream.concat;
import static javax.json.Json.createObjectBuilder;
import static uk.gov.justice.services.messaging.JsonObjects.createObjectBuilder;
import static uk.gov.justice.services.core.annotation.Component.COMMAND_API;
import static uk.gov.justice.services.messaging.Envelope.envelopeFrom;
import static uk.gov.justice.services.messaging.Envelope.metadataFrom;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import static java.util.Objects.nonNull;
import static java.util.UUID.fromString;
import static javax.json.Json.createObjectBuilder;
import static uk.gov.justice.services.messaging.JsonObjects.createObjectBuilder;
import static uk.gov.justice.services.core.annotation.Component.COMMAND_API;
import static uk.gov.justice.services.messaging.Envelope.envelopeFrom;
import static uk.gov.justice.services.messaging.Envelope.metadataFrom;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import java.util.UUID;

import javax.inject.Inject;
import javax.json.Json;
import uk.gov.justice.services.messaging.JsonObjects;
import javax.json.JsonArray;
import javax.json.JsonArrayBuilder;
import javax.json.JsonObject;
Expand Down Expand Up @@ -70,7 +70,7 @@ private JsonObject getUpdatedCourtReferral(final JsonObject referCasesToCourt, f
}

private JsonArray getUpdatedProsecutionCases(final JsonArray originProsecutionCases, final JsonEnvelope envelope) {
final JsonArrayBuilder builder = Json.createArrayBuilder();
final JsonArrayBuilder builder = JsonObjects.createArrayBuilder();
originProsecutionCases.forEach(jsonValue -> {
final JsonObject jsonObject = (JsonObject) jsonValue;
builder.add(addProperty(jsonObject, PROSECUTION_CASE_IDENTIFIER, getUpdatedCaseIdentifier(jsonObject.getJsonObject(PROSECUTION_CASE_IDENTIFIER), envelope)));
Expand All @@ -91,7 +91,7 @@ public static JsonObject addProperty(final JsonObject origin, final String key,
}

private static JsonObjectBuilder createObjectBuilder(final JsonObject origin) {
final JsonObjectBuilder builder = Json.createObjectBuilder();
final JsonObjectBuilder builder = JsonObjects.createObjectBuilder();
for (final Map.Entry<String, JsonValue> entry : origin.entrySet()) {
builder.add(entry.getKey(), entry.getValue());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import uk.gov.justice.services.messaging.JsonEnvelope;

import javax.inject.Inject;
import javax.json.Json;
import uk.gov.justice.services.messaging.JsonObjects;
import javax.json.JsonArray;
import javax.json.JsonObject;

Expand All @@ -32,7 +32,7 @@ public void handle(final JsonEnvelope envelope) {
for (int i = 0; i < jsonArrayOfCaseIds.size(); i++) {
final String caseId = jsonArrayOfCaseIds.getJsonString(i).getString();

sender.send(envelop(Json.createObjectBuilder().add("caseId", caseId).build())
sender.send(envelop(JsonObjects.createObjectBuilder().add("caseId", caseId).build())
.withName("progression.command.handler.resend-laa-outcome-concluded")
.withMetadataFrom(envelope));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import uk.gov.justice.services.messaging.JsonEnvelope;

import javax.inject.Inject;
import javax.json.Json;
import uk.gov.justice.services.messaging.JsonObjects;
import javax.json.JsonArray;
import javax.json.JsonObject;

Expand All @@ -31,7 +31,7 @@ public void handleUpdateLaaHearingDetailsUnifiedSearch(final JsonEnvelope envelo
for (int i = 0; i < jsonArrayOfCaseIds.size(); i++) {
final String caseId = jsonArrayOfCaseIds.getJsonString(i).getString();

sender.send(envelop(Json.createObjectBuilder().add("hearingId", caseId).build())
sender.send(envelop(JsonObjects.createObjectBuilder().add("hearingId", caseId).build())
.withName("progression.command.handler.update-hearing-details-in-unified-search")
.withMetadataFrom(envelope));

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package uk.gov.moj.cpp.progression.command.accesscontrol;

import static javax.json.Json.createObjectBuilder;
import static uk.gov.justice.services.messaging.JsonObjects.createObjectBuilder;
import static uk.gov.moj.cpp.accesscontrol.drools.ExpectedPermission.builder;

import uk.gov.justice.services.common.converter.jackson.ObjectMapperProducer;
Expand Down
Loading