Skip to content

Commit

Permalink
16634 mapped EntityType to CorpTypeCd + cleanup (#622)
Browse files Browse the repository at this point in the history
* - updated browserslist config
- app version = 5.0.3
- added corp-type-module dependency
- mapped EntityType to CorpTypeCd

* - renamed xxx.services -> xxx-services
- changed some strings to EntityType
- worked around EntityType type issue
- sorted items in entityTypeCdToText()
  • Loading branch information
severinbeauvais authored Jul 6, 2023
1 parent c71bdbf commit 35a7737
Show file tree
Hide file tree
Showing 30 changed files with 81 additions and 60 deletions.
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
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
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,
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 ||
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

0 comments on commit 35a7737

Please sign in to comment.