Skip to content

Commit

Permalink
refactor: last_ar_filed_date generation uses convert time method
Browse files Browse the repository at this point in the history
  • Loading branch information
EPortman committed Sep 25, 2024
1 parent bfc9719 commit 491b882
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions colin-api/src/colin_api/models/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
ShareObject, # noqa: I001
) # noqa: I001
from colin_api.resources.db import DB
from colin_api.utils import convert_to_json_date, convert_to_json_datetime, convert_to_snake
from colin_api.utils import convert_to_json_date, convert_to_json_datetime, convert_to_snake, convert_to_pacific_time


# Code smells:
Expand Down Expand Up @@ -1298,12 +1298,9 @@ def add_filing(cls, con, filing: Filing) -> int:
@classmethod
def _get_last_ar_filed_date(cls, header: dict, business: dict):
filing_year = header.get('filingYear')
pacific_founding_date = (
pacific_founding_date = convert_to_pacific_time(
datetime.datetime.fromisoformat(business['business']['foundingDate'])
.astimezone(pytz.timezone('America/Los_Angeles'))
.date()
)

).date()
last_ar_filed_dt = f'{filing_year}-{pacific_founding_date.month}-{pacific_founding_date.day}'
return last_ar_filed_dt

Expand Down

0 comments on commit 491b882

Please sign in to comment.