Skip to content

CN-195 Emit single-character region in CASE_UPDATE events - #38

Merged
sumeetons merged 1 commit into
mainfrom
CN-195-initial-character-region-for-case-update
Sep 21, 2026
Merged

sumeetons merged 1 commit into
mainfrom
CN-195-initial-character-region-for-case-update

Conversation

@sumeetons

@sumeetons sumeetons commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Motivation and Context

Integrated Census services expect CASE_UPDATE region values to be a single
country character such as E, W, N, or S. Current sample data contains
more specific region codes such as E12000009, which the case processor was
publishing unchanged.

What has changed

Outbound CASE_UPDATE mapping

  • Map the stored region to its leading character when building outbound
    CASE_UPDATE payloads.
  • Preserve the complete region code on the case record.
  • Preserve existing null and empty-region handling.

Automated tests

  • Updated service coverage to verify the emitted and stored region values.
  • Updated new-case integration coverage to use a full region code.
  • Updated invalid-address integration coverage because it uses the same shared
    outbound mapper.

How to test?

cd census31-rm-case-processor
mvn -q test
mvn -o -q spotless:check

Results: 159 tests passed with 0 failures and 1 skipped. Spotless passed.

Links

Screenshots (if appropriate):

N/A

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@sumeetons sumeetons added the patch A non-feature change, e.g. bug or issue fix label Sep 18, 2026
@github-actions

Copy link
Copy Markdown

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ MARKDOWN markdownlint 2 0 0 0.27s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@AdamHawtin AdamHawtin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 👍

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The mapping preserves null and empty values while correctly separating stored and emitted region representations.

Review effort: Lite
Findings: None

What changed in this PR

Updates outbound CASE_UPDATE events to emit only the leading region character while retaining the full region code on stored cases.

Changes:

  • Added leading-character mapping for outbound regions.
  • Updated unit and integration tests for full stored region codes and single-character emitted values.
File Description
CaseFieldMapper.java Maps outbound region values to their leading character.
CaseServiceTest.java Verifies emitted and stored region values.
NewCaseReceiverIT.java Tests full inbound region preservation and outbound mapping.
InvalidAddressReceiverIT.java Updates shared mapper expectations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ravindra-tummuru ravindra-tummuru 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.

LGTM

@sumeetons
sumeetons merged commit b7b76cc into main Sep 21, 2026
6 checks passed
@sumeetons
sumeetons deleted the CN-195-initial-character-region-for-case-update branch September 21, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch A non-feature change, e.g. bug or issue fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants