Skip to content

AMP-504 Forward rawPayload from File Service in PCR subscription notification#311

Merged
srivanimuddineni merged 4 commits into
team/ampfrom
dev/AMP-504-changes
May 19, 2026
Merged

AMP-504 Forward rawPayload from File Service in PCR subscription notification#311
srivanimuddineni merged 4 commits into
team/ampfrom
dev/AMP-504-changes

Conversation

@srivanimuddineni
Copy link
Copy Markdown
Contributor

JIRA

AMP-504

What changed

  • FileService.java: injected FileRetriever alongside existing FileStorer; added retrievePayload(UUID) method that reads the stored JSON payload back from File Service
  • PcrEventPayload.java: added Map<String, Object> rawPayload field to the Lombok builder DTO
  • HearingResultsDocumentSubscriptionPCRMapper.java: updated mapPcrForhearingResultsDocument to 4-arg signature accepting rawPayload; fixed pre-existing bug where timestamp was always set to Instant.now() instead of the createdAt parameter
  • PrisonCourtRegisterEventProcessor.java: injected ObjectMapper; in sendPrisonCourtRegisterV2() now fetches rawPayload from File Service via fileService.retrievePayload(fileId) before calling the mapper; falls back to the v2 event JSON itself if File Service returns empty
  • Tests: FileServiceTest (+2 retrieve tests), HearingResultsDocumentSubscriptionPCRMapperTest (updated to 4-arg + 2 new tests), PrisonCourtRegisterEventProcessorTest (all V2 tests updated to 4-arg + 2 new rawPayload assertion tests)

Why it's needed

The downstream subscription service (service-cp-crime-hearing-results-document-subscription) requires a rawPayload field on inbound EventPayload POSTs so consumers can retrieve the full PCR source data via GET /notifications/{notificationId}/payload. The mappedPayload is already stored in File Service by generatePrisonCourtRegister() and its fileId is carried in every prison-court-register-generated-v2 event — this change wires up the retrieval with no event store, schema, or aggregate changes.

🤖 Generated with Claude Code

srivanimuddineni and others added 3 commits May 19, 2026 14:24
…riever

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… bug

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…egisterV2

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@srivanimuddineni srivanimuddineni requested a review from a team as a code owner May 19, 2026 13:37
@srivanimuddineni srivanimuddineni requested review from ReddiK411, SeemaSajan, coling01, samirgarg, sneha0416 and vineetkapoor-hmcts and removed request for a team May 19, 2026 13:37
@cpp-github-management
Copy link
Copy Markdown

Passed

@cpp-github-management
Copy link
Copy Markdown

Passed

@srivanimuddineni srivanimuddineni merged commit e58e442 into team/amp May 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.

2 participants