Skip to content

Commit

Permalink
22714 freeze BEN entity and map correct filing type for all amalgamat…
Browse files Browse the repository at this point in the history
…ion application (#2901)
  • Loading branch information
vysakh-menon-aot authored Aug 9, 2024
1 parent 220ebb8 commit 17e5572
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions colin-api/src/colin_api/models/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,27 +113,30 @@ class FilingSource(Enum):
'amalgamationApplication': {
'sub_type_property': 'type',
'sub_type_list': ['regular', 'horizontal', 'vertical'],
'type_code_list': ['OTAMA', 'AMALR', 'AMLRU', 'AMALH', 'AMLHU', 'AMALV', 'AMLVU'],
'type_code_list': ['OTAMA',
'AMLRB', 'AMALR', 'AMLRU', 'AMLRC',
'AMLHB', 'AMALH', 'AMLHU', 'AMLHC',
'AMLVB', 'AMALV', 'AMLVU', 'AMLVC'],
'regular': {
Business.TypeCodes.COOP.value: 'OTAMA',
Business.TypeCodes.BCOMP.value: 'AMALR',
Business.TypeCodes.BCOMP.value: 'AMLRB',
Business.TypeCodes.BC_COMP.value: 'AMALR',
Business.TypeCodes.ULC_COMP.value: 'AMLRU',
Business.TypeCodes.CCC_COMP.value: 'AMALR'
Business.TypeCodes.CCC_COMP.value: 'AMLRC'
},
'horizontal': {
Business.TypeCodes.COOP.value: 'OTAMA',
Business.TypeCodes.BCOMP.value: 'AMALH',
Business.TypeCodes.BCOMP.value: 'AMLHB',
Business.TypeCodes.BC_COMP.value: 'AMALH',
Business.TypeCodes.ULC_COMP.value: 'AMLHU',
Business.TypeCodes.CCC_COMP.value: 'AMALH'
Business.TypeCodes.CCC_COMP.value: 'AMLHC'
},
'vertical': {
Business.TypeCodes.COOP.value: 'OTAMA',
Business.TypeCodes.BCOMP.value: 'AMALV',
Business.TypeCodes.BCOMP.value: 'AMLVB',
Business.TypeCodes.BC_COMP.value: 'AMALV',
Business.TypeCodes.ULC_COMP.value: 'AMLVU',
Business.TypeCodes.CCC_COMP.value: 'AMALV'
Business.TypeCodes.CCC_COMP.value: 'AMLVC'
}
},
'dissolved': {
Expand Down Expand Up @@ -449,7 +452,9 @@ def _insert_filing(cls, cursor, filing, ar_date: str, agm_date: str): # pylint:
)
elif filing_type_code in ['NOCAD', 'CRBIN', 'TRANS',
'BEINC', 'ICORP', 'ICORU', 'ICORC',
'AMALR', 'AMALH', 'AMALV',
'AMLRB', 'AMALR', 'AMLRU', 'AMLRC',
'AMLHB', 'AMALH', 'AMLHU', 'AMLHC',
'AMLVB', 'AMALV', 'AMLVU', 'AMLVC',
'NOALA', 'NOALB', 'NOALC', 'NOALE', 'NOALR', 'NOALU',
'REGSN', 'REGSO', 'COURT']:
arrangement_ind = 'N'
Expand Down Expand Up @@ -1098,10 +1103,10 @@ def add_filing(cls, con, filing: Filing) -> int:
cursor=cursor, corp_num=corp_num, date=agm_date, annual_report=is_annual_report,
last_ar_filed_dt=last_ar_filed_dt)

# Freeze entity for Alteration
if filing.filing_type == 'alteration' or (
filing.filing_type == 'incorporationApplication' and
business['business']['legalType'] == Business.TypeCodes.BCOMP.value):
# Freeze BEN entity
if (filing.filing_type == 'alteration' or
(filing.filing_type in ['incorporationApplication', 'amalgamationApplication'] and
business['business']['legalType'] == Business.TypeCodes.BCOMP.value)):
Business.update_corp_frozen_type(cursor, corp_num, Business.CorpFrozenTypes.COMPANY_FROZEN.value)

return filing.event_id
Expand Down

0 comments on commit 17e5572

Please sign in to comment.