Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
8c08675
DD-38231, SNI-9142 (#446)
AnumulaBhagyaLakshmi Jul 2, 2026
8412e13
updating poms for 17.0.271-SNAPSHOT development
Jul 2, 2026
58262f0
updating poms for 17.0.272-SNAPSHOT development
Jul 2, 2026
e5a14ce
updating poms for 17.0.273-SNAPSHOT development
Jul 2, 2026
6840571
updating poms for 17.0.273 branch with snapshot versions
Jul 2, 2026
b9e870a
updating poms for 17.0.274-SNAPSHOT development
Jul 2, 2026
74b527d
updating poms for branch'dev/release-17.0.273' with non-snapshot vers…
Jul 2, 2026
61d5968
Merge branch 'dev/release-17.0.273' into dev/release
Jul 2, 2026
c51b675
updating develop poms to master versions to avoid merge conflicts
Jul 2, 2026
bfe04fb
Merge branch 'dev/release' into main
Jul 2, 2026
b9013eb
Updating develop poms back to pre merge state
Jul 2, 2026
3f1018f
updating poms for 17.0.275-SNAPSHOT development
Jul 2, 2026
566c762
updating poms for 17.0.275 branch with snapshot versions
Jul 3, 2026
23e7856
updating poms for 17.0.276-SNAPSHOT development
Jul 3, 2026
571285a
updating poms for branch'dev/release-17.0.275' with non-snapshot vers…
Jul 3, 2026
3aced28
Merge branch 'dev/release-17.0.275' into dev/release
Jul 3, 2026
830b6ac
updating develop poms to master versions to avoid merge conflicts
Jul 3, 2026
cbb417e
Merge branch 'dev/release' into main
Jul 3, 2026
0a55362
Updating develop poms back to pre merge state
Jul 3, 2026
0ca1ffa
MS8 release: merge team/dlrm8 into main (#459)
ozgursoftware Jul 8, 2026
8eec28c
updating poms for 17.0.276 branch with snapshot versions
Jul 8, 2026
c3ccbdb
updating poms for 17.0.277-SNAPSHOT development
Jul 8, 2026
c7064de
updating poms for branch'dev/release-17.0.276' with non-snapshot vers…
Jul 8, 2026
52d3b56
Merge branch 'dev/release-17.0.276' into dev/release
Jul 8, 2026
3173d5d
updating develop poms to master versions to avoid merge conflicts
Jul 8, 2026
fdbd9ea
Merge branch 'dev/release' into main
Jul 8, 2026
bdf9b7f
Updating develop poms back to pre merge state
Jul 8, 2026
9fb7356
PDE977 (#466)
aliyksel Jul 9, 2026
88f7d91
updating poms for 17.0.277 branch with snapshot versions
Jul 9, 2026
eb9f76c
updating poms for 17.0.278-SNAPSHOT development
Jul 9, 2026
2343ae0
updating poms for branch'dev/release-17.0.277' with non-snapshot vers…
Jul 9, 2026
e51ec6e
Merge branch 'dev/release-17.0.277' into dev/release
Jul 9, 2026
bcaa774
updating develop poms to master versions to avoid merge conflicts
Jul 9, 2026
e5cfa12
Merge branch 'dev/release' into main
Jul 9, 2026
79edf7c
Updating develop poms back to pre merge state
Jul 9, 2026
ad1286f
CHD-2556 - merge team/CCT-2353 to main (#476)
aykutdanisman Jul 16, 2026
da2f830
updating poms for 17.0.278 branch with snapshot versions
Jul 16, 2026
1903354
updating poms for 17.0.279-SNAPSHOT development
Jul 16, 2026
f657add
updating poms for branch'dev/release-17.0.278' with non-snapshot vers…
Jul 16, 2026
5f3030d
Merge branch 'dev/release-17.0.278' into dev/release
Jul 16, 2026
f7e910a
updating develop poms to master versions to avoid merge conflicts
Jul 16, 2026
314854e
Merge branch 'dev/release' into main
Jul 16, 2026
e804dff
Updating develop poms back to pre merge state
Jul 16, 2026
b6e3b19
updating poms for 17.0.279 branch with snapshot versions
Jul 16, 2026
004d0cb
updating poms for 17.0.280-SNAPSHOT development
Jul 16, 2026
c3df40e
updating poms for branch'dev/release-17.0.279' with non-snapshot vers…
Jul 16, 2026
532b728
Merge branch 'dev/release-17.0.279' into dev/release
Jul 16, 2026
07ebf38
updating develop poms to master versions to avoid merge conflicts
Jul 16, 2026
56b87cb
Merge branch 'dev/release' into main
Jul 16, 2026
d508e41
Updating develop poms back to pre merge state
Jul 16, 2026
0043555
SPRDT-1199 rebase with main
rajkunchala Jul 29, 2026
bb72a57
ref data version
rajkunchala Jul 29, 2026
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
8 changes: 3 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
<module>progression-healthchecks</module>
</modules>



<properties>
<sonar.jacoco.itReportPath>${project.basedir}/../target/jacoco-it.exec
</sonar.jacoco.itReportPath>
Expand Down Expand Up @@ -68,7 +66,7 @@
<material.version>17.0.75</material.version>
<json-transformer.version>1.0.6</json-transformer.version>
<access.control.version>6.4.1</access.control.version>
<referencedata.version>17.103.133</referencedata.version>
<referencedata.version>17.104.137</referencedata.version>
<listing.version>17.103.163</listing.version>
<hearing.version>17.104.173</hearing.version>
<usersgroups.version>17.104.49</usersgroups.version>
Expand All @@ -77,10 +75,10 @@
<coredomain.version>17.103.13</coredomain.version>
<directionsmanagement.version>8.0.30</directionsmanagement.version>
<elasticsearch-maven-plugin.version>6.13</elasticsearch-maven-plugin.version>
<results.version>17.104.110</results.version>
<results.version>17.104.112</results.version>
<notification.notify.version>17.104.44</notification.notify.version>
<unifiedsearch.version>17.0.26</unifiedsearch.version>
<systemdocgenerator.version>17.0.64</systemdocgenerator.version>
<systemdocgenerator.version>17.104.114</systemdocgenerator.version>
<applicationscourtorders.version>17.0.70</applicationscourtorders.version>
<sjp.version>17.103.170</sjp.version>
<httpmime.version>4.5.1</httpmime.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"summonsApprovalRequired": {
"description": "Indicates that the summons approval process is required to be initiated",
"type": "boolean"
},
"applicationSource": {
"$ref": "http://moj.gov.uk/cpp/progression/enum-def.json#/definitions/applicationSource"
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
import static uk.gov.justice.core.courts.ProsecutingAuthority.prosecutingAuthority;
import static uk.gov.justice.services.core.annotation.Component.COMMAND_HANDLER;
import static uk.gov.justice.services.messaging.JsonEnvelope.envelopeFrom;
import static uk.gov.moj.cpp.progression.domain.constant.CaseStatusEnum.CLOSED;
import static uk.gov.moj.cpp.progression.domain.constant.CaseStatusEnum.INACTIVE;
import static uk.gov.moj.cpp.progression.enums.ApplicationSource.MH;
import static uk.gov.moj.cpp.progression.enums.ApplicationSource.UNKNOWN;

import uk.gov.justice.core.courts.AddBreachApplication;
import uk.gov.justice.core.courts.AddCourtApplicationToCase;
Expand Down Expand Up @@ -63,6 +67,7 @@
import uk.gov.justice.services.messaging.Metadata;
import uk.gov.moj.cpp.progression.aggregate.ApplicationAggregate;
import uk.gov.moj.cpp.progression.aggregate.HearingAggregate;
import uk.gov.moj.cpp.progression.enums.ApplicationSource;
import uk.gov.moj.cpp.progression.service.ApplicationDetailsEnrichmentService;
import uk.gov.moj.cpp.progression.service.ProsecutionCaseQueryService;
import uk.gov.moj.cpp.progression.service.RefDataService;
Expand Down Expand Up @@ -349,7 +354,7 @@ private InitiateCourtApplicationProceedings rebuildInitiateCourtApplicationProce
final boolean applicationReferredToNewHearing, final Envelope<InitiateCourtApplicationProceedings> envelope) {
final boolean summonsApprovalRequired = isSummonsApprovalRequired(initiateCourtProceedingsForApplication.getBoxHearing(), initiateCourtProceedingsForApplication.getCourtApplication());
final InitiateCourtApplicationProceedings.Builder initiateCourtProceedingsForApplicationBuilder = InitiateCourtApplicationProceedings.initiateCourtApplicationProceedings()
.withCourtApplication(rebuildCourtApplication(initiateCourtProceedingsForApplication.getCourtApplication(), envelope))
.withCourtApplication(rebuildCourtApplication(initiateCourtProceedingsForApplication.getCourtApplication(), initiateCourtProceedingsForApplication.getApplicationSource(), envelope))
.withSummonsApprovalRequired(summonsApprovalRequired)
.withIsAmended(initiateCourtProceedingsForApplication.getIsAmended())
.withOldApplicationId(initiateCourtProceedingsForApplication.getOldApplicationId())
Expand Down Expand Up @@ -384,13 +389,13 @@ private EditCourtApplicationProceedings rebuildEditCourtApplicationProceedings(f
final boolean summonsApprovalRequired = isSummonsApprovalRequired(editCourtApplicationProceedings.getBoxHearing(), editCourtApplicationProceedings.getCourtApplication());
final EditCourtApplicationProceedings.Builder editCourtProceedingsForApplicationBuilder = EditCourtApplicationProceedings.editCourtApplicationProceedings()
.withValuesFrom(editCourtApplicationProceedings)
.withCourtApplication(rebuildCourtApplication(editCourtApplicationProceedings.getCourtApplication(), envelope))
.withCourtApplication(rebuildCourtApplication(editCourtApplicationProceedings.getCourtApplication(), UNKNOWN, envelope))
.withSummonsApprovalRequired(summonsApprovalRequired);

return editCourtProceedingsForApplicationBuilder.build();
}

private CourtApplication rebuildCourtApplication(final CourtApplication courtApplication, final Envelope<?> envelope) {
private CourtApplication rebuildCourtApplication(final CourtApplication courtApplication, final ApplicationSource applicationSource, final Envelope<?> envelope) {

final LaaReference laaReference = getLaaApplnReference(courtApplication, envelope);

Expand All @@ -404,7 +409,7 @@ private CourtApplication rebuildCourtApplication(final CourtApplication courtApp
final JsonEnvelope jsonEnvelope = envelopeFrom(envelope.metadata(), JsonValue.NULL);

updateClonedCourtApplicationParties(courtApplicationBuilder, courtApplication, jsonEnvelope);
updateClonedOffenceApplicationCases(courtApplicationBuilder, courtApplication);
updateClonedOffenceApplicationCases(courtApplicationBuilder, courtApplication, applicationSource);
updateClonedOffenceCourtOrder(courtApplicationBuilder, courtApplication);


Expand Down Expand Up @@ -446,7 +451,7 @@ private boolean hasActivationCode(CourtApplicationType type) {
return StringUtils.isNotEmpty(type.getResentencingActivationCode());
}

private void updateClonedOffenceApplicationCases(final CourtApplication.Builder courtApplicationBuilder, final CourtApplication courtApplication) {
private void updateClonedOffenceApplicationCases(final CourtApplication.Builder courtApplicationBuilder, final CourtApplication courtApplication, final ApplicationSource applicationSource) {
if (isNull(courtApplication.getCourtApplicationCases())) {
return;
}
Expand All @@ -461,17 +466,31 @@ private void updateClonedOffenceApplicationCases(final CourtApplication.Builder
final String resentencingActivationCode = courtApplication.getType().getResentencingActivationCode();

final List<CourtApplicationCase> courtApplicationCases = courtApplication.getCourtApplicationCases().stream()
.map(courtApplicationCase -> courtApplicationCase()
.map(courtApplicationCase -> {
if (ignoreCaseOffences(courtApplicationCase.getCaseStatus(), applicationSource)) {
return courtApplicationCase()
.withValuesFrom(courtApplicationCase)
.withOffences(null)
.build();
} else {
return courtApplicationCase()
.withValuesFrom(courtApplicationCase)
.withOffences(ofNullable(courtApplicationCase.getOffences()).map(Collection::stream).orElseGet(Stream::empty)
.withOffences(ofNullable(courtApplicationCase.getOffences()).stream().flatMap(Collection::stream)
.map(courtApplicationOffence -> updateOffence(courtApplication.getType(), courtApplicationOffence, wordingPattern, resentencingActivationCode))
.collect(collectingAndThen(toList(), getListOrNull())))
.build())
.collect(toList());
.build();
}
}).collect(toList());

courtApplicationBuilder.withCourtApplicationCases(courtApplicationCases);
}

private boolean ignoreCaseOffences(final String caseStatus, final ApplicationSource applicationSource) {
final boolean activeCase = !(INACTIVE.name().equalsIgnoreCase(caseStatus) || CLOSED.name().equalsIgnoreCase(caseStatus));

return activeCase && MH == applicationSource;
}

private <T> UnaryOperator<List<T>> getListOrNull() {
return list -> list.isEmpty() ? null : list;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import uk.gov.justice.services.eventsourcing.source.core.EventStream;
import uk.gov.justice.services.eventsourcing.source.core.exception.EventStreamException;
import uk.gov.justice.services.messaging.Envelope;
import uk.gov.moj.cpp.progression.aggregate.ApplicationAggregate;
import uk.gov.moj.cpp.progression.aggregate.CaseAggregate;

import java.util.List;
Expand Down Expand Up @@ -77,13 +78,18 @@ private boolean isDefendantsFinancialData(final CourtDocument courtDocument) {

private void updateEventStream(final UUID prosecutionCaseId, final UUID defendantId, final UUID applicationId,
final List<Material> materials,
final Envelope<CreateCourtDocument> createCourtDocumentEnvelope)
throws EventStreamException {

final EventStream eventStream = eventSource.getStreamById(prosecutionCaseId);
final CaseAggregate caseAggregate = aggregateService.get(eventStream, CaseAggregate.class);
final Stream<Object> events = caseAggregate.addFinancialMeansData(prosecutionCaseId, defendantId, applicationId, materials.get(0));
eventStream.append(events.map(Enveloper.toEnvelopeWithMetadataFrom(createCourtDocumentEnvelope)));
final Envelope<CreateCourtDocument> createCourtDocumentEnvelope) throws EventStreamException {
if (prosecutionCaseId != null) {
final EventStream eventStream = eventSource.getStreamById(prosecutionCaseId);
final CaseAggregate caseAggregate = aggregateService.get(eventStream, CaseAggregate.class);
final Stream<Object> events = caseAggregate.addFinancialMeansData(prosecutionCaseId, defendantId, applicationId, materials.get(0));
eventStream.append(events.map(Enveloper.toEnvelopeWithMetadataFrom(createCourtDocumentEnvelope)));
} else if (prosecutionCaseId == null && applicationId != null) {
final EventStream eventStream = eventSource.getStreamById(applicationId);
final ApplicationAggregate applicationAggregate = aggregateService.get(eventStream, ApplicationAggregate.class);
final Stream<Object> events = applicationAggregate.addFinancialMeansData(prosecutionCaseId, defendantId, applicationId, materials.get(0));
eventStream.append(events.map(Enveloper.toEnvelopeWithMetadataFrom(createCourtDocumentEnvelope)));
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
"description": "Indicates that the summons approval process is required to be initiated",
"type": "boolean"
},
"applicationSource": {
"$ref": "http://moj.gov.uk/cpp/progression/enum-def.json#/definitions/applicationSource"
},
"isAmended": {
"type": "boolean"
},
Expand Down
Loading
Loading