From df1135a144a83f0edc81c1cc7ab2c9606ebe677c Mon Sep 17 00:00:00 2001 From: PaulGarewal Date: Mon, 16 Oct 2023 15:01:13 +0000 Subject: [PATCH 1/6] 18052 added agm extension fee codes and tests --- legal-api/src/legal_api/models/filing.py | 10 ++++++++++ .../resources/v2/test_business_filings/test_filings.py | 8 ++++++++ 2 files changed, 18 insertions(+) diff --git a/legal-api/src/legal_api/models/filing.py b/legal-api/src/legal_api/models/filing.py index fe3602795f..d1741b7259 100644 --- a/legal-api/src/legal_api/models/filing.py +++ b/legal-api/src/legal_api/models/filing.py @@ -68,6 +68,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', diff --git a/legal-api/tests/unit/resources/v2/test_business_filings/test_filings.py b/legal-api/tests/unit/resources/v2/test_business_filings/test_filings.py index 5cf45ea022..57e52a51d3 100644 --- a/legal-api/tests/unit/resources/v2/test_business_filings/test_filings.py +++ b/legal-api/tests/unit/resources/v2/test_business_filings/test_filings.py @@ -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) @@ -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( From e39883e58b37762ce890ef46fdcec05a9ec8f5b9 Mon Sep 17 00:00:00 2001 From: PaulGarewal Date: Mon, 16 Oct 2023 17:39:42 +0000 Subject: [PATCH 2/6] 18052 updated meta filling --- legal-api/src/legal_api/core/meta/filing.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/legal-api/src/legal_api/core/meta/filing.py b/legal-api/src/legal_api/core/meta/filing.py index 8b8bd905b2..5fb7ff55fe 100644 --- a/legal-api/src/legal_api/core/meta/filing.py +++ b/legal-api/src/legal_api/core/meta/filing.py @@ -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', From f92fde973d092c514b735b437f252c3d843f9266 Mon Sep 17 00:00:00 2001 From: PaulGarewal Date: Mon, 16 Oct 2023 18:05:26 +0000 Subject: [PATCH 3/6] fixed linting error --- legal-api/src/legal_api/models/filing.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/legal-api/src/legal_api/models/filing.py b/legal-api/src/legal_api/models/filing.py index d1741b7259..452cdc4e5f 100644 --- a/legal-api/src/legal_api/models/filing.py +++ b/legal-api/src/legal_api/models/filing.py @@ -30,17 +30,14 @@ from .db import db # noqa: I001 - from .comment import Comment # noqa: I001,F401,I003 pylint: disable=unused-import; needed by SQLAlchemy relationship - class Filing(db.Model): # pylint: disable=too-many-instance-attributes,too-many-public-methods # allowing the model to be deep. """Immutable filing record. Manages the filing ledger for the associated business. """ - class Status(str, Enum): """Render an Enum of the Filing Statuses.""" @@ -989,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 From ee4ad8fd8ecc3ea4f92be6b3e39f726baf9ed28d Mon Sep 17 00:00:00 2001 From: PaulGarewal Date: Mon, 16 Oct 2023 18:13:05 +0000 Subject: [PATCH 4/6] fix linting error --- legal-api/src/legal_api/models/filing.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/legal-api/src/legal_api/models/filing.py b/legal-api/src/legal_api/models/filing.py index 452cdc4e5f..91853806b8 100644 --- a/legal-api/src/legal_api/models/filing.py +++ b/legal-api/src/legal_api/models/filing.py @@ -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. @@ -30,8 +27,10 @@ from .db import db # noqa: I001 + from .comment import Comment # noqa: I001,F401,I003 pylint: disable=unused-import; needed by SQLAlchemy relationship + class Filing(db.Model): # pylint: disable=too-many-instance-attributes,too-many-public-methods # allowing the model to be deep. """Immutable filing record. From ad252d394bab587d934b7140502fa5ecb00f7d98 Mon Sep 17 00:00:00 2001 From: PaulGarewal Date: Mon, 16 Oct 2023 18:16:35 +0000 Subject: [PATCH 5/6] fix flake linting error --- legal-api/src/legal_api/models/filing.py | 1 + 1 file changed, 1 insertion(+) diff --git a/legal-api/src/legal_api/models/filing.py b/legal-api/src/legal_api/models/filing.py index 91853806b8..f0692413a4 100644 --- a/legal-api/src/legal_api/models/filing.py +++ b/legal-api/src/legal_api/models/filing.py @@ -37,6 +37,7 @@ class Filing(db.Model): # pylint: disable=too-many-instance-attributes,too-many Manages the filing ledger for the associated business. """ + class Status(str, Enum): """Render an Enum of the Filing Statuses.""" From 1a24b30ba236b2f1a2397a0d7c5d4f2130768b38 Mon Sep 17 00:00:00 2001 From: PaulGarewal Date: Mon, 16 Oct 2023 18:17:13 +0000 Subject: [PATCH 6/6] fix flake linting error --- legal-api/src/legal_api/models/filing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legal-api/src/legal_api/models/filing.py b/legal-api/src/legal_api/models/filing.py index f0692413a4..23fa528276 100644 --- a/legal-api/src/legal_api/models/filing.py +++ b/legal-api/src/legal_api/models/filing.py @@ -37,7 +37,7 @@ class Filing(db.Model): # pylint: disable=too-many-instance-attributes,too-many Manages the filing ledger for the associated business. """ - + class Status(str, Enum): """Render an Enum of the Filing Statuses."""