Skip to content

32911 - Add validation for foreign business legal name length#4395

Open
mruff-aeq wants to merge 1 commit into
bcgov:mainfrom
mruff-aeq:32911_Add_Foreign_Business_Legal_Name_Length_Validation
Open

32911 - Add validation for foreign business legal name length#4395
mruff-aeq wants to merge 1 commit into
bcgov:mainfrom
mruff-aeq:32911_Add_Foreign_Business_Legal_Name_Length_Validation

Conversation

@mruff-aeq
Copy link
Copy Markdown
Collaborator

#32911 : /bcgov/entity#32911

Description of changes:
We discovered that the backend wasn’t validating the length of a foreign amalgamating business’s legalName. The frontend correctly blocked names shorter than 3 characters or longer than 150, but the backend didn’t — so invalid values could still slip through and get saved.

The backend now enforces the same 3–150 character limit. If the name is outside that range, it returns a 400 error with the message “Length of foreign business legal name must be from 3 to 150 characters.”

Example:
when making a POST to url /api/v2/businesses/<T-id>/filings?only_validate=true
"legalName": "AA" in payload throws 400 error “Length of foreign business legal name must be from 3 to 150 characters.”
"legalName": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" in payload throws 400 error “Length of foreign business legal name must be from 3 to 150 characters.”

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).

@mruff-aeq mruff-aeq force-pushed the 32911_Add_Foreign_Business_Legal_Name_Length_Validation branch from 86c8986 to 32e35c4 Compare May 17, 2026 10:17
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant