Skip to content

Commit

Permalink
21756 agmExtension filing sync (#2993)
Browse files Browse the repository at this point in the history
  • Loading branch information
vysakh-menon-aot authored Sep 20, 2024
1 parent e597859 commit c959ce2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
23 changes: 20 additions & 3 deletions colin-api/src/colin_api/models/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,17 @@ class FilingSource(Enum):
LEAR = 'LEAR'

FILING_TYPES = {
'agmExtension': {
'type_code_list': ['AGMDT'],
Business.TypeCodes.BCOMP.value: 'AGMDT',
Business.TypeCodes.BC_COMP.value: 'AGMDT',
Business.TypeCodes.ULC_COMP.value: 'AGMDT',
Business.TypeCodes.CCC_COMP.value: 'AGMDT',
Business.TypeCodes.BCOMP_CONTINUE_IN.value: 'AGMDT',
Business.TypeCodes.CONTINUE_IN.value: 'AGMDT',
Business.TypeCodes.ULC_CONTINUE_IN.value: 'AGMDT',
Business.TypeCodes.CCC_CONTINUE_IN.value: 'AGMDT',
},
'agmLocationChange': {
'type_code_list': ['AGMLC'],
Business.TypeCodes.BCOMP.value: 'AGMLC',
Expand Down Expand Up @@ -553,7 +564,7 @@ def _insert_filing(cls, cursor, filing, ar_date: str, agm_date: str): # pylint:
'NOABE', 'NOALE', 'NOALR', 'NOALD',
'NOALA', 'NOALB', 'NOALU', 'NOALC',
'CONTO', 'COUTI',
'AGMLC',
'AGMDT', 'AGMLC',
'REGSN', 'REGSO', 'COURT']:
arrangement_ind = 'N'
court_order_num = None
Expand Down Expand Up @@ -1131,8 +1142,8 @@ def add_involuntary_dissolution_event(cls, con, corp_num, filing_dt, filing_body
def add_filing(cls, con, filing: Filing) -> int:
"""Add new filing to COLIN tables."""
try:
if filing.filing_type not in ['agmLocationChange', 'alteration', 'amalgamationApplication',
'annualReport', 'changeOfAddress',
if filing.filing_type not in ['agmExtension', 'agmLocationChange', 'alteration',
'amalgamationApplication', 'annualReport', 'changeOfAddress',
'changeOfDirectors', 'consentContinuationOut', 'continuationIn',
'continuationOut', 'correction', 'courtOrder',
'dissolution', 'incorporationApplication', 'registrarsNotation',
Expand Down Expand Up @@ -1237,6 +1248,12 @@ def add_filing(cls, con, filing: Filing) -> int:
agm_location = filing.body.get('agmLocation')
agm_location_text = f'OKAY TO HOLD {year} AGM IN {agm_location}.'
cls._insert_ledger_text(cursor, filing, agm_location_text)
elif filing.filing_type == 'agmExtension':
year = filing.body.get('year')
agm_ext_dt = filing.body.get('expireDateApprovedExt')
agm_ext_str = datetime.datetime.fromisoformat(agm_ext_dt).strftime('%B %-d, %Y')
agm_extension_text = f'The {year} AGM must be held by {agm_ext_str} at 11:59 pm Pacific time.'
cls._insert_ledger_text(cursor, filing, agm_extension_text)

# process voluntary dissolution
if Filing.is_filing_type_match(filing, 'dissolution', 'voluntary'):
Expand Down
3 changes: 2 additions & 1 deletion colin-api/src/colin_api/resources/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,11 @@ def post(legal_type, identifier, **kwargs):
filing_list = {'correction': json_data['correction']}
else:
filing_list = {
'agmExtension': json_data.get('agmExtension', None),
'agmLocationChange': json_data.get('agmLocationChange', None),
'alteration': json_data.get('alteration', None),
'amalgamationApplication': json_data.get('amalgamationApplication', None),
'annualReport': json_data.get('annualReport', None),
'agmLocationChange': json_data.get('agmLocationChange', None),
'changeOfAddress': json_data.get('changeOfAddress', None),
'changeOfDirectors': json_data.get('changeOfDirectors', None),
'consentContinuationOut': json_data.get('consentContinuationOut', None),
Expand Down

0 comments on commit c959ce2

Please sign in to comment.