diff --git a/legal-api/pyproject.toml b/legal-api/pyproject.toml index d4737d8f3b..2a3fab4212 100644 --- a/legal-api/pyproject.toml +++ b/legal-api/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "legal-api" -version = "3.1.19" +version = "3.1.20" description = "" authors = [ {name = "thor",email = "1042854+thorwolpert@users.noreply.github.com"} diff --git a/legal-api/report-templates/consentContinuationOut.html b/legal-api/report-templates/consentContinuationOut.html index 6d574963c8..8ae428a1b9 100644 --- a/legal-api/report-templates/consentContinuationOut.html +++ b/legal-api/report-templates/consentContinuationOut.html @@ -42,5 +42,45 @@
{{ jurisdiction }}
+ +
+
+
Completing Party Confirmation
+
+ I, {{ header.certifiedBy }}, the completing party, confirm that the laws of the foreign jurisdiction + to which the continued corporation will be subject provide, in effect, for the following: +
    +
  • the property, rights and interest of the company continue to be the property, rights and + interests of the continued corporation,
  • +
  • the continued corporation continues to be liable for the obligations of the company,
  • +
  • an existing cause of action, claim or liability to prosecution is unaffected,
  • +
  • a legal proceeding being prosecuted or pending by or against the company may be prosecuted + or its prosecution may be continued, as the case may be, by or against the continued + corporation, and
  • +
  • a conviction against, or a ruling, or judgment in favour of or against, the company may be + enforced by or against the continued corporation.
  • +
+
+
+
+ +
+
+
+
Certification
+
+ I certify that the information provided is correct and that I am authorized to submit this + filing on behalf of the {{ entityDescription }}. +
+
+ Date: {{ header.date }} +
+
+ Note: It is an offence to make a false or misleading statement in respect of + a material fact in a record submitted to the Corporate Registry for filing. See section 427 + of the Business Corporations Act. +
+
+
diff --git a/legal-api/src/legal_api/services/filings/validations/common_validations.py b/legal-api/src/legal_api/services/filings/validations/common_validations.py index 79b8051680..eb09ea535e 100644 --- a/legal-api/src/legal_api/services/filings/validations/common_validations.py +++ b/legal-api/src/legal_api/services/filings/validations/common_validations.py @@ -81,6 +81,7 @@ CoreFiling.FilingTypes.CHANGEOFADDRESS, CoreFiling.FilingTypes.CHANGEOFDIRECTORS, CoreFiling.FilingTypes.CHANGEOFREGISTRATION, + CoreFiling.FilingTypes.CONSENTCONTINUATIONOUT, CoreFiling.FilingTypes.NOTICEOFWITHDRAWAL, CoreFiling.FilingTypes.REGISTRATION, CoreFiling.FilingTypes.SPECIALRESOLUTION, @@ -97,7 +98,6 @@ CoreFiling.FilingTypes.CHANGEOFADDRESS, CoreFiling.FilingTypes.CHANGEOFDIRECTORS, CoreFiling.FilingTypes.CONSENTAMALGAMATIONOUT, - CoreFiling.FilingTypes.CONSENTCONTINUATIONOUT, CoreFiling.FilingTypes.CONTINUATIONIN, CoreFiling.FilingTypes.CONTINUATIONOUT, CoreFiling.FilingTypes.CORRECTION, diff --git a/legal-api/src/legal_api/services/filings/validations/consent_continuation_out.py b/legal-api/src/legal_api/services/filings/validations/consent_continuation_out.py index 908410589b..97a1d76bfd 100644 --- a/legal-api/src/legal_api/services/filings/validations/consent_continuation_out.py +++ b/legal-api/src/legal_api/services/filings/validations/consent_continuation_out.py @@ -58,6 +58,12 @@ def validate(business: Business, filing: dict) -> Error | None: msg.extend([{"error": "Can't have new consent for same jurisdiction if an unexpired one already exists", "path": foreign_jurisdiction_path}]) + if not filing["filing"][filing_type].get("confirmCompletionParty"): + msg.append({ + "error": babel("Confirm Completion is required."), + "path": f"/filing/{filing_type}/confirmCompletionParty" + }) + if court_order := filing.get("filing", {}).get(filing_type, {}).get("courtOrder", None): court_order_path: Final = f"/filing/{filing_type}/courtOrder" msg.extend(validate_court_order(court_order_path, court_order)) diff --git a/legal-api/tests/unit/services/filings/validations/test_consent_continuation_out.py b/legal-api/tests/unit/services/filings/validations/test_consent_continuation_out.py index 46c210ae8b..0754078684 100644 --- a/legal-api/tests/unit/services/filings/validations/test_consent_continuation_out.py +++ b/legal-api/tests/unit/services/filings/validations/test_consent_continuation_out.py @@ -197,6 +197,47 @@ def test_validate_existing_cco(session, test_name, expected_code, message, monke assert not err +@pytest.mark.parametrize( + 'test_name, confirm_completion, expected_code, message', + [ + # Missing entirely — schema catches it first as a required field violation + ('FAIL_MISSING', None, HTTPStatus.UNPROCESSABLE_ENTITY, None), + # Present but False — business rule catches it + ('FAIL_FALSE', False, HTTPStatus.BAD_REQUEST, 'Confirm Completion is required.'), + ('SUCCESS', True, None, None), + ] +) +def test_consent_continuation_out_confirm_completion(session, test_name, confirm_completion, expected_code, message, monkeypatch): + """Assert confirmCompletionParty is required and must be true.""" + monkeypatch.setattr( + 'legal_api.services.flags.value', + lambda flag, default=None: "BC BEN CC ULC C CBEN CCC CUL" if flag == 'supported-consent-continuation-out-entities' else default + ) + business = Business( + identifier='BC1234567', + legal_type='BC', + state=Business.State.ACTIVE, + founding_date=datetime.utcnow() + ) + filing = copy.deepcopy(FILING_HEADER) + filing['filing']['consentContinuationOut'] = copy.deepcopy(CONSENT_CONTINUATION_OUT) + filing['filing']['header']['name'] = 'consentContinuationOut' + + if confirm_completion is None: + filing['filing']['consentContinuationOut'].pop('confirmCompletionParty', None) + else: + filing['filing']['consentContinuationOut']['confirmCompletionParty'] = confirm_completion + + err = validate(business, filing) + + if test_name != 'SUCCESS': + assert expected_code == err.code + if message: + assert message == err.msg[0]['error'] + else: + assert not err + + @pytest.mark.parametrize( 'test_status, file_number, expected_code', [ diff --git a/python/common/business-registry-model/pyproject.toml b/python/common/business-registry-model/pyproject.toml index cf81a2e5d0..2d95beb41f 100644 --- a/python/common/business-registry-model/pyproject.toml +++ b/python/common/business-registry-model/pyproject.toml @@ -9,7 +9,7 @@ readme = "README.md" requires-python = ">=3.13,<3.14" dependencies = [ "sql-versioning @ git+https://github.com/bcgov/lear.git@main#subdirectory=python/common/sql-versioning-alt", - "registry-schemas @ git+https://github.com/bcgov/business-schemas.git@2.18.83", + "registry-schemas @ git+https://github.com/bcgov/business-schemas.git@2.18.84", "flask-migrate (>=4.1.0,<5.0.0)", "pg8000 (>=1.31.2,<2.0.0)", "pydantic (>=2.10.6,<3.0.0)",