Skip to content

SSCSCI-2354: Fix isScottishCase not being set for bulk scan cases#5115

Open
alext-justice wants to merge 5 commits intomasterfrom
fix/isScottishCase-bulk-scan
Open

SSCSCI-2354: Fix isScottishCase not being set for bulk scan cases#5115
alext-justice wants to merge 5 commits intomasterfrom
fix/isScottishCase-bulk-scan

Conversation

@alext-justice
Copy link

Summary

  • Add isScottishCase to SscsCaseValidator when RPC is set for paper/bulk scan cases
  • Add backfill logic to CaseUpdatedAboutToSubmitHandler to set isScottishCase if empty when cases are updated
  • Add tests for both fixes

Problem

Scottish cases created via bulk scan/paper appeals were not getting isScottishCase set because:

  1. CreateCaseAboutToSubmitHandler excludes paper cases (receivedVia == "Paper")
  2. Bulk scan flow in SscsCaseValidator sets regionalProcessingCenter but not isScottishCase

This resulted in only 3 out of 72 Glasgow cases having the isScottishCase flag set correctly.

Solution

  1. Primary fix: Set isScottishCase in SscsCaseValidator when RPC is determined for bulk scan cases
  2. Backfill fix: Update maybeChangeIsScottish to also set the flag when it's empty (not just when RPC changes), so existing cases get backfilled on next update

Test plan

  • Unit tests added for SscsCaseValidator - Glasgow and non-Glasgow postcodes
  • Unit tests added for CaseUpdatedAboutToSubmitHandler - backfill scenario
  • All existing tests pass

🤖 Generated with Claude Code

- Add isScottishCase to SscsCaseValidator when RPC is set for paper/bulk scan cases
- Add backfill logic to CaseUpdatedAboutToSubmitHandler to set isScottishCase if empty
- Add tests for both fixes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@alext-justice alext-justice requested a review from a team as a code owner March 9, 2026 17:07
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

CCD diff report

No change

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Integration Tests results

   84 files  ±0     84 suites  ±0   11m 43s ⏱️ +26s
1 507 tests ±0  1 499 ✅ ±0  8 💤 ±0  0 ❌ ±0 
1 510 runs  ±0  1 502 ✅ ±0  8 💤 ±0  0 ❌ ±0 

Results for commit bd4bfe8. ± Comparison against base commit 15d1e8c.

This pull request removes 8 and adds 8 tests. Note that renamed tests count towards both.
uk.gov.hmcts.reform.sscs.bulkscan.controllers.SscsBulkScanExceptionRecordCallback ‑ [1] url=http://localhost:32953/transform-exception-record/, isAuto=false
uk.gov.hmcts.reform.sscs.bulkscan.controllers.SscsBulkScanExceptionRecordCallback ‑ [2] url=http://localhost:32953/transform-scanned-data/, isAuto=true
uk.gov.hmcts.reform.sscs.tyanotifications.tya.NotificationItForReviewConfidentialityRequestTest ‑ givenAppellantConfidentialityRequest_shouldSendConfidentialityLetter(DatedRequestOutcome[requestOutcome=granted, date=2026-03-10]) [0]
uk.gov.hmcts.reform.sscs.tyanotifications.tya.NotificationItForReviewConfidentialityRequestTest ‑ givenAppellantConfidentialityRequest_shouldSendConfidentialityLetter(DatedRequestOutcome[requestOutcome=refused, date=2026-03-10]) [1]
uk.gov.hmcts.reform.sscs.tyanotifications.tya.NotificationItForReviewConfidentialityRequestTest ‑ givenJointPartyAndAppellantConfidentialityRequest_shouldSendBothConfidentialityLetters(DatedRequestOutcome[requestOutcome=granted, date=2026-03-10]) [0]
uk.gov.hmcts.reform.sscs.tyanotifications.tya.NotificationItForReviewConfidentialityRequestTest ‑ givenJointPartyAndAppellantConfidentialityRequest_shouldSendBothConfidentialityLetters(DatedRequestOutcome[requestOutcome=refused, date=2026-03-10]) [1]
uk.gov.hmcts.reform.sscs.tyanotifications.tya.NotificationItForReviewConfidentialityRequestTest ‑ givenJointPartyConfidentialityRequest_shouldSendConfidentialityLetter(DatedRequestOutcome[requestOutcome=granted, date=2026-03-10]) [0]
uk.gov.hmcts.reform.sscs.tyanotifications.tya.NotificationItForReviewConfidentialityRequestTest ‑ givenJointPartyConfidentialityRequest_shouldSendConfidentialityLetter(DatedRequestOutcome[requestOutcome=refused, date=2026-03-10]) [1]
uk.gov.hmcts.reform.sscs.bulkscan.controllers.SscsBulkScanExceptionRecordCallback ‑ [1] url=http://localhost:42299/transform-exception-record/, isAuto=false
uk.gov.hmcts.reform.sscs.bulkscan.controllers.SscsBulkScanExceptionRecordCallback ‑ [2] url=http://localhost:42299/transform-scanned-data/, isAuto=true
uk.gov.hmcts.reform.sscs.tyanotifications.tya.NotificationItForReviewConfidentialityRequestTest ‑ givenAppellantConfidentialityRequest_shouldSendConfidentialityLetter(DatedRequestOutcome[requestOutcome=granted, date=2026-03-11]) [0]
uk.gov.hmcts.reform.sscs.tyanotifications.tya.NotificationItForReviewConfidentialityRequestTest ‑ givenAppellantConfidentialityRequest_shouldSendConfidentialityLetter(DatedRequestOutcome[requestOutcome=refused, date=2026-03-11]) [1]
uk.gov.hmcts.reform.sscs.tyanotifications.tya.NotificationItForReviewConfidentialityRequestTest ‑ givenJointPartyAndAppellantConfidentialityRequest_shouldSendBothConfidentialityLetters(DatedRequestOutcome[requestOutcome=granted, date=2026-03-11]) [0]
uk.gov.hmcts.reform.sscs.tyanotifications.tya.NotificationItForReviewConfidentialityRequestTest ‑ givenJointPartyAndAppellantConfidentialityRequest_shouldSendBothConfidentialityLetters(DatedRequestOutcome[requestOutcome=refused, date=2026-03-11]) [1]
uk.gov.hmcts.reform.sscs.tyanotifications.tya.NotificationItForReviewConfidentialityRequestTest ‑ givenJointPartyConfidentialityRequest_shouldSendConfidentialityLetter(DatedRequestOutcome[requestOutcome=granted, date=2026-03-11]) [0]
uk.gov.hmcts.reform.sscs.tyanotifications.tya.NotificationItForReviewConfidentialityRequestTest ‑ givenJointPartyConfidentialityRequest_shouldSendConfidentialityLetter(DatedRequestOutcome[requestOutcome=refused, date=2026-03-11]) [1]

♻️ This comment has been updated with latest results.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant