Skip to content

Commit

Permalink
20949 fix for special resolution fee filing type code (#2766)
Browse files Browse the repository at this point in the history
  • Loading branch information
vysakh-menon-aot authored Jun 18, 2024
1 parent 347c4db commit 0118c86
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -716,19 +716,20 @@ def get_filing_types(business: Business, filing_json: dict): # pylint: disable=
if k in ['changeOfDirectors', 'changeOfAddress']:
priority = False if filing_type == 'annualReport' else priority_flag

if k in ['incorporationApplication', 'amalgamationApplication', 'continuationIn', 'alteration']:
filing_types.append({
'filingTypeCode': filing_type_code,
'futureEffective': ListFilingResource.is_future_effective_filing(filing_json),
'priority': priority,
'waiveFees': waive_fees_flag
})
elif filing_type_code:
filing_types.append({
'filingTypeCode': filing_type_code,
'priority': priority,
'waiveFees': waive_fees_flag
})
if filing_type_code:
if k in ['incorporationApplication', 'amalgamationApplication', 'continuationIn', 'alteration']:
filing_types.append({
'filingTypeCode': filing_type_code,
'futureEffective': ListFilingResource.is_future_effective_filing(filing_json),
'priority': priority,
'waiveFees': waive_fees_flag
})
else:
filing_types.append({
'filingTypeCode': filing_type_code,
'priority': priority,
'waiveFees': waive_fees_flag
})
return filing_types

@staticmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ def test_delete_coop_ia_filing_in_draft_with_file_in_minio(session, client, jwt,
except S3Error as ex:
assert ex.code == 'NoSuchKey'


def test_delete_continuation_in_filing_with_authorization_files_in_draft(session, client, jwt, minio_server):
"""Assert that a draft continuationIn filing can be deleted and authorization files are removed from Minio."""
identifier = 'CP1234568'
Expand Down Expand Up @@ -1108,6 +1109,9 @@ def test_calc_annual_report_date(session, client, jwt):
AGM_EXTENSION_FILING = copy.deepcopy(FILING_HEADER)
AGM_EXTENSION_FILING['filing']['agmExtension'] = {}

SPECIAL_RESOLUTION_NO_CON_FILING = copy.deepcopy(CP_SPECIAL_RESOLUTION_TEMPLATE)
del SPECIAL_RESOLUTION_NO_CON_FILING['filing']['changeOfName']


def _get_expected_fee_code(free, filing_name, filing_json: dict, legal_type):
"""Return fee codes for legal type."""
Expand Down Expand Up @@ -1146,7 +1150,7 @@ def _get_expected_fee_code(free, filing_name, filing_json: dict, legal_type):
('BC1234567', DISSOLUTION_VOLUNTARY_FILING, 'dissolution', Business.LegalTypes.BCOMP.value, False, [], False),
('BC1234567', DISSOLUTION_VOLUNTARY_FILING, 'dissolution', Business.LegalTypes.COMP.value, False, [], False),
('CP1234567', DISSOLUTION_VOLUNTARY_FILING, 'dissolution', Business.LegalTypes.COOP.value, False,
['AFDVT', 'SPRLN'], False),
['AFDVT', 'SPRLN', 'DIS_VOL'], False),
('BC1234567', DISSOLUTION_VOLUNTARY_FILING, 'dissolution', Business.LegalTypes.BC_ULC_COMPANY.value,
False, [], False),
('BC1234567', DISSOLUTION_VOLUNTARY_FILING, 'dissolution', Business.LegalTypes.BC_CCC.value,
Expand Down Expand Up @@ -1188,13 +1192,17 @@ def _get_expected_fee_code(free, filing_name, filing_json: dict, legal_type):
('BC1234567', DISSOLUTION_VOLUNTARY_FILING, 'dissolution', Business.LegalTypes.BCOMP.value, False, [], True),
('BC1234567', DISSOLUTION_VOLUNTARY_FILING, 'dissolution', Business.LegalTypes.COMP.value, False, [], True),
('CP1234567', DISSOLUTION_VOLUNTARY_FILING, 'dissolution', Business.LegalTypes.COOP.value, False,
['AFDVT', 'SPRLN'], True),
['AFDVT', 'SPRLN', 'DIS_VOL'], True),
('BC1234567', DISSOLUTION_VOLUNTARY_FILING, 'dissolution', Business.LegalTypes.BC_ULC_COMPANY.value,
False, [], True),
('BC1234567', DISSOLUTION_VOLUNTARY_FILING, 'dissolution', Business.LegalTypes.BC_CCC.value,
False, [], True),
('BC1234567', DISSOLUTION_VOLUNTARY_FILING, 'dissolution', Business.LegalTypes.LIMITED_CO.value,
False, [], True),
('CP1234567', SPECIAL_RESOLUTION_NO_CON_FILING, 'specialResolution', Business.LegalTypes.COOP.value,
False, [], False),
('CP1234567', CP_SPECIAL_RESOLUTION_TEMPLATE, 'specialResolution', Business.LegalTypes.COOP.value,
False, ['SPRLN', 'OTCON'], False),
]
)
def test_get_correct_fee_codes(
Expand Down Expand Up @@ -1238,7 +1246,6 @@ def test_get_correct_fee_codes(
future_effective = filing_type.get('futureEffective')

# verify fee code and future effective date
assert fee_code == expected_fee_code
if has_fed:
assert future_effective is True
else:
Expand All @@ -1247,9 +1254,14 @@ def test_get_correct_fee_codes(
else:
assert future_effective is None

assert all(elem in
map(lambda x: x['filingTypeCode'], ListFilingResource.get_filing_types(business, filing))
for elem in additional_fee_codes)
fee_codes = ListFilingResource.get_filing_types(business, filing)
assert fee_codes
if len(fee_codes) == 1:
fee_code = fee_codes[0]['filingTypeCode']
assert fee_code == expected_fee_code
else:
assert len(additional_fee_codes) == len(fee_codes)
assert all(elem in map(lambda x: x['filingTypeCode'], fee_codes) for elem in additional_fee_codes)


@integration_payment
Expand Down

0 comments on commit 0118c86

Please sign in to comment.