bcgov / entity

ServiceBC Registry Team working on Legal Entities
Apache License 2.0
23 stars 59 forks source link

NameX: Restoration Name Request Wrong Legal Type Bug #24564

Open ArwenQin opened 4 days ago

ArwenQin commented 4 days ago

Create a Restoration Name Request for a C company example: https://dev.business.bcregistry.gov.bc.ca/C9900778 The NR 7906911 is created for C9900778, but in the restoration process, it shows:

image.png

This NR has legal Type BC, but it should be C. This may be a bug with names. Other Continued in type may have the same bug

Image

severinbeauvais commented 4 days ago

deleted obsolete comment

severinbeauvais commented 4 days ago

@ArwenQin Does a name change work correctly for this continued-in BC Limited Company? What does the NR for that look like?

ArwenQin commented 4 days ago

@severinbeauvais Name change doesn't work for continued-in BC either. Image

severinbeauvais commented 4 days ago

The bug is in Namex API.

Here's what Namerequest UI posts to Namex API. The entity_type_cd is correct (C in this case).

Image

Here's what Namex API responds with. The legalType is incorrect (BC in this case; should be C).

Image

severinbeauvais commented 4 days ago

@ArwenQin , thanks for the investigation. This bug ticket needs to be triaged and prioritized along with other Continuation In tickets.

ArwenQin commented 4 days ago

I just tested a change business type NR, the same bug exists: Image

severinbeauvais commented 3 days ago

Quick Analysis

Namex is incorrectly assigning the "legalType" property, eg, why is it assigning BC instead of C?

It might be related to this structure or how it's used. For example, if code looks for the first "RCR" then it will find a match for "BC" and not "C". https://github.com/bcgov/namex/blob/44c360c4c5728c510529c595b987473b95903632/api/namex/services/lookup/name_request_filing_actions.py#L48

Or it might be related to some other conversion or lookup from the "namex entity type" to the "lear entity type" (example: BC means Benefit Company in Namex but BC Limited Company in LEAR).

I also noticed that some enums are incomplete. For example, BCProtectedNameEntityTypes needs the addition of the 4 continued-in company types. (There may be other incomplete enums.) https://github.com/bcgov/namex/blob/44c360c4c5728c510529c595b987473b95903632/api/namex/constants/__init__.py#L161

severinbeauvais commented 21 hours ago

Directly link to PR: https://github.com/bcgov/namex/pull/1619