Skip to content

32692 Flag for CoD backdating for Out of Order Director Logic #4139

Merged
loneil merged 2 commits intobcgov:mainfrom
loneil:32692flagForCodBackdate
Mar 6, 2026
Merged

32692 Flag for CoD backdating for Out of Order Director Logic #4139
loneil merged 2 commits intobcgov:mainfrom
loneil:32692flagForCodBackdate

Conversation

@loneil
Copy link
Copy Markdown
Collaborator

@loneil loneil commented Mar 6, 2026

Issue #: /bcgov/entity#32692

Description of changes:
Add in a new feature flag enable-backdated-cod to match the frontend one so we can toggle validation of "Out of Order Director" dates on legal-api.
Conditionally ignore date boundaries (that say they cannot be before a previous CoD or AR) for

  • effective date
  • appointment date
  • cessation date

Flag defaults to false (we have it on in dev), set to True to ignore the specific validation

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

Signed-off-by: Lucas <lucasoneil@gmail.com>
Copilot AI review requested due to automatic review settings March 6, 2026 00:49
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

Adds a feature flag to allow backdated Change of Directors (CoD) filings (to support out-of-order director logic), and updates CoD date validation behavior + unit tests accordingly.

Changes:

  • Introduces enable-backdated-cod flag (default false) to relax CoD backdating constraints.
  • Updates CoD validation to adjust date bounds when the flag is enabled and to enforce “not before most recent CoD/AR-with-CoD” when disabled.
  • Adds/extends unit tests covering effective date and director appointment/cessation date behavior with flag on/off.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
legal-api/tests/unit/services/filings/validations/change_of_director/test_validation_effective_date.py Adds tests asserting effective-date lower-bound behavior vs prior CoD/AR filings, plus flag-enabled backdating case.
legal-api/tests/unit/services/filings/validations/change_of_director/test_validation_directors_dates.py Adds tests ensuring director appointment/cessation date bounds change correctly when the backdating flag is enabled, plus unit tests for get_cod_date_bounds.
legal-api/src/legal_api/services/filings/validations/change_of_directors.py Implements flag-aware date-bounds logic and adds an effective-date check against the most recent prior CoD (including ARs containing CoD).
legal-api/flags.json Registers new enable-backdated-cod feature flag with default value false.

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

Comment thread legal-api/src/legal_api/services/filings/validations/change_of_directors.py Outdated
Signed-off-by: Lucas <lucasoneil@gmail.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Mar 6, 2026

Quality Gate Failed Quality Gate failed

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

See analysis details on SonarQube Cloud

@loneil loneil merged commit 0078d2e into bcgov:main Mar 6, 2026
7 of 8 checks passed
@severinbeauvais severinbeauvais changed the title Flag for CoD backdating for Out of Order Director Logic 32692 Flag for CoD backdating for Out of Order Director Logic Mar 17, 2026
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.

3 participants