Skip to content

Commit

Permalink
21751 - add put back on sync (#3153)
Browse files Browse the repository at this point in the history
* 21751 - add put back on sync

* 21751 - fix linting issue

* 21751 - fix linting issue

* 21751 - update to the implementation
  • Loading branch information
ketaki-deodhar authored Dec 27, 2024
1 parent 80b86c3 commit a53571e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
32 changes: 30 additions & 2 deletions colin-api/src/colin_api/models/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,17 @@ class FilingSource(Enum):
'courtOrder': {
'type_code_list': ['COURT'],
Business.TypeCodes.BC_COMP.value: 'COURT'
},
'putBackOn': {
'type_code_list': ['CO_PO'],
Business.TypeCodes.BCOMP.value: 'CO_PO',
Business.TypeCodes.BC_COMP.value: 'CO_PO',
Business.TypeCodes.ULC_COMP.value: 'CO_PO',
Business.TypeCodes.CCC_COMP.value: 'CO_PO',
Business.TypeCodes.BCOMP_CONTINUE_IN.value: 'CO_PO',
Business.TypeCodes.CONTINUE_IN.value: 'CO_PO',
Business.TypeCodes.ULC_CONTINUE_IN.value: 'CO_PO',
Business.TypeCodes.CCC_CONTINUE_IN.value: 'CO_PO',
}
}

Expand Down Expand Up @@ -618,7 +629,7 @@ def _insert_filing(cls, cursor, filing, # pylint: disable=too-many-statements,
'CONTB', 'CONTI', 'CONTU', 'CONTC',
'NOABE', 'NOALE', 'NOALR', 'NOALD',
'NOALA', 'NOALB', 'NOALU', 'NOALC',
'CONTO', 'COUTI',
'CONTO', 'COUTI', 'CO_PO',
'AGMDT', 'AGMLC',
'RESTF', 'RESTL', 'RESXL', 'RESXF',
'REGSN', 'REGSO', 'COURT']:
Expand Down Expand Up @@ -1214,7 +1225,7 @@ def add_filing(cls, con, filing: Filing) -> int:
'amalgamationApplication', 'annualReport', 'changeOfAddress',
'changeOfDirectors', 'consentContinuationOut', 'continuationIn',
'continuationOut', 'courtOrder',
'dissolution', 'incorporationApplication', 'registrarsNotation',
'dissolution', 'incorporationApplication', 'putBackOn', 'registrarsNotation',
'registrarsOrder', 'restoration', 'specialResolution', 'transition']:
raise InvalidFilingTypeException(filing_type=filing.filing_type)

Expand Down Expand Up @@ -1252,6 +1263,8 @@ def add_filing(cls, con, filing: Filing) -> int:
cls._process_continuation_out(cursor, filing)
elif filing.filing_type == 'restoration':
cls._process_restoration(cursor, filing)
elif filing.filing_type == 'putBackOn':
cls._process_put_back_on(cursor, filing)
elif filing.filing_type == 'alteration':
# alter corp type
if (
Expand Down Expand Up @@ -1447,6 +1460,21 @@ def _process_restoration(cls, cursor, filing):
corp_state = Business.CorpStateTypes.LIMITED_RESTORATION.value
Business.update_corp_state(cursor, filing.event_id, corp_num, corp_state)

@classmethod
def _process_put_back_on(cls, cursor, filing):
"""Process Put Back On."""
corp_num = filing.get_corp_num()

Office.end_office(cursor=cursor,
event_id=filing.event_id,
corp_num=corp_num,
office_code=Office.OFFICE_TYPES_CODES['custodialOffice'])

Party.end_current(cursor, filing.event_id, corp_num, 'Custodian')

corp_state = Business.CorpStateTypes.ACTIVE.value # Active for Put Back On
Business.update_corp_state(cursor, filing.event_id, corp_num, corp_state)

@classmethod
def _process_continuation_out(cls, cursor, filing):
"""Process continuation out."""
Expand Down
1 change: 1 addition & 0 deletions colin-api/src/colin_api/resources/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def post(legal_type, identifier, **kwargs):
'courtOrder': json_data.get('courtOrder', None),
'dissolution': json_data.get('dissolution', None),
'incorporationApplication': json_data.get('incorporationApplication', None),
'putBackOn': json_data.get('putBackOn', None),
'registrarsNotation': json_data.get('registrarsNotation', None),
'registrarsOrder': json_data.get('registrarsOrder', None),
'restoration': json_data.get('restoration', None),
Expand Down

0 comments on commit a53571e

Please sign in to comment.