-
Notifications
You must be signed in to change notification settings - Fork 75
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
fix: corrected get last ar filed date method #3001
fix: corrected get last ar filed date method #3001
Conversation
491b882
to
416efbc
Compare
@EPortman If its ready you can change this from Draft to Ready for review and assign yourself as Assignees |
@vysakh-menon-aot I was getting an error when calling So just had to control for that. |
I also do not have the option to assign myself as the assignee. I think a permission issue? |
0eacd53
to
4547d95
Compare
Quality Gate passedIssues Measures |
# If the founding date has `-00:00`, replace it with `+00:00` before passing to the function | ||
if '-00:00' in founding_date_str: | ||
founding_date_str = founding_date_str.replace('-00:00', '+00:00') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not really sure about this. Approving it since this function is used only for Business AR sync
Issue #: https://app.zenhub.com/workspaces/names-team-board-new-655554cbddd49510027dad2e/issues/gh/bcgov/business-ar/318
Description of changes:
When a Business AR filing is received from the new system, the corporation is looked up using
find_by_identifier
, which creates a founding_date based on therecognition_date
(converted from Pacific Time to UTC).https://github.com/bcgov/lear/blob/main/colin-api/src/colin_api/models/business.py#L327
When
_get_last_ar_filed_date
is called, it uses this founding_date by extracting the month and day. The issue was that the founding_date was not being converted back to Pacific Time. As a result, filings for businesses with arecognition_date
after 5 PM local time were always showing alast_ar_filed_date
one day ahead.This PR fixes this by converting the
founding_date
back to pacific time before creating thelast_ar_filed_date
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the lear license (Apache 2.0).