Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UAR-1502 Make 'property name or number' field optional #1376

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mwestacott
Copy link
Contributor

JIRA link

https://companieshouse.atlassian.net/browse/UAR-1502

Change description

  • data entry in this field is now optional for the Update and Remove journeys
  • a value must still be entered if on the Registration journey

Change is for a spike - no unit-tests added

Work checklist

  • Tests added where applicable
  • UI changes meet accessibility criteria

Merge instructions

We are committed to keeping commit history clean, consistent and linear. To achieve this, this commit should be structured as follows:

<type>[optional scope]: <description>

and contain the following structural elements:

  • fix: a commit that patches a bug in your codebase (this correlates with PATCH in semantic versioning),
  • feat: a commit that introduces a new feature to the codebase (this correlates with MINOR in semantic versioning),
  • BREAKING CHANGE: a commit that has a footer BREAKING CHANGE: introduces a breaking API change (correlating with MAJOR in semantic versioning). A BREAKING CHANGE can be part of commits of any type,
  • types other than fix: and feat: are allowed, for example build:, chore:, ci:, docs:, style:, refactor:, perf:, test:, and others,
  • footers other than BREAKING CHANGE: <description> may be provided.

* data entry in this field is now optional for the Update and Remove journeys
* a value must still be entered if on the Registration journey

Change is for a spike - no unit-tests added
};

export const checkPresenceOfPropertyNameOrNumber = (propertyNameOrNumber: string, req) => {
if (propertyNameOrNumber === undefined || propertyNameOrNumber === "") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I copied the approach taken for the 'email' field here, but if we do ever implement this, we may wish to trim the value too before testing it.

@markpit
Copy link
Contributor

markpit commented May 2, 2024

looks ok to me

export const overseas_entity_address_validations = (errors: ErrorMessagesOptional = defaultOptionalErrorMessages) => {
errors = { ...defaultOptionalErrorMessages, ...errors };
return [
body("principal_address_property_name_number")
Copy link
Contributor

Choose a reason for hiding this comment

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

seeing as this returns an a list of validators, some might be shared with the other lists, could we have a common list and use ... to import the common validations into the list mixed with the specific validations for that field/page, or wold that mean refactoring all the address validations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Don't know, but a sensible suggestion. We should investigate if this becomes a 'real' changes.

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.

None yet

2 participants