-
Notifications
You must be signed in to change notification settings - Fork 81
31800: validate Incorporation Application share structure fields #4036
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
base: main
Are you sure you want to change the base?
Conversation
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
This PR tightens validation rules for share structures, enforcing consistent naming for share classes and series and adding comprehensive unit tests around these rules.
Changes:
- Introduced
EXCLUDED_WORDS_FOR_CLASSandEXCLUDED_WORDS_FOR_SERIESconstants and extendedvalidate_shares/validate_seriesto enforce a" Shares"suffix and to reject reserved words in class and series names. - Ensured series-level validations (max shares, rights/restrictions, duplicate names) now also include suffix and reserved-word checks while maintaining existing behavior.
- Added extensive unit tests in
test_common_validations.pyfor share-class and series names, as well as for end-to-endvalidate_share_structurebehavior over various valid and invalid share structures.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| legal-api/src/legal_api/services/filings/validations/common_validations.py | Adds reserved-word and suffix validations for share class and series names, and exposes exclusion word lists as constants used across filings. |
| legal-api/tests/unit/services/filings/validations/test_common_validations.py | Adds parameterized tests covering class/series name suffix rules, reserved words, whitespace/emptiness, duplication, and full share-structure validation behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
legal-api/src/legal_api/services/filings/validations/common_validations.py
Outdated
Show resolved
Hide resolved
legal-api/src/legal_api/services/filings/validations/common_validations.py
Outdated
Show resolved
Hide resolved
c4872c1 to
a9b13f9
Compare
Signed-off-by: Lucas <[email protected]>
Signed-off-by: Lucas <[email protected]>
Signed-off-by: Lucas <[email protected]>
Signed-off-by: Lucas <[email protected]>
Signed-off-by: Lucas <[email protected]>
7f389c6 to
a6477dd
Compare
Issue #: /bcgov/entity#31800
Description of changes:
WIP
Needs bcgov/business-schemas#202 merged so unit tests can be accomodated
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).