Skip to content

Commit

Permalink
18052 added agm extension fee codes and tests (#2237)
Browse files Browse the repository at this point in the history
* 18052 added agm extension fee codes and tests

* 18052 updated meta filling

* fixed linting error

* fix linting error

* fix flake linting error

* fix flake linting error

---------

Co-authored-by: PaulGarewal <pgarewal@NI500960.idir.BCGOV>
  • Loading branch information
PaulGarewal and PaulGarewal authored Oct 16, 2023
1 parent 505a578 commit c2e4af6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
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'
}
},
'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

0 comments on commit c2e4af6

Please sign in to comment.