Skip to content

Commit

Permalink
More thorough reset by event ids (bcgov#2812)
Browse files Browse the repository at this point in the history
* UNTESTED reset_filings_by_event

* tested the colin api reset for business ar (reset by event id)

* fix description of reset filings by event

* addressing feedback on the changes

* more thorough reset by event_ids
  • Loading branch information
BrandonSharratt authored Jul 5, 2024
1 parent 24c0256 commit 7a25832
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion colin-api/src/colin_api/models/reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,11 +267,16 @@ def reset_filings_by_event(cls, event_ids: list = []):
# The commented out events do not seem to happen for AR so they are commented out.
new_corps = cls._get_incorporations_by_event(cursor, event_ids)
Party.reset_dirs_by_events(cursor=cursor, event_ids=event_ids)
Office.reset_offices_by_events(cursor=cursor, event_ids=event_ids)
Business.reset_corp_states(cursor=cursor, event_ids=event_ids)
Business.reset_corporations(cursor=cursor, event_info=events_info, event_ids=event_ids)

ShareObject.delete_shares(cursor, event_ids)
cls._delete_filing_user(cursor=cursor, event_ids=event_ids)
cls._delete_ledger_text(cursor=cursor, event_ids=event_ids)
cls._delete_corp_name(cursor=cursor, event_ids=list(new_corps.values()))
cls._delete_corp_state(cursor=cursor, corp_nums=list(new_corps.keys()))
cls._delete_events_and_filings(cursor=cursor, event_ids=event_ids)
cls._delete_new_corps(cursor=cursor, corp_nums=list(new_corps.keys()))
con.commit()
return
except Exception as err:
Expand Down

0 comments on commit 7a25832

Please sign in to comment.