Skip to content

HDPI 3789 tenancy notice welsh postcodes FE#994

Open
sdmiddletonSolirius wants to merge 13 commits intomasterfrom
HDPI-3789-tenancy-notice-welsh-postcodes-FE
Open

HDPI 3789 tenancy notice welsh postcodes FE#994
sdmiddletonSolirius wants to merge 13 commits intomasterfrom
HDPI-3789-tenancy-notice-welsh-postcodes-FE

Conversation

@sdmiddletonSolirius
Copy link
Copy Markdown
Contributor

@sdmiddletonSolirius sdmiddletonSolirius commented Mar 26, 2026

Jira link

See HDPI-3789

Change description

  • Replaced interpolated English fragments with dedicated full-sentence translation keys for standard vs secure occupation contracts (tenancyTypeWalesStandard / tenancyTypeWalesSecure); England behaviour unchanged.
  • Added emoji / invalid-character validation on the “correct type” free-text field with EN/CY and matching error messages
Screenshot 2026-04-01 at 15 24 41 Screenshot 2026-04-01 at 16 36 41 Screenshot 2026-04-01 at 16 37 26 Screenshot 2026-04-01 at 16 39 46

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

@sdmiddletonSolirius sdmiddletonSolirius marked this pull request as ready for review April 1, 2026 15:50
const otherTenancyTypeDetails = req.res?.locals.validatedCase?.data
?.tenancy_DetailsOfOtherTypeOfTenancyLicence as string;
const caseData = req.res?.locals.validatedCase?.data;
const welsh = await isWelshProperty(req);
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.

Minor - to avoid confusion we generally use the term "Wales" for the property location and "Welsh" for the language, so perhaps rename this method accordingly. Also it would be slightly better to name the local variable as walesProperty or isWalesProperty.

It would also be nice if there was a way to have an overloaded function where you can pass in the caseData - is anything like that possible in NodeJS?

Finally, does the isWelshProperty function actually have to be async?

translationKey: {
label: 'correctTypeLabel',
},
validator: (value: unknown): boolean | string => {
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 function return type seems a bit odd to me, but I see you are just fitting in with the existing implementation.

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.

2 participants