Skip to content

33157: Fix share series name validation#4321

Merged
loneil merged 1 commit into
bcgov:mainfrom
loneil:33157shareSeriesUniqueValidation
Apr 27, 2026
Merged

33157: Fix share series name validation#4321
loneil merged 1 commit into
bcgov:mainfrom
loneil:33157shareSeriesUniqueValidation

Conversation

@loneil
Copy link
Copy Markdown
Collaborator

@loneil loneil commented Apr 24, 2026

Issue #: /bcgov/entity#33157

Description of changes:
Fix the validation for share series naming to match the UI and requirements (see ticket)
Adjust unit tests

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

Copilot AI review requested due to automatic review settings April 24, 2026 17:58
Signed-off-by: Lucas <lucasoneil@gmail.com>
@loneil loneil force-pushed the 33157shareSeriesUniqueValidation branch from a145d3d to e29cdde Compare April 24, 2026 17:59
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
9.6% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

Copy link
Copy Markdown
Contributor

Copilot AI left a 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 share series naming validation to align backend rules with UI/requirements for share name uniqueness scoping (issue #33157).

Changes:

  • Scope share series name uniqueness to within a single share class (allow repeats across classes and allow matching a class name).
  • Update share class/series duplicate-name validation error messages to reflect the new rules.
  • Adjust and extend unit tests to cover the revised validation behavior.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
legal-api/src/legal_api/services/filings/validations/common_validations.py Changes series-name duplicate detection to be per-class and updates related error messages/call signature.
legal-api/tests/unit/services/filings/validations/test_common_validations.py Updates direct validate_series tests for new signature and adds tests confirming allowed name reuse across scopes.
legal-api/tests/unit/services/filings/validations/test_incorporation_application.py Updates expected duplicate-name error messages for incorporation application validations.
legal-api/tests/unit/services/filings/validations/test_continuation_in.py Updates expected duplicate-name error messages for continuation-in validations.
legal-api/tests/unit/services/filings/validations/test_amalgamation_application.py Updates expected duplicate-name error messages for amalgamation application validations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@loneil
Copy link
Copy Markdown
Collaborator Author

loneil commented Apr 24, 2026

Sonar failure is on unit test message strings duplicated. I'd leave it as it's consistent with all existing test patterns.

@loneil loneil self-assigned this Apr 24, 2026
Copy link
Copy Markdown
Collaborator

@kialj876 kialj876 left a comment

Choose a reason for hiding this comment

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

Nice work 👍

@loneil loneil merged commit 9ee31ea into bcgov:main Apr 27, 2026
7 of 8 checks passed
@loneil loneil deleted the 33157shareSeriesUniqueValidation branch April 27, 2026 22:12
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.

5 participants