Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18052 added agm extension fee codes and tests #2237

Merged
merged 7 commits into from
Oct 16, 2023
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
10 changes: 10 additions & 0 deletions legal-api/src/legal_api/core/meta/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ class FilingTitles(str, Enum):
'CP': 'AFDVT'
}
},
'agmExtension': {
'name': 'agmExtension',
'title': 'AGM Extension',
'codes': {
'BC': 'AGMDT',
'BEN': 'AGMDT',
'ULC': 'AGMDT',
'CC': 'AGMDT'
}
},
'agmLocationChange': {
'name': 'agmLocationChange',
'title': 'AGM Location Change',
Expand Down
18 changes: 10 additions & 8 deletions legal-api/src/legal_api/models/filing.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
# Copyright © 2019 Province of British Columbia
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -68,6 +65,16 @@ class Source(Enum):
'CP': 'AFDVT'
}
},
'agmExtension': {
'name': 'agmExtension',
'title': 'AGM Extension',
'codes': {
'BC': 'AGMDT',
'BEN': 'AGMDT',
'ULC': 'AGMDT',
'CC': 'AGMDT'
}
},
argush3 marked this conversation as resolved.
Show resolved Hide resolved
'agmLocationChange': {
'name': 'agmLocationChange',
'title': 'AGM Change of Location',
Expand Down Expand Up @@ -979,19 +986,14 @@ def receive_before_change(mapper, connection, target): # pylint: disable=unused
# because it's been set to PENDING_CORRECTION by the entity filer.
if hasattr(filing, 'skip_status_listener') and filing.skip_status_listener:
return

# changes are part of the class and are not externalized
if filing.filing_type == 'lear_epoch':
filing._status = Filing.Status.EPOCH.value # pylint: disable=protected-access

elif filing.transaction_id:
filing._status = Filing.Status.COMPLETED.value # pylint: disable=protected-access

elif filing.payment_completion_date or filing.source == Filing.Source.COLIN.value:
filing._status = Filing.Status.PAID.value # pylint: disable=protected-access

elif filing.payment_token:
filing._status = Filing.Status.PENDING.value # pylint: disable=protected-access

else:
filing._status = Filing.Status.DRAFT.value # pylint: disable=protected-access
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,10 @@ def test_calc_annual_report_date(session, client, jwt):
AGM_LOCATION_CHANGE_FILING = copy.deepcopy(FILING_HEADER)
AGM_LOCATION_CHANGE_FILING['filing']['agmLocationChange'] = {}

# FUTURE: use AGM_EXTENSION_FILING from business schema data when AGM Extension filing work has been done
AGM_EXTENSION_FILING = copy.deepcopy(FILING_HEADER)
AGM_EXTENSION_FILING['filing']['agmExtension'] = {}

def _get_expected_fee_code(free, filing_name, filing_json: dict, legal_type):
"""Return fee codes for legal type."""
filing_sub_type = Filing.get_filings_sub_type(filing_name, filing_json)
Expand Down Expand Up @@ -1100,6 +1104,10 @@ def _get_expected_fee_code(free, filing_name, filing_json: dict, legal_type):
('BC1234567', AGM_LOCATION_CHANGE_FILING, 'agmLocationChange', Business.LegalTypes.BC_ULC_COMPANY.value, False, []),
('BC1234567', AGM_LOCATION_CHANGE_FILING, 'agmLocationChange', Business.LegalTypes.COMP.value, False, []),
('BC1234567', AGM_LOCATION_CHANGE_FILING, 'agmLocationChange', Business.LegalTypes.BC_CCC.value, False, []),
('BC1234567', AGM_EXTENSION_FILING, 'agmExtension', Business.LegalTypes.BCOMP.value, False, []),
('BC1234567', AGM_EXTENSION_FILING, 'agmExtension', Business.LegalTypes.BC_ULC_COMPANY.value, False, []),
('BC1234567', AGM_EXTENSION_FILING, 'agmExtension', Business.LegalTypes.COMP.value, False, []),
('BC1234567', AGM_EXTENSION_FILING, 'agmExtension', Business.LegalTypes.BC_CCC.value, False, []),
]
)
def test_get_correct_fee_codes(
Expand Down
Loading