Cimd 3915 informant register local schema#172
Conversation
- 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>
SachinDangui
left a comment
There was a problem hiding this comment.
I spotted two issues that look worth fixing before merge:
-
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.
-
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.
| 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)))) |
There was a problem hiding this comment.
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();
This reverts commit 0d77745.
| final InformantRegisterGeneratedV2 informantRegisterGenerated = jsonObjectToObjectConverter.convert(payload, InformantRegisterGeneratedV2.class); | ||
| final ZonedDateTime currentDateTime = now(); | ||
|
|
||
| final UUID prosecutionAuthorityId = informantRegisterGenerated.getInformantRegisterDocumentRequests().get(0).getProsecutionAuthorityId(); |
There was a problem hiding this comment.
This will result in NPE if there are no records in DB
| } | ||
|
|
||
| @Handles("results.query.informant-register-document-by-request-date") | ||
| public JsonEnvelope getInformantRegistersByRequestDate(final JsonEnvelope envelope) { |
There was a problem hiding this comment.
Do we need to do payload transformations here?
| import java.util.stream.Collectors; | ||
| import java.util.stream.Stream; | ||
|
|
||
| public class ProsecutionAuthorityAggregate implements Aggregate { |
2a453cb
into
team/CIMD-3915-verdict-object
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?
Checklist