-
Notifications
You must be signed in to change notification settings - Fork 37
Required postal code #302
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
Required postal code #302
Conversation
f98e4d0 to
577dd4c
Compare
Signed-off-by: Lucas <lucasoneil@gmail.com>
7ef9c79 to
487d8ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Updates postal code validation to separate “format validity” from “requiredness” and adds unit tests for the new required-postal-code validator.
Changes:
- Renamed postal code validator to
isValidPostalCodeand updated existing unit tests. - Added new
isRequiredPostalCodevalidator plus a dedicated unit test suite. - Updated validation mixin to support both
isValidPostalCodeandisRequiredPostalCoderules.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/validate-postal-code.spec.ts | Updates tests to use isValidPostalCode and adds null/undefined coverage. |
| tests/unit/is-required-postal-code.spec.ts | New unit tests for required postal code behavior across country sets. |
| src/validators/validate-postal-code.ts | Renames exported validator function to isValidPostalCode. |
| src/validators/is-required-postal-code.ts | Introduces isRequiredPostalCode validator and country allowlist. |
| src/validators/index.ts | Updates validator exports to include isValidPostalCode and isRequiredPostalCode. |
| src/mixins/validation-mixin.ts | Adds rule wiring for isValidPostalCode and isRequiredPostalCode. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
severinbeauvais
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
I don't care if you streamline the unit tests or not.
Issue #: /bcgov/entity#31954
Description of changes:
Add a new postal code required validator that depends on country code as well.
Refactor-rename existing format validation for postal code as well
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the business-filings-ui license (Apache 2.0).