Skip to content

Commit

Permalink
Merge pull request #2979 from stevenc987/main
Browse files Browse the repository at this point in the history
Admin Freeze check in colin#245
  • Loading branch information
stevenc987 authored Sep 11, 2024
2 parents c5d51d5 + bb20033 commit e1e84ff
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions colin-api/src/colin_api/models/business.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class CorpStateTypes(Enum):
last_ar_date = None
last_ledger_timestamp = None
status = None
admin_freeze = None

def __init__(self):
"""Initialize with all values None."""
Expand All @@ -122,7 +123,8 @@ def as_dict(self) -> Dict:
'lastLedgerTimestamp': self.last_ledger_timestamp,
'legalName': self.corp_name,
'legalType': self.corp_type,
'status': self.status
'status': self.status,
'adminFreeze': self.admin_freeze
}
}

Expand All @@ -141,7 +143,8 @@ def as_slim_dict(self) -> Dict:
'homeCompanyName': self.home_company_nme,
'legalName': self.corp_name,
'legalType': self.corp_type,
'status': self.status
'status': self.status,
'adminFreeze': self.admin_freeze
}
}

Expand Down Expand Up @@ -251,7 +254,11 @@ def find_by_identifier(cls, # pylint: disable=too-many-statements
cursor = con.cursor()
cursor.execute(
f"""
select corp.corp_num, corp.corp_typ_cd, recognition_dts, bn_15, can_jur_typ_cd, othr_juris_desc,
select corp.corp_num, corp.corp_typ_cd,
CASE WHEN corp.corp_frozen_typ_cd is null THEN 'False'
ELSE 'True'
END AS admin_freeze,
recognition_dts, bn_15, can_jur_typ_cd, othr_juris_desc,
home_recogn_dt, home_juris_num, home_company_nme,
filing.period_end_dt, last_agm_date, corp_op_state.full_desc as state, admin_email,
corp_state.state_typ_cd as corp_state, corp_op_state.op_state_typ_cd as corp_state_class,
Expand Down Expand Up @@ -327,6 +334,7 @@ def find_by_identifier(cls, # pylint: disable=too-many-statements
else convert_to_json_date(business['last_agm_date'])
business_obj.last_ledger_timestamp = convert_to_json_datetime(business['last_ledger_timestamp'])
business_obj.status = business['state']
business_obj.admin_freeze = business['admin_freeze']

return business_obj

Expand Down

0 comments on commit e1e84ff

Please sign in to comment.