-
Notifications
You must be signed in to change notification settings - Fork 70
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
20996 Fix MBR after legal name easy fix #2777
20996 Fix MBR after legal name easy fix #2777
Conversation
06cd530
to
2e73f4f
Compare
export interface AffiliationResponse { | ||
identifier?: string | ||
draftType?: CorpTypes | ||
legalType?: CorpTypes | ||
businessNumber?: string | ||
name?: string | ||
legalName?: string | ||
alternateNames?: AlternateNames[] | ||
alternateNames?: AlternateNameIF[] |
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.
Using the latest/updated interface from the shared components repo now.
@@ -104,7 +97,6 @@ export interface NameRequestResponse { | |||
natureOfBusiness?: string | |||
expirationDate?: Date | |||
nrNum?: string | |||
requestActionCd?: string |
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.
This is a duplicate of line 96 so I removed it.
auth-web/src/stores/business.ts
Outdated
@@ -209,6 +209,21 @@ export const useBusinessStore = defineStore('business', () => { | |||
const entityResponse: AffiliationResponse[] = await OrgService.getAffiliatedEntities(currentOrganization.value.id) | |||
let affiliatedEntities: Business[] = [] | |||
|
|||
// do a lear search on firms to fetch the latest names (alternate names array) | |||
// set that array to firm entries in the entityResponse array | |||
for (const response of entityResponse) { |
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.
Basically, for firms, we need to do a LEAR search to grab that alternateNames array that we need. It's needed to properly display the latest correct name.
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.
This should be done in the API not on the frontend as a loop?
Or done in one API call not multiple?
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.
Yeah, was thinking that as well. I'll be doing that.
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.
Yeah I remember we spent quite a bit of time getting rid of having to call Namex and Legal-api on a per business basis.. it caused alot of performance issues when loading up a dashboard with lets say 100 businesses
Merging this PR would be going in the reverse direction
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.
As discussed, this https://github.com/bcgov/lear/blob/ce180c3abb996eefd5886def72ddc29620007925/legal-api/src/legal_api/models/business.py#L627
should populate the /search
call
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.
Sounds good, on 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.
@@ -407,7 +422,7 @@ export const useBusinessStore = defineStore('business', () => { | |||
return BusinessService.createBNRequest(request) | |||
} | |||
|
|||
async function searchNRIndex (identifier: string): number { | |||
async function searchNRIndex (identifier: string): Promise<number> { |
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.
The return type of async must be a Promise.
/gcbrun |
Temporary Url for review: https://bcregistry-account-dev--pr-2777-b68st5kz.web.app |
auth-web/package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "auth-web", | |||
"version": "2.5.22", | |||
"version": "2.5.23", |
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.
2.6.0 ?
auth-web/src/models/business.ts
Outdated
@@ -146,6 +147,6 @@ export interface LearBusiness { | |||
identifier: string | |||
legalName: string | |||
legalType: string | |||
alternateNames: AlternateNames[] | |||
alternateNames: AlternateNameIF[] |
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.
So this properties (array) is required here but optional in AffiliationResponse interface?
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 have some concerns in the comments
988a48b
to
7b3febd
Compare
7b3febd
to
685234f
Compare
|
/gcbrun |
Temporary Url for review: https://bcregistry-account-dev--pr-2777-b68st5kz.web.app |
Issue #:
bcgov/entity#20996
Description of changes:
Before:
![before firms](https://private-user-images.githubusercontent.com/122301442/326610329-8610f8e5-4df1-4edb-9dac-9b1c8ed4d147.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjE0MDcsIm5iZiI6MTczOTMyMTEwNywicGF0aCI6Ii8xMjIzMDE0NDIvMzI2NjEwMzI5LTg2MTBmOGU1LTRkZjEtNGVkYi05ZGFjLTliMWM4ZWQ0ZDE0Ny5QTkc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMlQwMDQ1MDdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1hMTQ3OTY1MWRhNjgxMjg4ZWQ1OTA2Y2NkMWI1OWM5ZjU1MGM0OTkxNTJmNjk2MzJmZjQ0MWI5YWNjZDI2NmNiJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.X9bV4S3l6UXdB3B1_GgXvdXW6PTvZnyZ023RI6pKwo8)
After:
![after firms](https://private-user-images.githubusercontent.com/122301442/326610341-b5daefa5-75e2-4ff8-8c27-0f7e1d8aeddf.PNG?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkzMjE0MDcsIm5iZiI6MTczOTMyMTEwNywicGF0aCI6Ii8xMjIzMDE0NDIvMzI2NjEwMzQxLWI1ZGFlZmE1LTc1ZTItNGZmOC04YzI3LTBmN2UxZDhhZWRkZi5QTkc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEyJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMlQwMDQ1MDdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iOTI0OTUzODBjNzA2YmNjODMyZDIyODRmMjE0YWJkNGE0YjA5NmI4MWU2OTJjNDAyYThhOTg3MGYzZGU4MDEwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.lv0d8_lYcAucf95HM9v19wuZAJDgSiqOZxAy7hyMAWQ)
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the sbc-auth license (Apache 2.0).