Skip to content

Cimd 3915 informant register local schema#172

Merged
erolkurelihmcts merged 23 commits into
team/CIMD-3915-verdict-objectfrom
CIMD-3915-informant-register-local-schema
Jun 19, 2026
Merged

Cimd 3915 informant register local schema#172
erolkurelihmcts merged 23 commits into
team/CIMD-3915-verdict-objectfrom
CIMD-3915-informant-register-local-schema

Conversation

@erolkurelihmcts

Copy link
Copy Markdown

Jira link

See CIMD-3915

Change description

Testing done

Security Vulnerability Assessment

CVE Suppression: Are there any CVEs present in the codebase (either newly introduced or pre-existing) that are being intentionally suppressed or ignored by this commit?

  • Yes
  • No

Checklist

  • commit messages are meaningful and follow good commit message guidelines
  • README and other documentation has been updated / added (if needed)
  • tests have been updated / new tests has been added (if needed)
  • Does this PR introduce a breaking change

psrvarma and others added 7 commits June 16, 2026 13:22
- verdict.json: add dependencies constraint enforcing verdictCode/verdictDate co-presence (FR-004)
- spec.md: record dual-emit decision (V2 only for new ingest, V1 retained for replay)
- tasks.md: remove duplicate T049; add T071 (FR-004 rejection test), T072 (FR-008 warning-log test), T073 (empty-verdict omit test); relabel T063 as regression guard; add SC-003/SC-004 to T070; add phase mapping table; fix stale T049 reference in implementation strategy

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@erolkurelihmcts erolkurelihmcts requested a review from a team as a code owner June 17, 2026 00:19
@erolkurelihmcts erolkurelihmcts requested review from ZaheerIqbal-HMCTS, laxmankerai93 and sevketarisu and removed request for a team June 17, 2026 00:19
@SachinDangui SachinDangui requested a review from jayenhc June 17, 2026 08:31

@SachinDangui SachinDangui left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spotted two issues that look worth fixing before merge:

  1. The event processor handles , but its subscription descriptor only includes the original notified event. Since the aggregate now emits the V2 notified event, the listener can mark the register as notified while the processor never receives the event to send the email. Please add the V2 notified event to the processor subscription descriptor.

  2. The PR adds handwritten V2 event classes while the new V2 event schemas are also included in the domain-common schema generation path. A normal Maven run generates equivalent \ classes with the same event names, leaving two event classes for each new event. That can make event/envelope resolution ambiguous. I’d suggest using the generated event classes consistently, or excluding these schemas from generation if the handwritten classes are intentional.

@hmcts hmcts deleted a comment from cpp-github-management Bot Jun 17, 2026
@erolkurelihmcts erolkurelihmcts requested review from psrvarma and removed request for ZaheerIqbal-HMCTS, jayenhc, laxmankerai93 and sevketarisu June 17, 2026 08:40
@cpp-github-management

Copy link
Copy Markdown

Passed

private void processRequests(final UUID informantRegisterId, final List<JsonObject> informantRegisterRequest, final Envelope jsonEnvelope, final boolean systemGenerated) {
try {
final EventStream eventStream = eventSource.getStreamById(informantRegisterId);
final List<InformantRegisterDocumentRequest> informantRegisterDocumentRequests = informantRegisterRequest.stream().map(informantRegister -> stringToJsonObjectConverter.convert(informantRegister.getString((FIELD_PAYLOAD))))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not going to work. We need to handle 2 versions of payloads.

final List payloads = informantRegisterRequests.stream()
.map(row -> stringToJsonObjectConverter.convert(row.getString(FIELD_PAYLOAD)))
.toList();

      final List<JsonObject> v1Payloads = payloads.stream()
              .filter(this::isV1InformantRegisterPayload)
              .toList();

      final List<JsonObject> v2Payloads = payloads.stream()
              .filter(payload -> !isV1InformantRegisterPayload(payload))
              .toList();

@cpp-github-management

Copy link
Copy Markdown

Passed

@cpp-github-management

Copy link
Copy Markdown

Passed

final InformantRegisterGeneratedV2 informantRegisterGenerated = jsonObjectToObjectConverter.convert(payload, InformantRegisterGeneratedV2.class);
final ZonedDateTime currentDateTime = now();

final UUID prosecutionAuthorityId = informantRegisterGenerated.getInformantRegisterDocumentRequests().get(0).getProsecutionAuthorityId();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will result in NPE if there are no records in DB

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

}

@Handles("results.query.informant-register-document-by-request-date")
public JsonEnvelope getInformantRegistersByRequestDate(final JsonEnvelope envelope) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to do payload transformations here?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@cpp-github-management

Copy link
Copy Markdown

Failed

@cpp-github-management

Copy link
Copy Markdown

Failed

@cpp-github-management

Copy link
Copy Markdown

Failed

@cpp-github-management

Copy link
Copy Markdown

Failed

@cpp-github-management

Copy link
Copy Markdown

Passed

import java.util.stream.Collectors;
import java.util.stream.Stream;

public class ProsecutionAuthorityAggregate implements Aggregate {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change the searchVersionUID

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@cpp-github-management

Copy link
Copy Markdown

Passed

@cpp-github-management

Copy link
Copy Markdown

Passed

@erolkurelihmcts erolkurelihmcts merged commit 2a453cb into team/CIMD-3915-verdict-object Jun 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants