Skip to content
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

16634 mapped EntityType to CorpTypeCd + cleanup #622

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .browserslistrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
> 1%
last 2 versions
not ie <= 10
not dead
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as other UI repos.

5 changes: 3 additions & 2 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "name-request",
"version": "5.0.2",
"version": "5.0.3",
"private": true,
"appName": "Name Request UI",
"sbcName": "SBC Common Components",
Expand All @@ -14,6 +14,7 @@
},
"dependencies": {
"@babel/compat-data": "^7.12.13",
"@bcrs-shared-components/corp-type-module": "1.0.12",
"@bcrs-shared-components/enums": "1.0.40",
"@bcrs-shared-components/genesys-web-message": "1.0.0",
"@bcrs-shared-components/interfaces": "1.0.22",
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ import SbcFooter from 'sbc-common-components/src/components/SbcFooter.vue'

// Interfaces / Enums
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import NamexServices from './services/namex.services'
import NamexServices from './services/namex-services'
import { PAYMENT_REQUIRED } from 'http-status-codes'

@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ import AdvancedSearchDates from '@/components/advanced-search/advanced-search-da
import { FormType, NameRequestI } from '@/interfaces'
import { Action, Getter } from 'vuex-class'
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'

@Component({
components: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/applicant-info-1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ import { ActionBindingIF } from '@/interfaces/store-interfaces'
import { EmptyApplicant, NameRequestI } from '@/interfaces'
import { removeExcessSpaces } from '@/plugins/utilities'
import { CanJurisdictions, IntlJurisdictions } from '@/list-data'
import AuthServices from '@/services/auth.services'
import AuthServices from '@/services/auth-services'

@Component({
components: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/advanced-search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@

<script lang='ts'>
import { Component, Emit, Prop, Watch, Vue } from 'vue-property-decorator'
import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'
import { Getter } from 'vuex-class'
import { AdvancedSearchForm, AdvancedSearchRetrieve, AdvancedSearchTable } from '@/components/advanced-search'

Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/cancel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { Sleep } from '@/plugins'
import { NrAction } from '@/enums'
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import { CANCEL_MODAL_IS_VISIBLE } from '@/modules/payment/store/types'
import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'

@Component({})
export default class CancelDialog extends Mixins(PaymentMixin) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/payment-complete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import { CommonMixin, PaymentMixin, PaymentSessionMixin } from '@/mixins'
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import { NameChoicesIF } from '@/interfaces'
import { PAYMENT_COMPLETE_MODAL_IS_VISIBLE } from '@/modules/payment/store/types'
import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'

/**
* Makes debugging the receipt easier.
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/refund.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ import { REFUND_MODAL_IS_VISIBLE } from '@/modules/payment/store/types'
import { NrAction } from '@/enums'
import { PaymentMixin, PaymentSessionMixin } from '@/mixins'
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'

@Component({
components: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/dialogs/resubmit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ import { Jurisdictions, NrAction, PaymentAction } from '@/enums'
import { PaymentMixin, PaymentSessionMixin, DisplayedComponentMixin } from '@/mixins'
import { getBaseUrl } from '@/components/payment/payment-utils'
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'
import { PaymentRequiredError } from '@/errors'
import { GetFeatureFlag, Navigate } from '@/plugins'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ import NrNotApprovedGrayBox from './nr-not-approved-gray-box.vue'
import { NameState, NrAction, NrState, PaymentStatus, SbcPaymentStatus, PaymentAction, Furnished,
NrRequestActionCodes } from '@/enums'
import { Sleep, GetFeatureFlag, Navigate } from '@/plugins'
import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'
import ContactInfo from '@/components/common/contact-info.vue'
import { ActionBindingIF } from '@/interfaces/store-interfaces'

Expand Down
2 changes: 1 addition & 1 deletion src/components/new-request/stats.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import { Action, Getter } from 'vuex-class'
import { StatsI } from '@/interfaces'
import { GetFeatureFlag } from '@/plugins'
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'

@Component({})
export default class Stats extends Vue {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class EntityCannotBeAutoAnalyzed extends Vue {

// Global getters
@Getter getNameAnalysisTimeout!: boolean
@Getter getDoNotAnalyzeEntities!: string[]
@Getter getDoNotAnalyzeEntities!: EntityType[]
@Getter getEntityTextFromValue!: string
@Getter getEntityTypeCd!: EntityType
@Getter getIsPersonsName!: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Component, Vue, Prop } from 'vue-property-decorator'
import { Action, Getter } from 'vuex-class'
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import { ConditionalReqI, DraftReqI, IssueI, NameRequestI, ReservedReqI } from '@/interfaces'
import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'
import { Location, NrRequestActionCodes, NrType } from '@/enums'

@Component({})
Expand Down
58 changes: 36 additions & 22 deletions src/enums/entity-type.ts
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made these changes to be explicit about the entity type codes used in Namerequest vs. LEAR.

If you look at corp-type-module.ts then you will see that LEAR knows about some NR-only codes, but below you can see there are others. As far as I know, these haven't caused problems between NR and LEAR, but some day they might. And now it's easier to see the difference between the two.

Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
/** Enum for Entity Type codes. */
export enum EntityType {
// BC Entity Types:
BC = 'BC',
CC = 'CC',
CP = 'CP',
CR = 'CR',
DBA = 'DBA',
FI = 'FI',
FR = 'FR',
GP = 'GP',
LL = 'LL',
LP = 'LP',
PA = 'PA',
PAR = 'PAR',
SO = 'SO',
SP = 'SP',
UL = 'UL',
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module'

// XPRO Entity Types:
XCR = 'XCR',
// Namerequest-only entity types
// FUTURE: declare these in CorpTypeCd instead
enum Other {
SO = 'SO',
XUL = 'XUL',
RLC = 'RLC',
XLP = 'XLP',
XLL = 'XLL',
XCP = 'XCP',
XSO = 'XSO',
INFO = 'INFO'
}

/** Enum for Entity Type codes. */
export enum EntityType {
// BC Entity Types:
BC = CorpTypeCd.BC_COMPANY,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes things much easier and cleaner for proceeding with the way of navigating work 😁

I think we'll have to change the value of the supported-incorporation-registration-entities FF we created. Also, I'm going to make the necessary changes in my two tickets to accompany this adjustment after you merge Sev 👍

Copy link
Collaborator Author

@severinbeauvais severinbeauvais Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. Let me know about that existing FF, and whether we need another one for something different.

I haven't figured out the build issue yet... solved

CC = CorpTypeCd.BC_CCC,
CP = CorpTypeCd.COOP,
CR = CorpTypeCd.BC_CORPORATION,
DBA = CorpTypeCd.DOING_BUSINESS_AS,
FI = CorpTypeCd.FINANCIAL,
FR = CorpTypeCd.NR_SOLE_PROP,
GP = CorpTypeCd.PARTNERSHIP,
LL = CorpTypeCd.LL_PARTNERSHIP,
LP = CorpTypeCd.LIM_PARTNERSHIP,
PA = CorpTypeCd.PRIVATE_ACT,
PAR = CorpTypeCd.PARISHES,
SO = Other.SO,
SP = CorpTypeCd.SOLE_PROP,
UL = CorpTypeCd.BC_UNLIMITED,

// XPRO Entity Types:
XCR = CorpTypeCd.XPRO_CORPORATION,
XUL = Other.XUL,
RLC = Other.RLC,
XLP = Other.XLP,
XLL = Other.XLL,
XCP = CorpTypeCd.XPRO_COOP,
XSO = Other.XSO,

INFO = 'INFO', // special value for sub-menu
INFO = Other.INFO, // special value for sub-menu
}
6 changes: 4 additions & 2 deletions src/interfaces/mapping.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { EntityType } from '@/enums'

export interface MappingI {
ASSUMED: string[]
[propName: string]: string[] // misc properties that are arrays of strings
ASSUMED: EntityType[]
[propName: string]: EntityType[] // misc properties that are arrays of entity types
}
2 changes: 1 addition & 1 deletion src/interfaces/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export interface QuillOpsI {
}

export interface RequestActionMappingI {
[propName: string]: string[] // misc properties that are arrays of strings
[propName: string]: EntityType[] // misc properties that are arrays of entity types
}

export interface RequestActionsI {
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/new-request-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface NewRequestIF {
corpSearch: string
designationIssueTypes: string[]
displayedComponent: string
doNotAnalyzeEntities: string[]
doNotAnalyzeEntities: EntityType[]
editMode: boolean
entity_type_cd: EntityType
entityTypeAddToSelect: SelectOptionsI
Expand Down
23 changes: 13 additions & 10 deletions src/mixins/common-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,25 @@ export class CommonMixin extends Vue {
}

/** Returns entity type text for the the specified code. */
// FUTURE: use GetCorpFullDescription() instead
entityTypeCdToText (cd: EntityType): string {
switch (cd) {
// BC Entity Types:
case EntityType.FR: return 'BC Sole Proprietorship'
case EntityType.DBA: return 'BC "Doing Business As" name (DBA)'
case EntityType.BC: return 'BC Benefit Company'
case EntityType.CC: return 'BC Community Contribution Company'
case EntityType.CP: return 'BC Cooperative Association'
case EntityType.CR: return 'BC Limited Company'
case EntityType.UL: return 'BC Unlimited Liability Company'
case EntityType.DBA: return 'BC "Doing Business As" name (DBA)'
case EntityType.FI: return 'BC Credit Union'
case EntityType.FR: return 'BC Sole Proprietorship'
case EntityType.GP: return 'BC General Partnership'
case EntityType.LP: return 'BC Limited Partnership'
case EntityType.LL: return 'BC Limited Liability Partnership'
case EntityType.CP: return 'BC Cooperative Association'
case EntityType.BC: return 'BC Benefit Company'
case EntityType.CC: return 'BC Community Contribution Company'
case EntityType.SO: return 'BC Social Enterprise'
case EntityType.LP: return 'BC Limited Partnership'
case EntityType.PA: return 'BC Private Act'
case EntityType.FI: return 'BC Credit Union'
case EntityType.PAR: return 'BC Parish'
case EntityType.SO: return 'BC Social Enterprise'
case EntityType.SP: return 'BC Sole Proprietorship'
case EntityType.UL: return 'BC Unlimited Liability Company'

// XPRO Entity Types:
case EntityType.XCR: return 'Extraprovincial Limited Company'
Expand All @@ -45,7 +47,7 @@ export class CommonMixin extends Vue {
case EntityType.XCP: return 'Extraprovincial Cooperative Association'
case EntityType.XSO: return 'Extraprovincial Social Enterprise'

default: return cd
default: return (cd as unknown as string)
}
}

Expand Down Expand Up @@ -87,6 +89,7 @@ export class CommonMixin extends Vue {
isFirm (nr: any): boolean {
return (
nr?.legalType === EntityType.SP ||
nr?.legalType === EntityType.DBA ||
Copy link
Collaborator Author

@severinbeauvais severinbeauvais Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this was accidentally missed but it can't hurt to have it. 🤞

nr?.legalType === EntityType.GP)
}

Expand Down
2 changes: 1 addition & 1 deletion src/mixins/displayed-component-mixin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Vue } from 'vue-property-decorator'
import { Action, Getter } from 'vuex-class'
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'
import { NrState } from '@/enums'

@Component({})
Expand Down
4 changes: 2 additions & 2 deletions src/mixins/nr-affiliation-mixin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Mixins } from 'vue-property-decorator'
import { Action } from 'vuex-class'
import AuthServices from '@/services/auth.services'
import BusinessServices from '@/services/business.services'
import AuthServices from '@/services/auth-services'
import BusinessServices from '@/services/business-services'
import { BusinessRequest, NameRequestI } from '@/interfaces'
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import { Navigate } from '@/plugins'
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/payment-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import errorModule from '@/modules/error'
import { ErrorI } from '@/modules/error/store/actions'
import { StaffPaymentIF, RefundParamsIF, NameRequestI } from '@/interfaces'
import { ActionBindingIF } from '@/interfaces/store-interfaces'
import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'
import { PaymentRequiredError } from '@/errors'
import { Navigate } from '@/plugins'
import { appBaseURL } from '../router/router'
Expand Down
2 changes: 1 addition & 1 deletion src/mixins/update-user-mixin.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Component, Vue } from 'vue-property-decorator'
import { UpdateLdUser } from '@/plugins'
import AuthServices from '@/services/auth.services'
import AuthServices from '@/services/auth-services'

@Component({})
export class UpdateUserMixin extends Vue {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/store/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import { BAD_REQUEST, NOT_FOUND, OK, SERVICE_UNAVAILABLE } from 'http-status-codes'
import removeAccents from 'remove-accents'
import { GetFeatureFlag, Sleep, sanitizeName } from '@/plugins'
import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'
import { MRAS_MIN_LENGTH, MRAS_MAX_LENGTH } from '@/components/new-request/constants'

// List Data
Expand Down
2 changes: 1 addition & 1 deletion src/store/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export const getIsPersonsName = (state: StateIF): boolean => {
return state.stateModel.newRequestModel.isPersonsName
}

export const getDoNotAnalyzeEntities = (state: StateIF): string[] => {
export const getDoNotAnalyzeEntities = (state: StateIF): EntityType[] => {
return state.stateModel.newRequestModel.doNotAnalyzeEntities
}

Expand Down
2 changes: 1 addition & 1 deletion src/views/landing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import SubmissionTabs from '@/components/new-request/submit-request/submission-t
import Success from '@/components/common/success.vue'
import Tabs from '@/components/tabs.vue'

import NamexServices from '@/services/namex.services'
import NamexServices from '@/services/namex-services'
import { ActionBindingIF } from '@/interfaces/store-interfaces'

@Component({
Expand Down