Skip to content

Commit

Permalink
20996 Fix MBR after legal name easy fix (#2777)
Browse files Browse the repository at this point in the history
* Using the shared alternate name interface now

* fixed the my business registry business names

* fixed packages after rebase

* fixed lint issues

* 20420 - EFT Enabled Accounts Table (#2776)

* updated in response to Travis' and Sev's comments

---------

Co-authored-by: Odysseus Chiu <odysseus@highwaythreesolutions.com>
  • Loading branch information
JazzarKarim and ochiu authored May 2, 2024
1 parent 8a7975d commit 91e3190
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 19 deletions.
30 changes: 28 additions & 2 deletions auth-web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion auth-web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auth-web",
"version": "2.5.24",
"version": "2.6.0",
"appName": "Auth Web",
"sbcName": "SBC Common Components",
"private": true,
Expand Down
12 changes: 2 additions & 10 deletions auth-web/src/models/affiliation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Action, Applicant, Business, CorpType, Names } from '@/models/business'
import { AffiliationInvitationStatus, AffiliationInvitationType, CorpTypes, NrTargetTypes } from '@/util/constants'
import { NrRequestActionCodes, NrRequestTypeCodes } from '@bcrs-shared-components/enums'
import { OrgNameAndId, Organization } from '@/models/Organization'
import { AlternateNameIF } from '@bcrs-shared-components/interfaces'
import { Contact } from './contact'

export interface CreateRequestBody {
Expand Down Expand Up @@ -55,22 +56,14 @@ export interface AffiliationFilter {
actions?: string
}

export interface AlternateNames {
entityType?: string
identifier?: string
nameRegisteredDate?: string
nameStartDate?: string
operatingName?: string
}

export interface AffiliationResponse {
identifier?: string
draftType?: CorpTypes
legalType?: CorpTypes
businessNumber?: string
name?: string
legalName?: string
alternateNames?: AlternateNames[]
alternateNames?: AlternateNameIF[]
contacts?: Contact[]
corpType?: CorpType
corpSubType?: CorpType
Expand Down Expand Up @@ -104,7 +97,6 @@ export interface NameRequestResponse {
natureOfBusiness?: string
expirationDate?: Date
nrNum?: string
requestActionCd?: string
stateCd?: string
natureBusinessInfo?: string
applicants?: Array<Applicant>
Expand Down
5 changes: 3 additions & 2 deletions auth-web/src/models/business.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AffiliationInviteInfo, AlternateNames } from '@/models/affiliation'
import { AmalgamationTypes, FilingTypes, NrRequestActionCodes, NrRequestTypeCodes } from '@bcrs-shared-components/enums'
import { CorpTypes, LearFilingTypes, NrTargetTypes } from '@/util/constants'
import { AffiliationInviteInfo } from '@/models/affiliation'
import { AlternateNameIF } from '@bcrs-shared-components/interfaces'
import { Contact } from './contact'

export interface LoginPayload {
Expand Down Expand Up @@ -146,6 +147,6 @@ export interface LearBusiness {
identifier: string
legalName: string
legalType: string
alternateNames: AlternateNames[]
alternateNames?: AlternateNameIF[]
taxId?: string
}
9 changes: 5 additions & 4 deletions auth-web/src/stores/business.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from '@/util/constants'
import {
AffiliationResponse,
AlternateNames,
CreateRequestBody as CreateAffiliationRequestBody,
CreateNRAffiliationRequestBody,
NameRequestResponse
Expand All @@ -24,6 +23,7 @@ import { Business, BusinessRequest, CorpType, FolioNumberload, LearBusiness, Log
import { Organization, RemoveBusinessPayload } from '@/models/Organization'
import { computed, reactive, toRefs } from '@vue/composition-api'
import AffiliationInvitationService from '@/services/affiliation-invitation.services'
import { AlternateNameIF } from '@bcrs-shared-components/interfaces'
import BusinessService from '@/services/business.services'
import ConfigHelper from '@/util/config-helper'
import { Contact } from '@/models/contact'
Expand Down Expand Up @@ -53,14 +53,14 @@ export const useBusinessStore = defineStore('business', () => {
legalName: string,
legalType: CorpTypes,
identifier: string,
alternateNames: AlternateNames[]
alternateNames: AlternateNameIF[]
): string {
if (!LaunchDarklyService.getFlag(LDFlags.AlternateNamesMbr, false)) {
return legalName
}
if ([CorpTypes.SOLE_PROP, CorpTypes.PARTNERSHIP].includes(legalType)) {
// Intentionally show blank, if the alternate name is not found. This is to avoid showing the legal name.
return alternateNames?.find(alt => alt.identifier === identifier)?.operatingName
return alternateNames?.find(alt => alt.identifier === identifier)?.name
} else {
return legalName
}
Expand Down Expand Up @@ -209,6 +209,7 @@ export const useBusinessStore = defineStore('business', () => {
const entityResponse: AffiliationResponse[] = await OrgService.getAffiliatedEntities(currentOrganization.value.id)
let affiliatedEntities: Business[] = []

// push entities from the entityResponse array after properly building them to the store
entityResponse.forEach((resp) => {
const entity: Business = buildBusinessObject(resp)
if (resp.nameRequest) {
Expand Down Expand Up @@ -407,7 +408,7 @@ export const useBusinessStore = defineStore('business', () => {
return BusinessService.createBNRequest(request)
}

async function searchNRIndex (identifier: string): number {
async function searchNRIndex (identifier: string): Promise<number> {
return this.businesses.findIndex(business => business.nrNumber === identifier)
}

Expand Down

0 comments on commit 91e3190

Please sign in to comment.