32075 Legal-API: Validation on director names for CoD#4076
32075 Legal-API: Validation on director names for CoD#4076loneil wants to merge 1 commit intobcgov:mainfrom
Conversation
Signed-off-by: Lucas <lucasoneil@gmail.com>
2353680 to
4a7f6a3
Compare
|
|
||
| return msg | ||
|
|
||
| def validate_directors_name(cod: dict) -> list: |
There was a problem hiding this comment.
There is a validate_party_name function in common validations, but this one has differences than a party name (though posted as basically the same format from the UI) in that there's the prev* fields, the role isn't variable, and there's the actions to take into account.
Could maybe generalize a "validate person name" that is shared but there's also the 20 character limit on the name fields, so probably consider any refactoring in context with https://app.zenhub.com/workspaces/entities-team-65af15f59e89f5043c2911f7/issues/gh/bcgov/entity/31979 if that gets addressed at some point.
|
|
||
| if value: | ||
| # No leading or trailing whitespace | ||
| if value != value.strip(): |
There was a problem hiding this comment.
This may have impact on PROD if existing data has space ("prevFirstName", "prevMiddleInitial", "prevLastName"), Checked and removed trailing space from PROD. So if dev/test has issues with existing data no need to be concerned about it.
Issue #: /bcgov/entity#32075
Description of changes:
There isn't any validation API side on director field format (other than schema) so blank fields and invalid lengths and whitespacing is passing. Add name validation for director officer in the CoD validator.
Note: this will validate required director name for all cases, even if it's an
addressChangedaction, which matches the FE behavior where it sends the director name anyways.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).