From 01849b0f9252fb215d934bc382fc76789abc40fd Mon Sep 17 00:00:00 2001 From: Kial Jinnah Date: Fri, 7 Feb 2025 15:34:58 -0500 Subject: [PATCH 1/8] Backend - transparency register filing Signed-off-by: Kial Jinnah --- legal-api/src/legal_api/core/filing.py | 5 ++ legal-api/src/legal_api/core/meta/filing.py | 50 +++++++++++++++++- legal-api/src/legal_api/models/filing.py | 52 ++++++++++++++++++- .../business_filings/business_filings.py | 3 ++ legal-api/src/legal_api/services/authz.py | 23 ++++++++ .../validations/transparency_register.py | 43 +++++++++++++++ .../filings/validations/validation.py | 4 ++ .../src/business_pay/resources/pay_filer.py | 2 +- 8 files changed, 178 insertions(+), 4 deletions(-) create mode 100644 legal-api/src/legal_api/services/filings/validations/transparency_register.py diff --git a/legal-api/src/legal_api/core/filing.py b/legal-api/src/legal_api/core/filing.py index f2768d133d..0d55bb368b 100644 --- a/legal-api/src/legal_api/core/filing.py +++ b/legal-api/src/legal_api/core/filing.py @@ -97,6 +97,7 @@ class FilingTypes(str, Enum): RESTORATIONAPPLICATION = 'restorationApplication' SPECIALRESOLUTION = 'specialResolution' TRANSITION = 'transition' + TRANSPARENCY_REGISTER = 'transparencyRegister' class FilingTypesCompact(str, Enum): """Render enum for filing types with sub-types.""" @@ -110,6 +111,9 @@ class FilingTypesCompact(str, Enum): AMALGAMATION_APPLICATION_REGULAR = 'amalgamationApplication.regular' AMALGAMATION_APPLICATION_VERTICAL = 'amalgamationApplication.vertical' AMALGAMATION_APPLICATION_HORIZONTAL = 'amalgamationApplication.horizontal' + TRANSPARENCY_REGISTER_ANNUAL = 'transparencyRegister.ANNUAL' + TRANSPARENCY_REGISTER_CHANGE = 'transparencyRegister.CHANGE' + TRANSPARENCY_REGISTER_INITIAL = 'transparencyRegister.INITIAL' NEW_BUSINESS_FILING_TYPES: Final = [ FilingTypes.AMALGAMATIONAPPLICATION, @@ -568,6 +572,7 @@ def get_document_list(business, # pylint: disable=too-many-locals disable=too-m Filing.FilingTypes.CONTINUATIONOUT.value, Filing.FilingTypes.AGMEXTENSION.value, Filing.FilingTypes.AGMLOCATIONCHANGE.value, + Filing.FilingTypes.TRANSPARENCY_REGISTER.value, ] if filing.filing_type not in no_legal_filings: documents['documents']['legalFilings'] = \ diff --git a/legal-api/src/legal_api/core/meta/filing.py b/legal-api/src/legal_api/core/meta/filing.py index a1f0899a14..26963d8b29 100644 --- a/legal-api/src/legal_api/core/meta/filing.py +++ b/legal-api/src/legal_api/core/meta/filing.py @@ -645,7 +645,55 @@ class FilingTitles(str, Enum): 'outputs': ['noticeOfArticles'] }, ] - } + }, + 'transparencyRegister': { + 'name': 'transparencyRegister', + 'ANNUAL': { + 'name': 'transparencyRegister', + 'title': 'Transparency Register - Annual Filing', + 'displayName': 'Transparency Register - Annual Filing', + 'codes': { + 'BC': 'REGSIGIN', + 'BEN': 'REGSIGIN', + 'ULC': 'REGSIGIN', + 'CC': 'REGSIGIN', + 'C': 'REGSIGIN', + 'CBEN': 'REGSIGIN', + 'CUL': 'REGSIGIN', + 'CCC': 'REGSIGIN' + } + }, + 'CHANGE': { + 'name': 'transparencyRegister', + 'title': 'Transparency Register Filing', + 'displayName': 'Transparency Register Filing', + 'codes': { + 'BC': 'REGSIGIN', + 'BEN': 'REGSIGIN', + 'ULC': 'REGSIGIN', + 'CC': 'REGSIGIN', + 'C': 'REGSIGIN', + 'CBEN': 'REGSIGIN', + 'CUL': 'REGSIGIN', + 'CCC': 'REGSIGIN' + } + }, + 'INITIAL': { + 'name': 'transparencyRegister', + 'title': 'Transparency Register Filing', + 'displayName': 'Transparency Register Filing', + 'codes': { + 'BC': 'REGSIGIN', + 'BEN': 'REGSIGIN', + 'ULC': 'REGSIGIN', + 'CC': 'REGSIGIN', + 'C': 'REGSIGIN', + 'CBEN': 'REGSIGIN', + 'CUL': 'REGSIGIN', + 'CCC': 'REGSIGIN' + } + } + }, } diff --git a/legal-api/src/legal_api/models/filing.py b/legal-api/src/legal_api/models/filing.py index 3be6b8d8f6..827f0c7fef 100644 --- a/legal-api/src/legal_api/models/filing.py +++ b/legal-api/src/legal_api/models/filing.py @@ -64,10 +64,12 @@ class Status(str, Enum): class Source(Enum): """Render an Enum of the Filing Sources.""" + BTR = 'BTR' COLIN = 'COLIN' LEAR = 'LEAR' # TODO: get legal types from defined class once table is made (getting it from Business causes circ import) + # TODO: add filing types for btr FILINGS = { 'affidavit': { 'name': 'affidavit', @@ -446,6 +448,51 @@ class Source(Enum): 'CCC': 'TRANS' } }, + 'transparencyRegister': { + 'name': 'transparencyRegister', + 'ANNUAL': { + 'name': 'transparencyRegister', + 'title': 'Transparency Register - Annual Filing', + 'codes': { + 'BC': 'REGSIGIN', + 'BEN': 'REGSIGIN', + 'ULC': 'REGSIGIN', + 'CC': 'REGSIGIN', + 'C': 'REGSIGIN', + 'CBEN': 'REGSIGIN', + 'CUL': 'REGSIGIN', + 'CCC': 'REGSIGIN' + } + }, + 'CHANGE': { + 'name': 'transparencyRegister', + 'title': 'Transparency Register Filing', + 'codes': { + 'BC': 'REGSIGIN', + 'BEN': 'REGSIGIN', + 'ULC': 'REGSIGIN', + 'CC': 'REGSIGIN', + 'C': 'REGSIGIN', + 'CBEN': 'REGSIGIN', + 'CUL': 'REGSIGIN', + 'CCC': 'REGSIGIN' + } + }, + 'INITIAL': { + 'name': 'transparencyRegister', + 'title': 'Transparency Register Filing', + 'codes': { + 'BC': 'REGSIGIN', + 'BEN': 'REGSIGIN', + 'ULC': 'REGSIGIN', + 'CC': 'REGSIGIN', + 'C': 'REGSIGIN', + 'CBEN': 'REGSIGIN', + 'CUL': 'REGSIGIN', + 'CCC': 'REGSIGIN' + } + } + }, # changing the structure of fee code in courtOrder/registrarsNotation/registrarsOrder # for all the business the fee code remain same as NOFEE (Staff) @@ -462,7 +509,8 @@ class Source(Enum): # breaking and more testing was req'd so did not make refactor when introducing this dictionary. 'dissolution': 'dissolutionType', 'restoration': 'type', - 'amalgamationApplication': 'type' + 'amalgamationApplication': 'type', + 'transparencyRegister': 'type' } __tablename__ = 'filings' @@ -1051,7 +1099,7 @@ def get_most_recent_legal_filing(business_id: str, filing_type: str = None): def get_completed_filings_for_colin(limit=20, offset=0): """Return the filings based on limit and offset.""" from .business import Business # noqa: F401; pylint: disable=import-outside-toplevel - excluded_filings = ['lear_epoch', 'adminFreeze', 'courtOrder', 'registrarsNotation', 'registrarsOrder'] + excluded_filings = ['lear_epoch', 'adminFreeze', 'courtOrder', 'registrarsNotation', 'registrarsOrder', 'transparencyRegister'] excluded_businesses = [Business.LegalTypes.SOLE_PROP.value, Business.LegalTypes.PARTNERSHIP.value] filings = db.session.query(Filing).join(Business). \ filter( diff --git a/legal-api/src/legal_api/resources/v2/business/business_filings/business_filings.py b/legal-api/src/legal_api/resources/v2/business/business_filings/business_filings.py index c2c0d70013..c2213e978f 100644 --- a/legal-api/src/legal_api/resources/v2/business/business_filings/business_filings.py +++ b/legal-api/src/legal_api/resources/v2/business/business_filings/business_filings.py @@ -901,6 +901,9 @@ def create_invoice(business: Business, # pylint: disable=too-many-locals,too-ma corp_type = business.legal_type if business.legal_type else \ filing.json['filing']['business'].get('legalType') + if filing.filing_type == Filing.FILINGS['transparencyRegister']['name']: + corp_type = 'BTR' + payload = { 'businessInfo': { 'businessIdentifier': f'{business.identifier}', diff --git a/legal-api/src/legal_api/services/authz.py b/legal-api/src/legal_api/services/authz.py index a1275cf654..072c2c4afc 100644 --- a/legal-api/src/legal_api/services/authz.py +++ b/legal-api/src/legal_api/services/authz.py @@ -482,6 +482,29 @@ def get_allowable_filings_dict(): }, 'transition': { 'legalTypes': ['BC', 'BEN', 'CC', 'ULC', 'C', 'CBEN', 'CUL', 'CCC'] + }, + CoreFiling.FilingTypes.TRANSPARENCY_REGISTER.value: { + 'ANNUAL': { + 'legalTypes': ['BC', 'BEN', 'CC', 'ULC', 'C', 'CBEN', 'CUL', 'CCC'], + 'blockerChecks': { + 'business': [BusinessBlocker.BUSINESS_FROZEN], + 'futureEffectiveFilings': [CoreFiling.FilingTypes.INCORPORATIONAPPLICATION.value] + } + }, + 'CHANGE': { + 'legalTypes': ['BC', 'BEN', 'CC', 'ULC', 'C', 'CBEN', 'CUL', 'CCC'], + 'blockerChecks': { + 'business': [BusinessBlocker.BUSINESS_FROZEN], + 'futureEffectiveFilings': [CoreFiling.FilingTypes.INCORPORATIONAPPLICATION.value] + } + }, + 'INITIAL': { + 'legalTypes': ['BC', 'BEN', 'CC', 'ULC', 'C', 'CBEN', 'CUL', 'CCC'], + 'blockerChecks': { + 'business': [BusinessBlocker.BUSINESS_FROZEN], + 'futureEffectiveFilings': [CoreFiling.FilingTypes.INCORPORATIONAPPLICATION.value] + } + } } }, Business.State.HISTORICAL: {} diff --git a/legal-api/src/legal_api/services/filings/validations/transparency_register.py b/legal-api/src/legal_api/services/filings/validations/transparency_register.py new file mode 100644 index 0000000000..8989dac050 --- /dev/null +++ b/legal-api/src/legal_api/services/filings/validations/transparency_register.py @@ -0,0 +1,43 @@ +# Copyright © 2025 Province of British Columbia +# +# Licensed under the BSD 3 Clause License, (the "License"); +# you may not use this file except in compliance with the License. +# The template for the license can be found here +# https://opensource.org/license/bsd-3-clause/ +# +# Redistribution and use in source and binary forms, +# with or without modification, are permitted provided that the +# following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +"""Validation for the Transparency Register filing.""" +from typing import Optional + +from legal_api.errors import Error + + +def validate(_: dict) -> Optional[Error]: + """Validate the Transparency Register filing.""" + # NOTE: There isn't anything to validate outside what is already validated via the schema yet + return None diff --git a/legal-api/src/legal_api/services/filings/validations/validation.py b/legal-api/src/legal_api/services/filings/validations/validation.py index 3faaab272e..3681b5d93e 100644 --- a/legal-api/src/legal_api/services/filings/validations/validation.py +++ b/legal-api/src/legal_api/services/filings/validations/validation.py @@ -49,6 +49,7 @@ from .restoration import validate as restoration_validate from .schemas import validate_against_schema from .special_resolution import validate as special_resolution_validate +from .transparency_register import validate as transparency_register_validate def validate(business: Business, # pylint: disable=too-many-branches,too-many-statements @@ -190,6 +191,9 @@ def validate(business: Business, # pylint: disable=too-many-branches,too-many-s elif k == Filing.FILINGS['putBackOff'].get('name'): err = put_back_off_validate(business, filing_json) + elif k == Filing.FILINGS['transparencyRegister'].get('name'): + err = transparency_register_validate(filing_json) # pylint: disable=assignment-from-none + if err: return err diff --git a/queue_services/business-pay/src/business_pay/resources/pay_filer.py b/queue_services/business-pay/src/business_pay/resources/pay_filer.py index 30fb3d66d6..b439d6f90d 100644 --- a/queue_services/business-pay/src/business_pay/resources/pay_filer.py +++ b/queue_services/business-pay/src/business_pay/resources/pay_filer.py @@ -109,7 +109,7 @@ async def worker(): logger.debug(f"Removed From Queue: no payment info in ce: {str(ce)}") return {}, HTTPStatus.OK - if payment_token.corp_type_code in ["MHR", "BTR"]: + if payment_token.corp_type_code in ["MHR"]: logger.debug( f"ignoring message for corp_type_code:{payment_token.corp_type_code}, {str(ce)}") return {}, HTTPStatus.OK From cd12aa31fc85de345244207b338d516919313e74 Mon Sep 17 00:00:00 2001 From: Kial Jinnah Date: Fri, 7 Feb 2025 15:37:47 -0500 Subject: [PATCH 2/8] TR filing PM test Signed-off-by: Kial Jinnah --- .../postman/legal-api.postman_collection.json | 725 +++++++++++------- 1 file changed, 429 insertions(+), 296 deletions(-) diff --git a/legal-api/tests/postman/legal-api.postman_collection.json b/legal-api/tests/postman/legal-api.postman_collection.json index 5097bef2bf..d8ee65919e 100644 --- a/legal-api/tests/postman/legal-api.postman_collection.json +++ b/legal-api/tests/postman/legal-api.postman_collection.json @@ -1,10 +1,11 @@ { "info": { - "_postman_id": "109b8aad-eda5-442c-a7e3-981b00ada6f8", + "_postman_id": "9e1398e3-eb5e-4cb5-b4a8-9f077cf1b284", "name": "legal-api", "description": "version=2.8 - Legal API Postman Tests", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json", - "_exporter_id": "484083" + "_exporter_id": "6835935", + "_collection_link": "https://warped-escape-616276.postman.co/workspace/bc-registries~8ef8e652-492a-4d19-b978-d4f0da255b2c/collection/6835935-9e1398e3-eb5e-4cb5-b4a8-9f077cf1b284?action=share&source=collection_link&creator=6835935" }, "item": [ { @@ -196,9 +197,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "multipart/form-data" + "value": "multipart/form-data", + "type": "text" } ], "body": { @@ -255,9 +255,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "multipart/form-data" + "value": "multipart/form-data", + "type": "text" } ], "body": { @@ -314,9 +313,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "multipart/form-data" + "value": "multipart/form-data", + "type": "text" } ], "body": { @@ -373,9 +371,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "multipart/form-data" + "value": "multipart/form-data", + "type": "text" } ], "body": { @@ -432,9 +429,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "multipart/form-data" + "value": "multipart/form-data", + "type": "text" } ], "body": { @@ -491,9 +487,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "multipart/form-data" + "value": "multipart/form-data", + "type": "text" } ], "body": { @@ -541,9 +536,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "multipart/form-data" + "value": "multipart/form-data", + "type": "text" } ], "url": { @@ -582,9 +576,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "multipart/form-data" + "value": "multipart/form-data", + "type": "text" } ], "url": { @@ -2332,9 +2325,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -2380,9 +2372,9 @@ "header": [ { "key": "Content-Type", + "value": "application/json", "name": "Content-Type", - "type": "text", - "value": "application/json" + "type": "text" } ], "body": { @@ -2637,14 +2629,13 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{token}}" + "value": "Bearer {{token}}", + "type": "text" } ], "body": { @@ -2684,14 +2675,14 @@ "header": [ { "key": "Content-Type", + "value": "application/json", "name": "Content-Type", - "type": "text", - "value": "application/json" + "type": "text" }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{token}}" + "value": "Bearer {{token}}", + "type": "text" } ], "body": { @@ -3244,7 +3235,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -3281,8 +3271,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -4029,9 +4019,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -4066,9 +4055,9 @@ "header": [ { "key": "Content-Type", + "value": "application/json", "name": "Content-Type", - "type": "text", - "value": "application/json" + "type": "text" } ], "body": { @@ -4623,7 +4612,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -4660,8 +4648,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -4833,9 +4821,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -4875,8 +4862,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -4983,9 +4970,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -5025,8 +5011,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -5541,7 +5527,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -5578,8 +5563,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -5747,9 +5732,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -5789,8 +5773,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -5897,9 +5881,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -5939,8 +5922,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -6058,9 +6041,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -6095,8 +6077,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -6216,9 +6198,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -6253,8 +6234,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -6374,9 +6355,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -6411,8 +6391,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -6530,9 +6510,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -6567,8 +6546,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -7430,7 +7409,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -7519,7 +7497,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -7799,8 +7776,8 @@ "header": [ { "key": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -7892,8 +7869,8 @@ "header": [ { "key": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -7972,8 +7949,8 @@ "header": [ { "key": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -8062,8 +8039,8 @@ "header": [ { "key": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -8253,9 +8230,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -8303,9 +8279,9 @@ "header": [ { "key": "Content-Type", + "value": "application/json", "name": "Content-Type", - "type": "text", - "value": "application/json" + "type": "text" } ], "body": { @@ -8684,9 +8660,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -8734,9 +8709,9 @@ "header": [ { "key": "Content-Type", + "value": "application/json", "name": "Content-Type", - "type": "text", - "value": "application/json" + "type": "text" } ], "body": { @@ -8860,9 +8835,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -8910,9 +8884,9 @@ "header": [ { "key": "Content-Type", + "value": "application/json", "name": "Content-Type", - "type": "text", - "value": "application/json" + "type": "text" } ], "body": { @@ -9034,9 +9008,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -9089,9 +9062,9 @@ "header": [ { "key": "Content-Type", + "value": "application/json", "name": "Content-Type", - "type": "text", - "value": "application/json" + "type": "text" } ], "body": { @@ -9213,14 +9186,13 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{token}}" + "value": "Bearer {{token}}", + "type": "text" } ], "body": { @@ -9266,14 +9238,14 @@ "header": [ { "key": "Content-Type", + "value": "application/json", "name": "Content-Type", - "type": "text", - "value": "application/json" + "type": "text" }, { "key": "Authorization", - "type": "text", - "value": "Bearer {{token}}" + "value": "Bearer {{token}}", + "type": "text" } ], "body": { @@ -9491,9 +9463,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -9541,9 +9512,9 @@ "header": [ { "key": "Content-Type", + "value": "application/json", "name": "Content-Type", - "type": "text", - "value": "application/json" + "type": "text" } ], "body": { @@ -9958,7 +9929,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -9995,8 +9965,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -10122,9 +10092,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "url": { @@ -10156,8 +10125,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -10298,9 +10267,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -10401,9 +10369,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "type": "text", - "value": "application/json" + "value": "application/json", + "type": "text" } ], "body": { @@ -10473,7 +10440,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" }, @@ -10582,7 +10548,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -10676,7 +10641,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -10713,8 +10677,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -10856,7 +10820,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -10893,8 +10856,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -11036,7 +10999,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -11130,7 +11092,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -11224,7 +11185,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -11316,7 +11276,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -11410,7 +11369,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -11447,7 +11405,7 @@ "name": "Special Resolution", "item": [ { - "name": "post - success - CP3490248", + "name": "post - fail, missing resolution text - CP3490248", "event": [ { "listen": "test", @@ -11458,8 +11416,8 @@ "", "var jsonData = pm.response.json();", "", - "pm.test(\"Status code is 200\", function () {", - " pm.response.to.have.status(200);", + "pm.test(\"Status code is 400\", function () {", + " pm.response.to.have.status(400);", "});", "", "pm.test('should return JSON', function () {", @@ -11467,11 +11425,15 @@ "});", "", "", - "pm.test(\"Returns special resolution filing.\", () => {", + "pm.test(\"Returns dissolution filing.\", () => {", " pm.expect(jsonData.filing).to.exist", " pm.expect(jsonData.filing.business).to.exist", " pm.expect(jsonData.filing.specialResolution).to.exist", " pm.expect(jsonData.filing.header).to.exist", + " pm.expect(jsonData.errors).to.exist", + " pm.expect(jsonData.errors.length).to.eq(1)", + " pm.expect(jsonData.errors[0].error).to.eq('Resolution must be provided.')", + " pm.expect(jsonData.errors[0].path).to.eq('/filing/specialResolution/resolution')", "});", "", "" @@ -11505,14 +11467,13 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"Be in resolved that cookies are delicious.\\n\\nNom nom nom...\",\n \"resolutionDate\": \"2021-10-01\",\n \"signingDate\": \"2021-10-01\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" + "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"\",\n \"resolutionDate\": \"2021-10-01\",\n \"signingDate\": \"2021-10-01\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" }, "url": { "raw": "{{url}}/api/v1/businesses/:id/filings", @@ -11537,7 +11498,7 @@ "response": [] }, { - "name": "post - fail, missing resolution text - CP3490248", + "name": "post - fail, missing resolution date - CP3490248 Copy", "event": [ { "listen": "test", @@ -11564,8 +11525,8 @@ " pm.expect(jsonData.filing.header).to.exist", " pm.expect(jsonData.errors).to.exist", " pm.expect(jsonData.errors.length).to.eq(1)", - " pm.expect(jsonData.errors[0].error).to.eq('Resolution must be provided.')", - " pm.expect(jsonData.errors[0].path).to.eq('/filing/specialResolution/resolution')", + " pm.expect(jsonData.errors[0].error).to.eq('Resolution date is required.')", + " pm.expect(jsonData.errors[0].path).to.eq('/filing/specialResolution/resolutionDate')", "});", "", "" @@ -11599,14 +11560,13 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"\",\n \"resolutionDate\": \"2021-10-01\",\n \"signingDate\": \"2021-10-01\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" + "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"Be in resolved that cookies are delicious.\\n\\nNom nom nom...\",\n \"signingDate\": \"2021-10-01\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" }, "url": { "raw": "{{url}}/api/v1/businesses/:id/filings", @@ -11631,13 +11591,14 @@ "response": [] }, { - "name": "post - fail, missing resolution date - CP3490248 Copy", + "name": "post - fail, resolution date future - CP3490248", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json()", + "const jsonDataText = pm.response.text()", "pm.environment.set(\"filing_id\", jsonData.filing.header.filingId)", "", "var jsonData = pm.response.json();", @@ -11657,9 +11618,8 @@ " pm.expect(jsonData.filing.specialResolution).to.exist", " pm.expect(jsonData.filing.header).to.exist", " pm.expect(jsonData.errors).to.exist", - " pm.expect(jsonData.errors.length).to.eq(1)", - " pm.expect(jsonData.errors[0].error).to.eq('Resolution date is required.')", - " pm.expect(jsonData.errors[0].path).to.eq('/filing/specialResolution/resolutionDate')", + " pm.expect(jsonDataText).to.include('Resolution date cannot be in the future.')", + " pm.expect(jsonDataText).to.include('/filing/specialResolution/resolutionDate')", "});", "", "" @@ -11672,7 +11632,11 @@ "script": { "exec": [ "var today = new Date()", - "pm.environment.set(\"today\", today.getFullYear()+'-'+('0'+(today.getMonth()+1)).slice(-2)+'-'+('0'+today.getDate()).slice(-2))" + "pm.environment.set(\"today\", today.getFullYear()+'-'+('0'+(today.getMonth()+1)).slice(-2)+'-'+('0'+today.getDate()).slice(-2))", + "", + "var future = new Date()", + "future.setDate(future.getDate() + 10)", + "pm.environment.set(\"future\", future.getFullYear()+'-'+('0'+(future.getMonth()+1)).slice(-2)+'-'+('0'+future.getDate()).slice(-2))" ], "type": "text/javascript" } @@ -11693,14 +11657,13 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"Be in resolved that cookies are delicious.\\n\\nNom nom nom...\",\n \"signingDate\": \"2021-10-01\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" + "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"Be in resolved that cookies are delicious.\\n\\nNom nom nom...\",\n \"resolutionDate\": \"{{future}}\",\n \"signingDate\": \"2021-10-01\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" }, "url": { "raw": "{{url}}/api/v1/businesses/:id/filings", @@ -11725,7 +11688,7 @@ "response": [] }, { - "name": "post - fail, resolution date future - CP3490248", + "name": "post - fail, resolution date < incorp date - CP3490248", "event": [ { "listen": "test", @@ -11752,7 +11715,7 @@ " pm.expect(jsonData.filing.specialResolution).to.exist", " pm.expect(jsonData.filing.header).to.exist", " pm.expect(jsonData.errors).to.exist", - " pm.expect(jsonDataText).to.include('Resolution date cannot be in the future.')", + " pm.expect(jsonDataText).to.include('Resolution date cannot be earlier than the incorporation date.')", " pm.expect(jsonDataText).to.include('/filing/specialResolution/resolutionDate')", "});", "", @@ -11791,14 +11754,13 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"Be in resolved that cookies are delicious.\\n\\nNom nom nom...\",\n \"resolutionDate\": \"{{future}}\",\n \"signingDate\": \"2021-10-01\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" + "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"Be in resolved that cookies are delicious.\\n\\nNom nom nom...\",\n \"resolutionDate\": \"1970-01-01\",\n \"signingDate\": \"2021-10-01\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" }, "url": { "raw": "{{url}}/api/v1/businesses/:id/filings", @@ -11823,14 +11785,13 @@ "response": [] }, { - "name": "post - fail, resolution date < incorp date - CP3490248", + "name": "post - fail, missing signing date - CP3490248", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json()", - "const jsonDataText = pm.response.text()", "pm.environment.set(\"filing_id\", jsonData.filing.header.filingId)", "", "var jsonData = pm.response.json();", @@ -11850,8 +11811,9 @@ " pm.expect(jsonData.filing.specialResolution).to.exist", " pm.expect(jsonData.filing.header).to.exist", " pm.expect(jsonData.errors).to.exist", - " pm.expect(jsonDataText).to.include('Resolution date cannot be earlier than the incorporation date.')", - " pm.expect(jsonDataText).to.include('/filing/specialResolution/resolutionDate')", + " pm.expect(jsonData.errors.length).to.eq(1)", + " pm.expect(jsonData.errors[0].error).to.eq('Signing date is required.')", + " pm.expect(jsonData.errors[0].path).to.eq('/filing/specialResolution/signingDate')", "});", "", "" @@ -11864,11 +11826,7 @@ "script": { "exec": [ "var today = new Date()", - "pm.environment.set(\"today\", today.getFullYear()+'-'+('0'+(today.getMonth()+1)).slice(-2)+'-'+('0'+today.getDate()).slice(-2))", - "", - "var future = new Date()", - "future.setDate(future.getDate() + 10)", - "pm.environment.set(\"future\", future.getFullYear()+'-'+('0'+(future.getMonth()+1)).slice(-2)+'-'+('0'+future.getDate()).slice(-2))" + "pm.environment.set(\"today\", today.getFullYear()+'-'+('0'+(today.getMonth()+1)).slice(-2)+'-'+('0'+today.getDate()).slice(-2))" ], "type": "text/javascript" } @@ -11889,14 +11847,13 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"Be in resolved that cookies are delicious.\\n\\nNom nom nom...\",\n \"resolutionDate\": \"1970-01-01\",\n \"signingDate\": \"2021-10-01\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" + "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"Be in resolved that cookies are delicious.\\n\\nNom nom nom...\",\n \"resolutionDate\": \"2021-10-01\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" }, "url": { "raw": "{{url}}/api/v1/businesses/:id/filings", @@ -11921,13 +11878,14 @@ "response": [] }, { - "name": "post - fail, missing signing date - CP3490248", + "name": "post - fail, signing date future - CP3490248", "event": [ { "listen": "test", "script": { "exec": [ "var jsonData = pm.response.json()", + "const jsonDataText = pm.response.text()", "pm.environment.set(\"filing_id\", jsonData.filing.header.filingId)", "", "var jsonData = pm.response.json();", @@ -11947,9 +11905,8 @@ " pm.expect(jsonData.filing.specialResolution).to.exist", " pm.expect(jsonData.filing.header).to.exist", " pm.expect(jsonData.errors).to.exist", - " pm.expect(jsonData.errors.length).to.eq(1)", - " pm.expect(jsonData.errors[0].error).to.eq('Signing date is required.')", - " pm.expect(jsonData.errors[0].path).to.eq('/filing/specialResolution/signingDate')", + " pm.expect(jsonDataText).to.include('Signing date cannot be in the future.')", + " pm.expect(jsonDataText).to.include('/filing/specialResolution/signingDate')", "});", "", "" @@ -11962,7 +11919,11 @@ "script": { "exec": [ "var today = new Date()", - "pm.environment.set(\"today\", today.getFullYear()+'-'+('0'+(today.getMonth()+1)).slice(-2)+'-'+('0'+today.getDate()).slice(-2))" + "pm.environment.set(\"today\", today.getFullYear()+'-'+('0'+(today.getMonth()+1)).slice(-2)+'-'+('0'+today.getDate()).slice(-2))", + "", + "var future = new Date()", + "future.setDate(future.getDate() + 10)", + "pm.environment.set(\"future\", future.getFullYear()+'-'+('0'+(future.getMonth()+1)).slice(-2)+'-'+('0'+future.getDate()).slice(-2))" ], "type": "text/javascript" } @@ -11983,14 +11944,13 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } ], "body": { "mode": "raw", - "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"Be in resolved that cookies are delicious.\\n\\nNom nom nom...\",\n \"resolutionDate\": \"2021-10-01\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" + "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"Be in resolved that cookies are delicious.\\n\\nNom nom nom...\",\n \"resolutionDate\": \"2021-10-01\",\n \"signingDate\": \"{{future}}\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" }, "url": { "raw": "{{url}}/api/v1/businesses/:id/filings", @@ -12015,7 +11975,7 @@ "response": [] }, { - "name": "post - fail, signing date future - CP3490248", + "name": "post - fail, signing date < resolution date - CP3490248", "event": [ { "listen": "test", @@ -12042,7 +12002,7 @@ " pm.expect(jsonData.filing.specialResolution).to.exist", " pm.expect(jsonData.filing.header).to.exist", " pm.expect(jsonData.errors).to.exist", - " pm.expect(jsonDataText).to.include('Signing date cannot be in the future.')", + " pm.expect(jsonDataText).to.include('Signing date cannot be before the resolution date.')", " pm.expect(jsonDataText).to.include('/filing/specialResolution/signingDate')", "});", "", @@ -12081,105 +12041,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", - "value": "application/json", - "type": "text" - } - ], - "body": { - "mode": "raw", - "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"dissolution\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T00:00:00+00:00\"\n },\n \"business\": {\n \"identifier\": \"CP3490248\",\n \"legalType\": \"CP\"\n },\n \"specialResolution\": {\n \"resolution\": \"Be in resolved that cookies are delicious.\\n\\nNom nom nom...\",\n \"resolutionDate\": \"2021-10-01\",\n \"signingDate\": \"{{future}}\",\n \"signatory\": {\n \"givenName\": \"Jane\",\n \"additionalName\": \"\",\n \"familyName\": \"Doe\"\n }\n }\n }\n}" - }, - "url": { - "raw": "{{url}}/api/v1/businesses/:id/filings", - "host": [ - "{{url}}" - ], - "path": [ - "api", - "v1", - "businesses", - ":id", - "filings" - ], - "variable": [ - { - "key": "id", - "value": "CP3490248" - } - ] - } - }, - "response": [] - }, - { - "name": "post - fail, signing date < resolution date - CP3490248", - "event": [ - { - "listen": "test", - "script": { - "exec": [ - "var jsonData = pm.response.json()", - "const jsonDataText = pm.response.text()", - "pm.environment.set(\"filing_id\", jsonData.filing.header.filingId)", - "", - "var jsonData = pm.response.json();", - "", - "pm.test(\"Status code is 400\", function () {", - " pm.response.to.have.status(400);", - "});", - "", - "pm.test('should return JSON', function () {", - " pm.response.to.have.header('Content-Type', 'application/json');", - "});", - "", - "", - "pm.test(\"Returns dissolution filing.\", () => {", - " pm.expect(jsonData.filing).to.exist", - " pm.expect(jsonData.filing.business).to.exist", - " pm.expect(jsonData.filing.specialResolution).to.exist", - " pm.expect(jsonData.filing.header).to.exist", - " pm.expect(jsonData.errors).to.exist", - " pm.expect(jsonDataText).to.include('Signing date cannot be before the resolution date.')", - " pm.expect(jsonDataText).to.include('/filing/specialResolution/signingDate')", - "});", - "", - "" - ], - "type": "text/javascript" - } - }, - { - "listen": "prerequest", - "script": { - "exec": [ - "var today = new Date()", - "pm.environment.set(\"today\", today.getFullYear()+'-'+('0'+(today.getMonth()+1)).slice(-2)+'-'+('0'+today.getDate()).slice(-2))", - "", - "var future = new Date()", - "future.setDate(future.getDate() + 10)", - "pm.environment.set(\"future\", future.getFullYear()+'-'+('0'+(future.getMonth()+1)).slice(-2)+'-'+('0'+future.getDate()).slice(-2))" - ], - "type": "text/javascript" - } - } - ], - "request": { - "auth": { - "type": "bearer", - "bearer": [ - { - "key": "token", - "value": "{{token}}", - "type": "string" - } - ] - }, - "method": "POST", - "header": [ - { - "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -12278,7 +12139,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -12377,7 +12237,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -17436,7 +17295,6 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", "type": "text" } @@ -17473,8 +17331,8 @@ "header": [ { "key": "Content-Type", - "name": "Content-Type", "value": "application/json", + "name": "Content-Type", "type": "text" } ], @@ -18103,6 +17961,281 @@ "response": [] } ] + }, + { + "name": "Transparency Register", + "item": [ + { + "name": "INITIAL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json()", + "pm.environment.set(\"filing_id\", jsonData.filing.header.filingId)", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test('should return JSON', function () {", + " pm.response.to.have.header('Content-Type', 'application/json');", + "});", + "", + "", + "pm.test(\"Returns special resolution filing.\", () => {", + " pm.expect(jsonData.filing).to.exist", + " pm.expect(jsonData.filing.business).to.exist", + " pm.expect(jsonData.filing.specialResolution).to.exist", + " pm.expect(jsonData.filing.header).to.exist", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var today = new Date()", + "pm.environment.set(\"today\", today.getFullYear()+'-'+('0'+(today.getMonth()+1)).slice(-2)+'-'+('0'+today.getDate()).slice(-2))" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Account-Id", + "value": "3101", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"transparencyRegister\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T15:31:55+00:00\"\n },\n \"business\": {\n \"identifier\": \"{{business_identifier}}\"\n },\n \"transparencyRegister\": {\n \"type\": \"INITIAL\",\n \"ledgerReferenceNumber\": \"1234rtfjf44544fkk\"\n }\n }\n}" + }, + "url": { + "raw": "{{url}}/api/v2/businesses/{{business_identifier}}/filings", + "host": [ + "{{url}}" + ], + "path": [ + "api", + "v2", + "businesses", + "{{business_identifier}}", + "filings" + ] + } + }, + "response": [] + }, + { + "name": "ANNUAL", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json()", + "pm.environment.set(\"filing_id\", jsonData.filing.header.filingId)", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test('should return JSON', function () {", + " pm.response.to.have.header('Content-Type', 'application/json');", + "});", + "", + "", + "pm.test(\"Returns special resolution filing.\", () => {", + " pm.expect(jsonData.filing).to.exist", + " pm.expect(jsonData.filing.business).to.exist", + " pm.expect(jsonData.filing.specialResolution).to.exist", + " pm.expect(jsonData.filing.header).to.exist", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var today = new Date()", + "pm.environment.set(\"today\", today.getFullYear()+'-'+('0'+(today.getMonth()+1)).slice(-2)+'-'+('0'+today.getDate()).slice(-2))" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Account-Id", + "value": "3101", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"transparencyRegister\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T15:40:55+00:00\"\n },\n \"business\": {\n \"identifier\": \"{{business_identifier}}\"\n },\n \"transparencyRegister\": {\n \"type\": \"ANNUAL\",\n \"ledgerReferenceNumber\": \"2234rtfjf44544fka\"\n }\n }\n}" + }, + "url": { + "raw": "{{url}}/api/v2/businesses/{{business_identifier}}/filings", + "host": [ + "{{url}}" + ], + "path": [ + "api", + "v2", + "businesses", + "{{business_identifier}}", + "filings" + ] + } + }, + "response": [] + }, + { + "name": "CHANGE", + "event": [ + { + "listen": "test", + "script": { + "exec": [ + "var jsonData = pm.response.json()", + "pm.environment.set(\"filing_id\", jsonData.filing.header.filingId)", + "", + "var jsonData = pm.response.json();", + "", + "pm.test(\"Status code is 200\", function () {", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test('should return JSON', function () {", + " pm.response.to.have.header('Content-Type', 'application/json');", + "});", + "", + "", + "pm.test(\"Returns special resolution filing.\", () => {", + " pm.expect(jsonData.filing).to.exist", + " pm.expect(jsonData.filing.business).to.exist", + " pm.expect(jsonData.filing.specialResolution).to.exist", + " pm.expect(jsonData.filing.header).to.exist", + "});", + "", + "" + ], + "type": "text/javascript", + "packages": {} + } + }, + { + "listen": "prerequest", + "script": { + "exec": [ + "var today = new Date()", + "pm.environment.set(\"today\", today.getFullYear()+'-'+('0'+(today.getMonth()+1)).slice(-2)+'-'+('0'+today.getDate()).slice(-2))" + ], + "type": "text/javascript", + "packages": {} + } + } + ], + "request": { + "auth": { + "type": "bearer", + "bearer": [ + { + "key": "token", + "value": "{{token}}", + "type": "string" + } + ] + }, + "method": "POST", + "header": [ + { + "key": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "Account-Id", + "value": "3101", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"transparencyRegister\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T15:50:55+00:00\"\n },\n \"business\": {\n \"identifier\": \"{{business_identifier}}\"\n },\n \"transparencyRegister\": {\n \"type\": \"CHANGE\",\n \"ledgerReferenceNumber\": \"3234rtfjf44544fkb\"\n }\n }\n}" + }, + "url": { + "raw": "{{url}}/api/v2/businesses/{{business_identifier}}/filings", + "host": [ + "{{url}}" + ], + "path": [ + "api", + "v2", + "businesses", + "{{business_identifier}}", + "filings" + ] + } + }, + "response": [] + } + ] } ], "event": [ @@ -18125,4 +18258,4 @@ } } ] -} +} \ No newline at end of file From 9263e0c2a7eeebb194905eeab73599f401aa9a4b Mon Sep 17 00:00:00 2001 From: Kial Jinnah Date: Fri, 7 Feb 2025 16:31:33 -0500 Subject: [PATCH 3/8] PR comments + lint Signed-off-by: Kial Jinnah --- legal-api/src/legal_api/core/filing.py | 7 ++++--- legal-api/src/legal_api/core/meta/filing.py | 6 +++--- legal-api/src/legal_api/models/filing.py | 15 +++++++++++---- legal-api/src/legal_api/services/authz.py | 6 +++--- .../postman/legal-api.postman_collection.json | 10 +++++----- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/legal-api/src/legal_api/core/filing.py b/legal-api/src/legal_api/core/filing.py index 0d55bb368b..1ad8757471 100644 --- a/legal-api/src/legal_api/core/filing.py +++ b/legal-api/src/legal_api/core/filing.py @@ -111,9 +111,9 @@ class FilingTypesCompact(str, Enum): AMALGAMATION_APPLICATION_REGULAR = 'amalgamationApplication.regular' AMALGAMATION_APPLICATION_VERTICAL = 'amalgamationApplication.vertical' AMALGAMATION_APPLICATION_HORIZONTAL = 'amalgamationApplication.horizontal' - TRANSPARENCY_REGISTER_ANNUAL = 'transparencyRegister.ANNUAL' - TRANSPARENCY_REGISTER_CHANGE = 'transparencyRegister.CHANGE' - TRANSPARENCY_REGISTER_INITIAL = 'transparencyRegister.INITIAL' + TRANSPARENCY_REGISTER_ANNUAL = 'transparencyRegister.annual' + TRANSPARENCY_REGISTER_CHANGE = 'transparencyRegister.change' + TRANSPARENCY_REGISTER_INITIAL = 'transparencyRegister.initial' NEW_BUSINESS_FILING_TYPES: Final = [ FilingTypes.AMALGAMATIONAPPLICATION, @@ -535,6 +535,7 @@ def get_document_list(business, # pylint: disable=too-many-locals disable=too-m Filing.FilingTypes.CONTINUATIONOUT.value, Filing.FilingTypes.AGMEXTENSION.value, Filing.FilingTypes.AGMLOCATIONCHANGE.value, + Filing.FilingTypes.TRANSPARENCY_REGISTER.value, ] if (filing.status in (Filing.Status.PAID, Filing.Status.WITHDRAWN) or (filing.status == Filing.Status.COMPLETED and diff --git a/legal-api/src/legal_api/core/meta/filing.py b/legal-api/src/legal_api/core/meta/filing.py index 26963d8b29..f7f67b14c3 100644 --- a/legal-api/src/legal_api/core/meta/filing.py +++ b/legal-api/src/legal_api/core/meta/filing.py @@ -648,7 +648,7 @@ class FilingTitles(str, Enum): }, 'transparencyRegister': { 'name': 'transparencyRegister', - 'ANNUAL': { + 'annual': { 'name': 'transparencyRegister', 'title': 'Transparency Register - Annual Filing', 'displayName': 'Transparency Register - Annual Filing', @@ -663,7 +663,7 @@ class FilingTitles(str, Enum): 'CCC': 'REGSIGIN' } }, - 'CHANGE': { + 'change': { 'name': 'transparencyRegister', 'title': 'Transparency Register Filing', 'displayName': 'Transparency Register Filing', @@ -678,7 +678,7 @@ class FilingTitles(str, Enum): 'CCC': 'REGSIGIN' } }, - 'INITIAL': { + 'initial': { 'name': 'transparencyRegister', 'title': 'Transparency Register Filing', 'displayName': 'Transparency Register Filing', diff --git a/legal-api/src/legal_api/models/filing.py b/legal-api/src/legal_api/models/filing.py index 827f0c7fef..5b07081807 100644 --- a/legal-api/src/legal_api/models/filing.py +++ b/legal-api/src/legal_api/models/filing.py @@ -450,7 +450,7 @@ class Source(Enum): }, 'transparencyRegister': { 'name': 'transparencyRegister', - 'ANNUAL': { + 'annual': { 'name': 'transparencyRegister', 'title': 'Transparency Register - Annual Filing', 'codes': { @@ -464,7 +464,7 @@ class Source(Enum): 'CCC': 'REGSIGIN' } }, - 'CHANGE': { + 'change': { 'name': 'transparencyRegister', 'title': 'Transparency Register Filing', 'codes': { @@ -478,7 +478,7 @@ class Source(Enum): 'CCC': 'REGSIGIN' } }, - 'INITIAL': { + 'initial': { 'name': 'transparencyRegister', 'title': 'Transparency Register Filing', 'codes': { @@ -1099,7 +1099,14 @@ def get_most_recent_legal_filing(business_id: str, filing_type: str = None): def get_completed_filings_for_colin(limit=20, offset=0): """Return the filings based on limit and offset.""" from .business import Business # noqa: F401; pylint: disable=import-outside-toplevel - excluded_filings = ['lear_epoch', 'adminFreeze', 'courtOrder', 'registrarsNotation', 'registrarsOrder', 'transparencyRegister'] + excluded_filings = [ + 'lear_epoch', + 'adminFreeze', + 'courtOrder', + 'registrarsNotation', + 'registrarsOrder', + 'transparencyRegister' + ] excluded_businesses = [Business.LegalTypes.SOLE_PROP.value, Business.LegalTypes.PARTNERSHIP.value] filings = db.session.query(Filing).join(Business). \ filter( diff --git a/legal-api/src/legal_api/services/authz.py b/legal-api/src/legal_api/services/authz.py index 072c2c4afc..4d9589f6a2 100644 --- a/legal-api/src/legal_api/services/authz.py +++ b/legal-api/src/legal_api/services/authz.py @@ -484,21 +484,21 @@ def get_allowable_filings_dict(): 'legalTypes': ['BC', 'BEN', 'CC', 'ULC', 'C', 'CBEN', 'CUL', 'CCC'] }, CoreFiling.FilingTypes.TRANSPARENCY_REGISTER.value: { - 'ANNUAL': { + 'annual': { 'legalTypes': ['BC', 'BEN', 'CC', 'ULC', 'C', 'CBEN', 'CUL', 'CCC'], 'blockerChecks': { 'business': [BusinessBlocker.BUSINESS_FROZEN], 'futureEffectiveFilings': [CoreFiling.FilingTypes.INCORPORATIONAPPLICATION.value] } }, - 'CHANGE': { + 'change': { 'legalTypes': ['BC', 'BEN', 'CC', 'ULC', 'C', 'CBEN', 'CUL', 'CCC'], 'blockerChecks': { 'business': [BusinessBlocker.BUSINESS_FROZEN], 'futureEffectiveFilings': [CoreFiling.FilingTypes.INCORPORATIONAPPLICATION.value] } }, - 'INITIAL': { + 'initial': { 'legalTypes': ['BC', 'BEN', 'CC', 'ULC', 'C', 'CBEN', 'CUL', 'CCC'], 'blockerChecks': { 'business': [BusinessBlocker.BUSINESS_FROZEN], diff --git a/legal-api/tests/postman/legal-api.postman_collection.json b/legal-api/tests/postman/legal-api.postman_collection.json index d8ee65919e..08c78b5b91 100644 --- a/legal-api/tests/postman/legal-api.postman_collection.json +++ b/legal-api/tests/postman/legal-api.postman_collection.json @@ -17966,7 +17966,7 @@ "name": "Transparency Register", "item": [ { - "name": "INITIAL", + "name": "initial", "event": [ { "listen": "test", @@ -18037,7 +18037,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"transparencyRegister\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T15:31:55+00:00\"\n },\n \"business\": {\n \"identifier\": \"{{business_identifier}}\"\n },\n \"transparencyRegister\": {\n \"type\": \"INITIAL\",\n \"ledgerReferenceNumber\": \"1234rtfjf44544fkk\"\n }\n }\n}" + "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"transparencyRegister\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T15:31:55+00:00\"\n },\n \"business\": {\n \"identifier\": \"{{business_identifier}}\"\n },\n \"transparencyRegister\": {\n \"type\": \"initial\",\n \"ledgerReferenceNumber\": \"1234rtfjf44544fkk\"\n }\n }\n}" }, "url": { "raw": "{{url}}/api/v2/businesses/{{business_identifier}}/filings", @@ -18056,7 +18056,7 @@ "response": [] }, { - "name": "ANNUAL", + "name": "annual", "event": [ { "listen": "test", @@ -18127,7 +18127,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"transparencyRegister\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T15:40:55+00:00\"\n },\n \"business\": {\n \"identifier\": \"{{business_identifier}}\"\n },\n \"transparencyRegister\": {\n \"type\": \"ANNUAL\",\n \"ledgerReferenceNumber\": \"2234rtfjf44544fka\"\n }\n }\n}" + "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"transparencyRegister\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T15:40:55+00:00\"\n },\n \"business\": {\n \"identifier\": \"{{business_identifier}}\"\n },\n \"transparencyRegister\": {\n \"type\": \"annual\",\n \"ledgerReferenceNumber\": \"2234rtfjf44544fka\"\n }\n }\n}" }, "url": { "raw": "{{url}}/api/v2/businesses/{{business_identifier}}/filings", @@ -18217,7 +18217,7 @@ ], "body": { "mode": "raw", - "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"transparencyRegister\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T15:50:55+00:00\"\n },\n \"business\": {\n \"identifier\": \"{{business_identifier}}\"\n },\n \"transparencyRegister\": {\n \"type\": \"CHANGE\",\n \"ledgerReferenceNumber\": \"3234rtfjf44544fkb\"\n }\n }\n}" + "raw": "{\n \"filing\": {\n \"header\": {\n \"name\": \"transparencyRegister\",\n \"date\": \"{{today}}\",\n \"certifiedBy\": \"full name\",\n \"email\": \"no_one@never.get\",\n \"effectiveDate\": \"{{today}}T15:50:55+00:00\"\n },\n \"business\": {\n \"identifier\": \"{{business_identifier}}\"\n },\n \"transparencyRegister\": {\n \"type\": \"change\",\n \"ledgerReferenceNumber\": \"3234rtfjf44544fkb\"\n }\n }\n}" }, "url": { "raw": "{{url}}/api/v2/businesses/{{business_identifier}}/filings", From 251c9940fb3bff88ce53ddda88bf7e58f51d3e69 Mon Sep 17 00:00:00 2001 From: Kial Jinnah Date: Fri, 7 Feb 2025 16:53:41 -0500 Subject: [PATCH 4/8] test fixes Signed-off-by: Kial Jinnah --- .../tests/unit/services/test_authorization.py | 103 ++++++++++++++---- 1 file changed, 83 insertions(+), 20 deletions(-) diff --git a/legal-api/tests/unit/services/test_authorization.py b/legal-api/tests/unit/services/test_authorization.py index e8dc133a7e..fb3ecaa941 100644 --- a/legal-api/tests/unit/services/test_authorization.py +++ b/legal-api/tests/unit/services/test_authorization.py @@ -161,6 +161,9 @@ class FilingKey(str, Enum): AMALGAMATION_VERTICAL = 'AMALGAMATION_VERTICAL' AMALGAMATION_HORIZONTAL = 'AMALGAMATION_HORIZONTAL' NOTICE_OF_WITHDRAWAL = 'NOTICE_OF_WITHDRAWAL' + TRANSPARENCY_REGISTER_ANNUAL = 'TRANSPARENCY_REGISTER_ANNUAL' + TRANSPARENCY_REGISTER_CHANGE = 'TRANSPARENCY_REGISTER_CHANGE' + TRANSPARENCY_REGISTER_INITIAL = 'TRANSPARENCY_REGISTER_INITIAL' EXPECTED_DATA = { @@ -236,7 +239,10 @@ class FilingKey(str, Enum): FilingKey.AMALGAMATION_REGULAR: {'name': 'amalgamationApplication', 'type': 'regular', 'displayName': 'Amalgamation Application (Regular)', 'feeCode': 'AMALR'}, FilingKey.AMALGAMATION_VERTICAL: {'name': 'amalgamationApplication', 'type': 'vertical', 'displayName': 'Amalgamation Application Short-form (Vertical)', 'feeCode': 'AMALV'}, FilingKey.AMALGAMATION_HORIZONTAL: {'name': 'amalgamationApplication', 'type': 'horizontal', 'displayName': 'Amalgamation Application Short-form (Horizontal)', 'feeCode': 'AMALH'}, - FilingKey.NOTICE_OF_WITHDRAWAL: {'displayName': 'Notice of Withdrawal', 'feeCode': 'NWITH', 'name': 'noticeOfWithdrawal'} + FilingKey.NOTICE_OF_WITHDRAWAL: {'displayName': 'Notice of Withdrawal', 'feeCode': 'NWITH', 'name': 'noticeOfWithdrawal'}, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL: {'name': 'transparencyRegister', 'type': 'annual', 'displayName': 'Transparency Register - Annual Report', 'feeCode': 'REGSIGIN'}, + FilingKey.TRANSPARENCY_REGISTER_CHANGE: {'name': 'transparencyRegister', 'type': 'change', 'displayName': 'Transparency Register Filing', 'feeCode': 'REGSIGIN'}, + FilingKey.TRANSPARENCY_REGISTER_INITIAL: {'name': 'transparencyRegister', 'type': 'initial', 'displayName': 'Transparency Register Filing', 'feeCode': 'REGSIGIN'}, } EXPECTED_DATA_CONT_IN = { @@ -317,7 +323,10 @@ class FilingKey(str, Enum): 'displayName': 'Amalgamation Application Short-form (Horizontal)', 'feeCode': None}, FilingKey.NOTICE_OF_WITHDRAWAL: {'displayName': 'Notice of Withdrawal', 'feeCode': 'NWITH', - 'name': 'noticeOfWithdrawal'} + 'name': 'noticeOfWithdrawal'}, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL: {'name': 'transparencyRegister', 'type': 'annual', 'displayName': 'Transparency Register - Annual Report', 'feeCode': 'REGSIGIN'}, + FilingKey.TRANSPARENCY_REGISTER_CHANGE: {'name': 'transparencyRegister', 'type': 'change', 'displayName': 'Transparency Register Filing', 'feeCode': 'REGSIGIN'}, + FilingKey.TRANSPARENCY_REGISTER_INITIAL: {'name': 'transparencyRegister', 'type': 'initial', 'displayName': 'Transparency Register Filing', 'feeCode': 'REGSIGIN'}, } BLOCKER_FILING_STATUSES = factory_incomplete_statuses() @@ -1012,7 +1021,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.COD_CORPS, FilingKey.CONSENT_CONTINUATION_OUT, FilingKey.VOL_DISS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_continue_in_corps', True, Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], expected_lookup_continue_in_corps([FilingKey.AGM_EXTENSION, @@ -1026,7 +1038,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.COD_CORPS, FilingKey.CONSENT_CONTINUATION_OUT, FilingKey.VOL_DISS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_llc', True, Business.State.ACTIVE, ['LLC'], 'general', [BASIC_USER], []), ('general_user_firms', True, Business.State.ACTIVE, ['SP', 'GP'], 'general', [BASIC_USER], expected_lookup([FilingKey.CHANGE_OF_REGISTRATION, @@ -1307,7 +1322,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.COD_CORPS, FilingKey.CONSENT_CONTINUATION_OUT, FilingKey.VOL_DISS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_continue_in_corps', True, Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], expected_lookup_continue_in_corps([FilingKey.AGM_EXTENSION, @@ -1321,7 +1339,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.COD_CORPS, FilingKey.CONSENT_CONTINUATION_OUT, FilingKey.VOL_DISS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_llc', True, Business.State.ACTIVE, ['LLC'], 'general', [BASIC_USER], []), ('general_user_firms', True, Business.State.ACTIVE, ['SP', 'GP'], 'general', [BASIC_USER], expected_lookup([FilingKey.CHANGE_OF_REGISTRATION, @@ -1612,13 +1633,19 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me expected_lookup([FilingKey.AR_CORPS, FilingKey.COA_CORPS, FilingKey.COD_CORPS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_continue_in_corps', True, Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], expected_lookup([FilingKey.AR_CORPS, FilingKey.COA_CORPS, FilingKey.COD_CORPS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_llc', True, Business.State.ACTIVE, ['LLC'], 'general', [BASIC_USER], []), ('general_user_firms', True, Business.State.ACTIVE, ['SP', 'GP'], 'general', [BASIC_USER], expected_lookup([FilingKey.CHANGE_OF_REGISTRATION])), @@ -1844,7 +1871,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me expected_lookup([FilingKey.TRANSITION])), ('general_user_continu_in_corps', Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], BLOCKER_FILING_TYPES, BLOCKER_FILING_STATUSES_AND_ADDITIONAL, - expected_lookup_continue_in_corps([FilingKey.TRANSITION])), + expected_lookup_continue_in_corps([FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_llc', Business.State.ACTIVE, ['LLC'], 'general', [BASIC_USER], BLOCKER_FILING_TYPES, BLOCKER_FILING_STATUSES_AND_ADDITIONAL, []), ('general_user_firms', Business.State.ACTIVE, ['SP', 'GP'], 'general', [BASIC_USER], BLOCKER_FILING_TYPES, @@ -1937,7 +1967,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.PUT_BACK_OFF, FilingKey.REGISTRARS_NOTATION, FilingKey.REGISTRARS_ORDER, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('staff_active_continue_in_corps', Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'staff', [STAFF_ROLE], ['dissolution.voluntary', 'dissolution.administrative'], BLOCKER_DISSOLUTION_STATUSES_FOR_AMALG, True, expected_lookup([FilingKey.ADMN_FRZE, @@ -1945,15 +1978,24 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.PUT_BACK_OFF, FilingKey.REGISTRARS_NOTATION, FilingKey.REGISTRARS_ORDER, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), # active business - general user ('general_user_corps', Business.State.ACTIVE, ['BC', 'BEN', 'CC', 'ULC'], 'general', [BASIC_USER], ['dissolution.voluntary', 'dissolution.administrative'], BLOCKER_DISSOLUTION_STATUSES_FOR_AMALG, True, - expected_lookup([FilingKey.TRANSITION])), + expected_lookup([FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_usere_continue_in_corps', Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], ['dissolution.voluntary', 'dissolution.administrative'], BLOCKER_DISSOLUTION_STATUSES_FOR_AMALG, True, - expected_lookup([FilingKey.TRANSITION])) + expected_lookup([FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ] ) def test_allowed_filings_blocker_filing_amalgamations(monkeypatch, app, session, jwt, test_name, state, @@ -2078,7 +2120,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.COD_CORPS, FilingKey.CONSENT_CONTINUATION_OUT, FilingKey.VOL_DISS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_continue_in_corps', Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], expected_lookup_continue_in_corps([FilingKey.AGM_EXTENSION, FilingKey.AGM_LOCATION_CHANGE, @@ -2091,7 +2136,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.COD_CORPS, FilingKey.CONSENT_CONTINUATION_OUT, FilingKey.VOL_DISS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_llc', Business.State.ACTIVE, ['LLC'], 'general', [BASIC_USER], []), ('general_user_firms', Business.State.ACTIVE, ['SP', 'GP'], 'general', [BASIC_USER], []), @@ -2299,7 +2347,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.COD_CORPS, FilingKey.CONSENT_CONTINUATION_OUT, FilingKey.VOL_DISS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_corps_unaffected2', Business.State.ACTIVE, ['BC', 'BEN', 'CC', 'ULC'], 'general', [BASIC_USER], ['restoration', 'restoration'], ['limitedRestoration', 'limitedRestorationExtension'], @@ -2313,7 +2364,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.COD_CORPS, FilingKey.CONSENT_CONTINUATION_OUT, FilingKey.VOL_DISS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_continue_in_corps_unaffected', Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], [None, 'restoration'], @@ -2329,7 +2383,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.COD_CORPS, FilingKey.CONSENT_CONTINUATION_OUT, FilingKey.VOL_DISS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_continue_in_corps_unaffected2', Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], ['restoration', 'restoration'], @@ -2682,7 +2739,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me expected_lookup([FilingKey.AR_CORPS, FilingKey.COA_CORPS, FilingKey.COD_CORPS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_llc', True, Business.State.ACTIVE, ['LLC'], 'general', [BASIC_USER], []), ('general_user_firms', True, Business.State.ACTIVE, ['SP', 'GP'], 'general', [BASIC_USER], expected_lookup([FilingKey.CHANGE_OF_REGISTRATION])), @@ -2837,7 +2897,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me expected_lookup([FilingKey.AR_CORPS, FilingKey.COA_CORPS, FilingKey.COD_CORPS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_continue_in_corps', Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], None, expected_lookup([FilingKey.AR_CORPS, From d01c664fb7373a9485e15a14ef20db063ec00fcb Mon Sep 17 00:00:00 2001 From: Kial Jinnah Date: Fri, 7 Feb 2025 17:10:51 -0500 Subject: [PATCH 5/8] Test tweaks Signed-off-by: Kial Jinnah --- .../postman/legal-api.postman_collection.json | 2 +- .../tests/unit/services/test_authorization.py | 37 +++++++++++++++---- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/legal-api/tests/postman/legal-api.postman_collection.json b/legal-api/tests/postman/legal-api.postman_collection.json index 08c78b5b91..e0d5419fbe 100644 --- a/legal-api/tests/postman/legal-api.postman_collection.json +++ b/legal-api/tests/postman/legal-api.postman_collection.json @@ -18146,7 +18146,7 @@ "response": [] }, { - "name": "CHANGE", + "name": "change", "event": [ { "listen": "test", diff --git a/legal-api/tests/unit/services/test_authorization.py b/legal-api/tests/unit/services/test_authorization.py index fb3ecaa941..f2ac22e60b 100644 --- a/legal-api/tests/unit/services/test_authorization.py +++ b/legal-api/tests/unit/services/test_authorization.py @@ -240,7 +240,7 @@ class FilingKey(str, Enum): FilingKey.AMALGAMATION_VERTICAL: {'name': 'amalgamationApplication', 'type': 'vertical', 'displayName': 'Amalgamation Application Short-form (Vertical)', 'feeCode': 'AMALV'}, FilingKey.AMALGAMATION_HORIZONTAL: {'name': 'amalgamationApplication', 'type': 'horizontal', 'displayName': 'Amalgamation Application Short-form (Horizontal)', 'feeCode': 'AMALH'}, FilingKey.NOTICE_OF_WITHDRAWAL: {'displayName': 'Notice of Withdrawal', 'feeCode': 'NWITH', 'name': 'noticeOfWithdrawal'}, - FilingKey.TRANSPARENCY_REGISTER_ANNUAL: {'name': 'transparencyRegister', 'type': 'annual', 'displayName': 'Transparency Register - Annual Report', 'feeCode': 'REGSIGIN'}, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL: {'name': 'transparencyRegister', 'type': 'annual', 'displayName': 'Transparency Register - Annual Filing', 'feeCode': 'REGSIGIN'}, FilingKey.TRANSPARENCY_REGISTER_CHANGE: {'name': 'transparencyRegister', 'type': 'change', 'displayName': 'Transparency Register Filing', 'feeCode': 'REGSIGIN'}, FilingKey.TRANSPARENCY_REGISTER_INITIAL: {'name': 'transparencyRegister', 'type': 'initial', 'displayName': 'Transparency Register Filing', 'feeCode': 'REGSIGIN'}, } @@ -1436,9 +1436,15 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me # active business - general user ('general_user_cp', True, Business.State.ACTIVE, ['CP'], 'general', [BASIC_USER], []), ('general_user_corps', True, Business.State.ACTIVE, ['BC', 'BEN', 'CC', 'ULC'], 'general', [BASIC_USER], - expected_lookup([FilingKey.TRANSITION])), + expected_lookup([FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_continue_in_corps', True, Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], - expected_lookup([FilingKey.TRANSITION])), + expected_lookup([FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_llc', True, Business.State.ACTIVE, ['LLC'], 'general', [BASIC_USER], []), ('general_user_firms', True, Business.State.ACTIVE, ['SP', 'GP'], 'general', [BASIC_USER], []), @@ -1748,10 +1754,16 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me # active business - general user ('general_user_cp', Business.State.ACTIVE, ['CP'], 'general', [BASIC_USER], BLOCKER_FILING_STATUSES, []), ('general_user_corps', Business.State.ACTIVE, ['BC', 'BEN', 'CC', 'ULC'], 'general', [BASIC_USER], - BLOCKER_FILING_STATUSES, expected_lookup([FilingKey.TRANSITION, ])), + BLOCKER_FILING_STATUSES, expected_lookup([FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_continue_in_corps', Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], BLOCKER_FILING_STATUSES, - expected_lookup_continue_in_corps([FilingKey.TRANSITION, ])), + expected_lookup_continue_in_corps([FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_llc', Business.State.ACTIVE, ['LLC'], 'general', [BASIC_USER], BLOCKER_FILING_STATUSES, []), ('general_user_firms', Business.State.ACTIVE, ['SP', 'GP'], 'general', [BASIC_USER], BLOCKER_FILING_STATUSES, []), @@ -1868,7 +1880,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me BLOCKER_FILING_TYPES, BLOCKER_FILING_STATUSES_AND_ADDITIONAL, []), ('general_user_corps', Business.State.ACTIVE, ['BC', 'BEN', 'CC', 'ULC'], 'general', [BASIC_USER], BLOCKER_FILING_TYPES, BLOCKER_FILING_STATUSES_AND_ADDITIONAL, - expected_lookup([FilingKey.TRANSITION])), + expected_lookup([FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_continu_in_corps', Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], BLOCKER_FILING_TYPES, BLOCKER_FILING_STATUSES_AND_ADDITIONAL, expected_lookup_continue_in_corps([FilingKey.TRANSITION, @@ -2401,7 +2416,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.COD_CORPS, FilingKey.CONSENT_CONTINUATION_OUT, FilingKey.VOL_DISS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_llc_unaffected', Business.State.ACTIVE, ['LLC'], 'general', [BASIC_USER], ['restoration', 'restoration', None, 'restoration'], ['limitedRestoration', 'limitedRestorationExtension', None, 'fullRestoration'], []), @@ -2906,7 +2924,10 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me expected_lookup([FilingKey.AR_CORPS, FilingKey.COA_CORPS, FilingKey.COD_CORPS, - FilingKey.TRANSITION])), + FilingKey.TRANSITION, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL, + FilingKey.TRANSPARENCY_REGISTER_CHANGE, + FilingKey.TRANSPARENCY_REGISTER_INITIAL])), ('general_user_llc', Business.State.ACTIVE, ['LLC'], 'general', [BASIC_USER], None, []), ('general_user_firms', Business.State.ACTIVE, ['SP', 'GP'], 'general', [BASIC_USER], None, expected_lookup([FilingKey.CHANGE_OF_REGISTRATION, From ac3e1af42c497083c3c9f58ce178745e98c21b3d Mon Sep 17 00:00:00 2001 From: Kial Jinnah Date: Fri, 7 Feb 2025 17:36:40 -0500 Subject: [PATCH 6/8] Test tweaks Signed-off-by: Kial Jinnah --- .../tests/unit/services/test_authorization.py | 26 +++++-------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/legal-api/tests/unit/services/test_authorization.py b/legal-api/tests/unit/services/test_authorization.py index f2ac22e60b..71b9c3e229 100644 --- a/legal-api/tests/unit/services/test_authorization.py +++ b/legal-api/tests/unit/services/test_authorization.py @@ -324,7 +324,7 @@ class FilingKey(str, Enum): 'feeCode': None}, FilingKey.NOTICE_OF_WITHDRAWAL: {'displayName': 'Notice of Withdrawal', 'feeCode': 'NWITH', 'name': 'noticeOfWithdrawal'}, - FilingKey.TRANSPARENCY_REGISTER_ANNUAL: {'name': 'transparencyRegister', 'type': 'annual', 'displayName': 'Transparency Register - Annual Report', 'feeCode': 'REGSIGIN'}, + FilingKey.TRANSPARENCY_REGISTER_ANNUAL: {'name': 'transparencyRegister', 'type': 'annual', 'displayName': 'Transparency Register - Annual Filing', 'feeCode': 'REGSIGIN'}, FilingKey.TRANSPARENCY_REGISTER_CHANGE: {'name': 'transparencyRegister', 'type': 'change', 'displayName': 'Transparency Register Filing', 'feeCode': 'REGSIGIN'}, FilingKey.TRANSPARENCY_REGISTER_INITIAL: {'name': 'transparencyRegister', 'type': 'initial', 'displayName': 'Transparency Register Filing', 'feeCode': 'REGSIGIN'}, } @@ -580,11 +580,11 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me ('user_active_corps', Business.State.ACTIVE, ['BC', 'BEN', 'CC', 'ULC'], 'general', [BASIC_USER], ['agmExtension', 'agmLocationChange', 'alteration', {'amalgamationApplication': ['regular', 'vertical', 'horizontal']}, 'annualReport', 'changeOfAddress', 'changeOfDirectors', 'consentContinuationOut', - {'dissolution': ['voluntary']}, 'incorporationApplication', 'transition']), + {'dissolution': ['voluntary']}, 'incorporationApplication', 'transition', {'transparencyRegister': ['annual','change','initial']}]), ('user_active_continue_in_corps', Business.State.ACTIVE, ['C', 'CBEN', 'CUL', 'CCC'], 'general', [BASIC_USER], ['agmExtension', 'agmLocationChange', 'alteration', {'amalgamationApplication': ['regular', 'vertical', 'horizontal']}, 'annualReport', 'changeOfAddress', 'changeOfDirectors', 'consentContinuationOut', 'continuationIn', - {'dissolution': ['voluntary']}, 'transition']), + {'dissolution': ['voluntary']}, 'transition', {'transparencyRegister': ['annual','change','initial']}]), ('user_active_llc', Business.State.ACTIVE, ['LLC'], 'general', [BASIC_USER], []), ('user_active_firms', Business.State.ACTIVE, ['SP', 'GP'], 'general', [BASIC_USER], ['changeOfRegistration', {'dissolution': ['voluntary']}, 'registration']), @@ -1436,15 +1436,9 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me # active business - general user ('general_user_cp', True, Business.State.ACTIVE, ['CP'], 'general', [BASIC_USER], []), ('general_user_corps', True, Business.State.ACTIVE, ['BC', 'BEN', 'CC', 'ULC'], 'general', [BASIC_USER], - expected_lookup([FilingKey.TRANSITION, - FilingKey.TRANSPARENCY_REGISTER_ANNUAL, - FilingKey.TRANSPARENCY_REGISTER_CHANGE, - FilingKey.TRANSPARENCY_REGISTER_INITIAL])), + expected_lookup([FilingKey.TRANSITION])), ('general_user_continue_in_corps', True, Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'general', [BASIC_USER], - expected_lookup([FilingKey.TRANSITION, - FilingKey.TRANSPARENCY_REGISTER_ANNUAL, - FilingKey.TRANSPARENCY_REGISTER_CHANGE, - FilingKey.TRANSPARENCY_REGISTER_INITIAL])), + expected_lookup([FilingKey.TRANSITION])), ('general_user_llc', True, Business.State.ACTIVE, ['LLC'], 'general', [BASIC_USER], []), ('general_user_firms', True, Business.State.ACTIVE, ['SP', 'GP'], 'general', [BASIC_USER], []), @@ -1982,10 +1976,7 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.PUT_BACK_OFF, FilingKey.REGISTRARS_NOTATION, FilingKey.REGISTRARS_ORDER, - FilingKey.TRANSITION, - FilingKey.TRANSPARENCY_REGISTER_ANNUAL, - FilingKey.TRANSPARENCY_REGISTER_CHANGE, - FilingKey.TRANSPARENCY_REGISTER_INITIAL])), + FilingKey.TRANSITION])), ('staff_active_continue_in_corps', Business.State.ACTIVE, ['C', 'CBEN', 'CCC', 'CUL'], 'staff', [STAFF_ROLE], ['dissolution.voluntary', 'dissolution.administrative'], BLOCKER_DISSOLUTION_STATUSES_FOR_AMALG, True, expected_lookup([FilingKey.ADMN_FRZE, @@ -1993,10 +1984,7 @@ def mock_auth(one, two): # pylint: disable=unused-argument; mocks of library me FilingKey.PUT_BACK_OFF, FilingKey.REGISTRARS_NOTATION, FilingKey.REGISTRARS_ORDER, - FilingKey.TRANSITION, - FilingKey.TRANSPARENCY_REGISTER_ANNUAL, - FilingKey.TRANSPARENCY_REGISTER_CHANGE, - FilingKey.TRANSPARENCY_REGISTER_INITIAL])), + FilingKey.TRANSITION])), # active business - general user ('general_user_corps', Business.State.ACTIVE, ['BC', 'BEN', 'CC', 'ULC'], 'general', [BASIC_USER], From 673bf6a4f7fcdc01ad94b89e1c1bd2a7d80f6e11 Mon Sep 17 00:00:00 2001 From: Kial Jinnah Date: Fri, 7 Feb 2025 17:48:22 -0500 Subject: [PATCH 7/8] test tweak - load_ledger Signed-off-by: Kial Jinnah --- legal-api/tests/unit/core/test_filing_ledger.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/legal-api/tests/unit/core/test_filing_ledger.py b/legal-api/tests/unit/core/test_filing_ledger.py index dd01f67033..c8fefa5b8c 100644 --- a/legal-api/tests/unit/core/test_filing_ledger.py +++ b/legal-api/tests/unit/core/test_filing_ledger.py @@ -42,6 +42,11 @@ def load_ledger(business, founding_date): elif filing_meta['name'] == 'amalgamationApplication': filing['filing']['amalgamationApplication'] = {} filing['filing']['amalgamationApplication']['type'] = 'regular' + elif filing_meta['name'] == 'transparencyRegister': + filing['filing']['transparencyRegister'] = { + 'type': 'initial', + 'ledgerReferenceNumber': '123ewd2' + } f = factory_completed_filing(business, filing, filing_date=founding_date + datedelta.datedelta(months=i)) for c in range(i): comment = Comment() From b11a0c2b52b6174dbcead4438e8c0f6ec7158d33 Mon Sep 17 00:00:00 2001 From: Kial Jinnah Date: Mon, 10 Feb 2025 09:40:15 -0500 Subject: [PATCH 8/8] Update reqs schema version Signed-off-by: Kial Jinnah --- legal-api/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/legal-api/requirements.txt b/legal-api/requirements.txt index 7c1a3e152d..3760bb7eac 100755 --- a/legal-api/requirements.txt +++ b/legal-api/requirements.txt @@ -59,5 +59,5 @@ PyPDF2==1.26.0 reportlab==3.6.12 html-sanitizer==2.4.1 lxml==5.2.2 -git+https://github.com/bcgov/business-schemas.git@2.18.33#egg=registry_schemas +git+https://github.com/bcgov/business-schemas.git@2.18.34#egg=registry_schemas git+https://github.com/bcgov/lear.git#egg=sql-versioning&subdirectory=python/common/sql-versioning