-
Notifications
You must be signed in to change notification settings - Fork 42
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
> 1% | ||
last 2 versions | ||
not ie <= 10 | ||
not dead | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
|
||
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 | ||
} |
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 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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' | ||
|
@@ -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) | ||
} | ||
} | ||
|
||
|
@@ -87,6 +89,7 @@ export class CommonMixin extends Vue { | |
isFirm (nr: any): boolean { | ||
return ( | ||
nr?.legalType === EntityType.SP || | ||
nr?.legalType === EntityType.DBA || | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) | ||
} | ||
|
||
|
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.
Same as other UI repos.