Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into issue-cred-v20
Browse files Browse the repository at this point in the history
  • Loading branch information
ianco committed Sep 12, 2024
2 parents 1023903 + 3a47c7c commit 809d72b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 877 deletions.
21 changes: 11 additions & 10 deletions data-pipeline/bcreg/bcregistries.py
Original file line number Diff line number Diff line change
Expand Up @@ -487,20 +487,21 @@ def get_unprocessed_corps(self, last_event_id, last_event_dt):
LOGGER.info("Loaded corps: " + str(len(corps)))

# since a related corp may be impacted by a corp change, check for related corps via corp_party table
sql1 = """select corp_num from """ + self.DB_TABLE_PREFIX + """corp_party
where bus_company_num = %s
and party_typ_cd = 'FBO'
union
select bus_company_num from bc_registries.corp_party
where corp_num = %s
and party_typ_cd = 'FBO'"""
sql1 = """SELECT businesses.identifier corp_num
FROM businesses businesses,
parties_version parties,
party_roles_version roles
WHERE businesses.id = roles.business_id
AND roles.party_id = parties.id
AND parties.party_type = 'organization' and roles.role in ('proprietor')
AND (parties.identifier = %s)"""
new_corps = []
for corp in corps:
cur = None
try:
#LOGGER.info("Executing: " + sql1 + " with" + str(corp['CORP_NUM']))
cur = self.conn.cursor()
cur.execute(sql1, (corp['CORP_NUM'],corp['CORP_NUM'],))
cur = self.sec_conn.cursor()
corp_num = self.bc_ifiy_one(corp['CORP_NUM'])
cur.execute(sql1, (corp_num,))
row = cur.fetchone()
while row is not None and row[0] is not None:
if not row[0] in corp_set:
Expand Down
2 changes: 1 addition & 1 deletion data-pipeline/bcreg/eventprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ def build_corp_reason_code(self, loop_start_event):

# determine reason for address credential - returns reason code only
def build_lear_corp_reason_code(self, event):
filing = event['transaction']['filing']
filing = event['transaction'].get('filing')
corp_reason = filing['filing_type'] if (filing and 'filing_type' in filing) else ''
return corp_reason

Expand Down
Loading

0 comments on commit 809d72b

Please sign in to comment.