Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions legal-api/report-templates/consentContinuationOut.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,26 @@
</div>
<div class="container pt-4">
<div class="no-page-break">
<div class="section-title mt-4">New jurisdiction</div>
<div class="section-data pt-2">{{ jurisdiction }}</div>
<div class="section-title mt-4">Foreign jurisdiction into which the company is continuing:</div>
<div class="section-data pt-2 bold">{{ jurisdiction }}</div>
</div>

<div class="no-page-break">
<div class="separator mt-4"></div>
<div class="section-title mt-4">Completing Party Confirmation</div>
<div class="section-data mt-4">
I,
<span class="capitalize-text">{{ header.certifiedBy }}</span>,
confirm that the laws of the foreign jurisdiction to which the continued corporation will be
subject provide, in effect, for the following:
<ul class="certify-statement-list">
<li class="pt-2">the property, rights and interest of the company continue to be the property, rights and interests of the continued corporation,</li>
<li class="pt-2">the continued corporation continues to be liable for the obligations of the company,</li>
<li class="pt-2">an existing cause of action, claim or liability to prosecution is unaffected,</li>
<li class="pt-2">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</li>
<li class="pt-2">a conviction against, or a ruling, or judgment in favour of or against, the company may be enforced by or against the continued corporation.</li>
</ul>
</div>
</div>
</div>
</body>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,8 @@ def validate_certified_by(filing_json: dict, filing_type: str, legal_type: str)
# so certifiedBy is required for them on a corp incorporation application
api_login_source = "API_GW" # jwt loginSource of an API gateway user
current_user = getattr(request_ctx, "current_user", None) if has_request_context() else None
if (filing_type == CoreFiling.FilingTypes.INCORPORATIONAPPLICATION
if (filing_type in (CoreFiling.FilingTypes.INCORPORATIONAPPLICATION,
CoreFiling.FilingTypes.CONSENTCONTINUATIONOUT)
and current_user
and (jwt.validate_roles(current_user, [STAFF_ROLE])
or current_user.get("loginSource") == api_login_source)):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
CHANGE_OF_REGISTRATION,
CHANGE_OF_REGISTRATION_TEMPLATE,
CONTINUATION_IN,
CONSENT_CONTINUATION_OUT,
CORRECTION_INCORPORATION,
DISSOLUTION,
FILING_HEADER,
Expand Down Expand Up @@ -605,6 +606,11 @@ def test_validate_certified_by_corps(session, legal_type, input_value, expected_
assert errors[0]['error'] == 'Certified by field is required.'
assert errors[0]['path'] == '/filing/header/certifiedBy'


@pytest.mark.parametrize('filing_type', [
CoreFiling.FilingTypes.INCORPORATIONAPPLICATION,
CoreFiling.FilingTypes.CONSENTCONTINUATIONOUT,
])
@pytest.mark.parametrize('test_name, roles, login_source, certified_by, expected_error', [
('api_user_missing', [], 'API_GW', '', 'Certified by field is required.'),
('api_user_whitespace', [], 'API_GW', ' John Doe ', 'Certified by field cannot start or end with whitespace.'),
Expand All @@ -613,12 +619,18 @@ def test_validate_certified_by_corps(session, legal_type, input_value, expected_
('staff_valid', ['staff'], 'IDIR', 'John Doe', None),
('public_user_not_required', [], 'BCSC', '', None),
])
def test_validate_certified_by_corps_completing_party(app, session, test_name, roles,
login_source, certified_by, expected_error):
"""Corps IA requires certifiedBy for staff and API users (API users identified by loginSource)."""
def test_validate_certified_by_corps_completing_party(app, session, filing_type, test_name, roles,
login_source, certified_by, expected_error):
"""Corps IA and CCO require certifiedBy for staff and API users (API users identified by loginSource)."""
filing_type_data = {
CoreFiling.FilingTypes.INCORPORATIONAPPLICATION: ('incorporationApplication', INCORPORATION),
CoreFiling.FilingTypes.CONSENTCONTINUATIONOUT: ('consentContinuationOut', CONSENT_CONTINUATION_OUT),
}
filing_key, filing_data = filing_type_data[filing_type]

filing = copy.deepcopy(FILING_HEADER)
filing['filing']['header']['certifiedBy'] = certified_by
filing['filing']['incorporationApplication'] = INCORPORATION
filing['filing'][filing_key] = filing_data

with (
patch('legal_api.services.filings.validations.common_validations.jwt.validate_roles',
Expand All @@ -627,7 +639,7 @@ def test_validate_certified_by_corps_completing_party(app, session, test_name, r
):
from flask.globals import request_ctx
request_ctx.current_user = {'sub': 'test-user', 'loginSource': login_source}
errors = validate_certified_by(filing, 'incorporationApplication', 'BEN')
errors = validate_certified_by(filing, filing_type, 'BEN')

if expected_error:
assert errors
Expand Down