Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

21751 - add put back on sync #3153

Merged
merged 5 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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