-
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
20360 Update reg and change of reg outputs with alt name #2538
20360 Update reg and change of reg outputs with alt name #2538
Conversation
You'll need to rebase against legal name branch as bunch of new changes have been merged. |
…into 20360_update_reg_and_change_of_reg_outputs_with_alt_name
so I had already asked above but never got my comment addressed. I need the following from you:
|
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.
From what I can see, LGTM as long as Argus' comments get resolved 👍
…into 20360_update_reg_and_change_of_reg_outputs_with_alt_name
@@ -903,6 +901,8 @@ def _format_change_of_registration_data( | |||
prev_party_json = VersionedBusinessDetailsService.party_revision_json( | |||
prev_completed_filing, prev_party, True | |||
) | |||
# current_party type is person, but prev_party type is organization | |||
# so has issue at _has_party_name_change() | |||
if self._has_party_name_change(prev_party_json, party): |
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.
FM1064603
, filing_id: 148571
:
In this case, prev_party is organization. current_party is person.
So _has_party_name_change
function returns the error. We should fix this logic
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.
We can fix this in another ticket. We need to think about this more when we get back to this work.
I'll create a new ticket.
Can you find a business to test with that doesn't have party type changing?
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 trying to find it
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.
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.
Okay, if business.legal_entity_id is null and colin_entity_id is True, then we should pull back the Colin_entity history?
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.
yes, but i'm not entirely sure if that will work as is. you may need to do some work to get it working. maybe put a todo and ignore that scenario for now. just say we need to still take care of that scenario in the future.
addresses_result = addresses_current.union(addresses_historical).all() | ||
for address_result in addresses_result: | ||
address, _ = address_result | ||
addresses = addresses_current.union(addresses_historical).all() |
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.
FM1000406
, filing_id: 146925
In this case, business_id is 691 ( alternate_name_id )
But, there are no records for this business in Address and Address_history table ( my local DB )
So, it returns None
, and makes the error
) | ||
|
||
party_version = history_cls(LegalEntity) | ||
columns_to_select = VersionedBusinessDetailsService.select_revision_columns(party_version) |
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'm not sure if you are selecting the right columns for the party in all cases. For example, it looks like if it's a SP person, SP DBA LEAR or SP DBA COLIN, you are selecting the alternate name columns. I think you should be selecting the columns for the LE or AN record.
…into 20360_update_reg_and_change_of_reg_outputs_with_alt_name
Quality Gate passedIssues Measures |
@@ -572,7 +572,7 @@ def party_role_revision_json(filing, party_role_revision, is_ia_or_after) -> dic | |||
def get_party_revision(filing, party_id) -> dict: | |||
"""Consolidates all party changes up to the given transaction id.""" | |||
business = BusinessService.fetch_business_by_filing(filing) | |||
if filing.legal_entity_id: | |||
if filing.legal_entity_id or business.legal_entity_id: |
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'm not sure about this change and how you are grabbing party revision data in general for all the various scenarios.
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.
FM1064603, filing_id: 148571.
In this case, the filing doesn't have the legal_entity. it has the alternate_name_entity.
And alternate_name_entity has the legal_entity.
I think you mentioned that filing pull back the legal_entity in this case
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.
Yes, I mentioned that. But I think the logic needs to be more precise. Anyways, we can pick this up in the new ticket.
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.
Approving. As per our conversation, outstanding issues that still need to be addressed will be picked up in #20903
Issue #: /bcgov/entity#20360
Description of changes:
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).