Skip to content

Commit

Permalink
15601 Legal Name changes (bcgov#575)
Browse files Browse the repository at this point in the history
* - app version = 5.6.0

* - updated Legal API URL (temporary)
- save operating name from business info
- added operating name to state
- added alternate names array to business inteface
- added operating name store getter and setter
- initialized operating name in state

* - added temp API URL to example env file
- added temp API URL to vaults env file
- fixed misc code issues
- changed DocumentMixin hook from created() to beforeCreate() to avoid type conflict
- updated getBusinessLegalName to return operating name for firms

* - updated EntityInfo unit tests

* - added ids to some AssociationDetails elements
- added AssociationDetails unit tests

* - updated App unit tests

* - deleted obsolete nginx config
- updated firebase config to allow connecting to Legal API temp URL

* - commented out invalid comment in Dockerfil

* - renamed jest-wrapper-factory -> vitest-wrapper-factory

* - reverted Dockerfile
- restored nginx config
  • Loading branch information
severinbeauvais authored and JazzarKarim committed Feb 1, 2024
1 parent 18f989c commit e0e6026
Show file tree
Hide file tree
Showing 23 changed files with 237 additions and 72 deletions.
20 changes: 11 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Base Path Openshift: /businesses/create Firebase: /
VUE_APP_PATH="/"

#vaults Shared
# vaults Shared
VUE_APP_ADDRESS_COMPLETE_KEY=

#vaults web-url
# vaults web-url
VUE_APP_REGISTRY_HOME_URL="https://dev.bcregistry.gov.bc.ca/"
VUE_APP_AUTH_WEB_URL="https://dev.account.bcregistry.gov.bc.ca/"
VUE_APP_BUSINESSES_URL="https://dev.account.bcregistry.gov.bc.ca/"
VUE_APP_DASHBOARD_URL="https://dev.business.bcregistry.gov.bc.ca/"
VUE_APP_SITEMINDER_LOGOUT_URL="https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi"

#vaults API
# vaults API
VUE_APP_AUTH_API_URL="https://auth-api-dev.apps.silver.devops.gov.bc.ca"
VUE_APP_AUTH_API_VERSION="/api/v1"
VUE_APP_LEGAL_API_URL="https://legal-api-dev.apps.silver.devops.gov.bc.ca"
# for Legal Name feature branch only:
VUE_APP_LEGAL_API_URL="https://business-api-dy4loprnwa-nn.a.run.app"
#VUE_APP_LEGAL_API_URL="https://legal-api-dev.apps.silver.devops.gov.bc.ca"
VUE_APP_LEGAL_API_VERSION_2="/api/v2"
VUE_APP_NAICS_API_URL="https://legal-api-dev.apps.silver.devops.gov.bc.ca"
VUE_APP_NAICS_API_VERSION_2="/api/v2"
Expand All @@ -26,22 +28,22 @@ VUE_APP_REGISTRIES_SEARCH_API_URL="https://bcregistry-dev.apigee.net/registry-se
VUE_APP_REGISTRIES_SEARCH_API_VERSION="/api/v1"
VUE_APP_REGISTRIES_SEARCH_API_KEY=

#vaults launchdarkly
# vaults launchdarkly
VUE_APP_BUSINESS_CREATE_LD_CLIENT_ID="642af8daefad6f134479c602"

#vaults keycloak
# vaults keycloak
VUE_APP_KEYCLOAK_AUTH_URL="https://dev.loginproxy.gov.bc.ca/auth"
VUE_APP_KEYCLOAK_REALM="bcregistry"
VUE_APP_KEYCLOAK_CLIENTID="entity-web"

#vaults sentry
# vaults sentry
VUE_APP_SENTRY_DSN=

#vaults hotjar
# vaults hotjar
VUE_APP_HOTJAR_ID=
VUE_APP_IA_SURVEY_ID=

#vaults webchat
# vaults webchat
VUE_APP_GENESYS_ENV=
VUE_APP_GENESYS_URL=
VUE_APP_GENESYS_ID=
Expand Down
20 changes: 11 additions & 9 deletions devops/vaults.env
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
# Base Path Openshift: /businesses/create Firebase:
VUE_APP_PATH="/"

#vaults Shared
# vaults Shared
VUE_APP_ADDRESS_COMPLETE_KEY="op://canadapost/$APP_ENV/address-key/ADDRESS_COMPLETE_KEY"

#vaults web-url
# vaults web-url
VUE_APP_REGISTRY_HOME_URL="op://web-url/$APP_ENV/registry/REGISTRY_HOME_URL"
VUE_APP_AUTH_WEB_URL="op://web-url/$APP_ENV/auth-web/AUTH_WEB_URL"
VUE_APP_BUSINESSES_URL="op://web-url/$APP_ENV/business/BUSINESSES_URL"
VUE_APP_DASHBOARD_URL="op://web-url/$APP_ENV/business/DASHBOARD_URL"
VUE_APP_SITEMINDER_LOGOUT_URL="op://web-url/$APP_ENV/siteminder/SITEMINDER_LOGOUT_URL"

#vaults API
# vaults API
VUE_APP_AUTH_API_URL="op://API/$APP_ENV/auth-api/AUTH_API_URL"
VUE_APP_AUTH_API_VERSION="op://API/$APP_ENV/auth-api/AUTH_API_VERSION"
VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_API_URL"
# for Legal Name feature branch only:
VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_NAME_API_URL"
#VUE_APP_LEGAL_API_URL="op://API/$APP_ENV/legal-api/LEGAL_API_URL"
VUE_APP_LEGAL_API_VERSION_2="op://API/$APP_ENV/legal-api/LEGAL_API_VERSION_2"
VUE_APP_NAICS_API_URL="op://API/$APP_ENV/naics-api/NAICS_API_URL"
VUE_APP_NAICS_API_VERSION_2="op://API/$APP_ENV/naics-api/NAICS_API_VERSION"
Expand All @@ -26,22 +28,22 @@ VUE_APP_REGISTRIES_SEARCH_API_URL="op://API/$APP_ENV/registries-search-api/REGIS
VUE_APP_REGISTRIES_SEARCH_API_VERSION="op://API/$APP_ENV/registries-search-api/REGISTRIES_SEARCH_API_VERSION"
VUE_APP_REGISTRIES_SEARCH_API_KEY="op://API/$APP_ENV/registries-search-api/REGISTRIES_SEARCH_API_KEY"

#vaults launchdarkly
# vaults launchdarkly
VUE_APP_BUSINESS_CREATE_LD_CLIENT_ID="op://launchdarkly/$APP_ENV/business-create/BUSINESS_CREATE_LD_CLIENT_ID"

#vaults keycloak
# vaults keycloak
VUE_APP_KEYCLOAK_AUTH_URL="op://keycloak/$APP_ENV/base/KEYCLOAK_AUTH_BASE_URL"
VUE_APP_KEYCLOAK_REALM="op://keycloak/$APP_ENV/base/KEYCLOAK_REALMNAME"
VUE_APP_KEYCLOAK_CLIENTID="op://keycloak/$APP_ENV/entity-web/UI_KEYCLOAK_RESOURCE_NAME"

#vaults sentry
# vaults sentry
VUE_APP_SENTRY_DSN="op://sentry/$APP_ENV/entity/SENTRY_DSN"

#vaults hotjar (hotjar id - ready to use)
# vaults hotjar (hotjar id - ready to use)
VUE_APP_HOTJAR_ID=
VUE_APP_IA_SURVEY_ID="op://hotjar/$APP_ENV/shared/IA_SURVEY_ID"

#vaults webchat
# vaults webchat
VUE_APP_GENESYS_ENV="op://webchat/$APP_ENV/base/GENESYS_ENV"
VUE_APP_GENESYS_URL="op://webchat/$APP_ENV/base/GENESYS_URL"
VUE_APP_GENESYS_ID="op://webchat/$APP_ENV/business-create-ui/GENESYS_ID"
Expand Down
2 changes: 1 addition & 1 deletion firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{ "key" : "X-XSS-Protection", "value" : "1; mode=block" },
{
"key": "Content-Security-Policy",
"value": "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; style-src 'self' 'unsafe-inline' *.cloudflare.com *.googleapis.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com *.googleapis.com *.gstatic.com *.jsdelivr.net; img-src 'self' data: *.hotjar.com https://*.cac1.pure.cloud; connect-src 'self' *.gov.bc.ca *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net wss://*.hotjar.com *.hotjar.io https://*.nr-data.net https://shyrka-prod-cac1.s3.ca-central-1.amazonaws.com https://*.newrelic.com https://*.cac1.pure.cloud wss://*.cac1.pure.cloud; manifest-src 'self'; media-src 'self' https://*.cac1.pure.cloud; object-src 'self' https://*.cac1.pure.cloud; child-src 'self' https://*.cac1.pure.cloud;"
"value": "default-src 'self'; frame-src 'self' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; script-src 'self' 'unsafe-eval' 'unsafe-inline' *.gov.bc.ca *.hotjar.com *.googleapis.com https://*.nr-data.net https://*.newrelic.com https://*.cac1.pure.cloud; style-src 'self' 'unsafe-inline' *.cloudflare.com *.googleapis.com; font-src 'self' *.gov.bc.ca *.hotjar.com *.cloudflare.com *.googleapis.com *.gstatic.com *.jsdelivr.net; img-src 'self' data: *.hotjar.com https://*.cac1.pure.cloud; connect-src 'self' *.gov.bc.ca *.run.app *.launchdarkly.com *.hotjar.com *.postescanada-canadapost.ca *.sentry.io *.apigee.net wss://*.hotjar.com *.hotjar.io https://*.nr-data.net https://shyrka-prod-cac1.s3.ca-central-1.amazonaws.com https://*.newrelic.com https://*.cac1.pure.cloud wss://*.cac1.pure.cloud; manifest-src 'self'; media-src 'self' https://*.cac1.pure.cloud; object-src 'self' https://*.cac1.pure.cloud; child-src 'self' https://*.cac1.pure.cloud;"
},
{ "key": "Cache-Control", "value": "no-cache, no-store, must-revalidate"},
{ "key": "Pragma", "value": "no-cache"},
Expand Down
4 changes: 2 additions & 2 deletions 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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-create-ui",
"version": "5.8.3",
"version": "5.6.0",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
22 changes: 14 additions & 8 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
@Action(useStore) setLastAnnualReportDate!: (x: string) => void
@Action(useStore) setLastDirectorChangeDate!: (x: string) => void
// @Action(useStore) setNameRequest!: (x: NameRequestIF) => void
@Action(useStore) setOperatingName!: (x: string) => void
@Action(useStore) setParties!: (x: Array<PartyIF>) => void
@Action(useStore) setResources!: (x: ResourceIF) => void
@Action(useStore) setUserAddress!: (x: AddressIF) => void
Expand Down Expand Up @@ -368,7 +369,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
readonly window = window
/** The Update Current JS Date timer id. */
private updateCurrentJsDateId = null // may be number or NodeJS.Timeout
private updateCurrentJsDateId = null as any // NodeJS.Timeout
/** The route breadcrumbs list. */
get breadcrumbs (): Array<BreadcrumbIF> {
Expand Down Expand Up @@ -843,7 +844,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
// NB: will throw if API error
let draftFiling = await LegalServices.fetchFirstTask(businessId)
this.setFilingType(draftFiling.header.name)
this.setFilingType(draftFiling.header.name as FilingTypes)
// check if filing is in a valid state to be edited
this.invalidFilingDialog = !this.hasValidFilingState(draftFiling)
Expand Down Expand Up @@ -902,7 +903,7 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
// NB: will throw if API error
let draftFiling = await LegalServices.fetchFirstOrOnlyFiling(tempId)
this.setFilingType(draftFiling.header.name)
this.setFilingType(draftFiling.header.name as FilingTypes)
// check if filing is in a valid state to be edited
this.invalidFilingDialog = !this.hasValidFilingState(draftFiling)
Expand Down Expand Up @@ -1220,16 +1221,21 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
// FUTURE: change this to a single setter/object?
this.setAdminFreeze(business.adminFreeze)
this.setLegalName(business.legalName)
this.setEntityState(business.state)
{
// store operating name if it exists (only used for firms atm)
const alternateName = business.alternateNames?.find(x => x.identifier === business.identifier)
if (alternateName) this.setOperatingName(alternateName.operatingName)
}
this.setBusinessNumber(business.taxId || null) // may be empty
this.setBusinessStartDate(business.startDate)
this.setEntityState(business.state)
this.setGoodStanding(business.goodStanding)
this.setIdentifier(business.identifier)
this.setLastAnnualReportDate(business.lastAnnualReportDate) // may be empty
this.setLastAddressChangeDate(business.lastAddressChangeDate) // may be empty
this.setLastAnnualReportDate(business.lastAnnualReportDate) // may be empty
this.setLastDirectorChangeDate(business.lastDirectorChangeDate) // may be empty
this.setLegalName(business.legalName)
this.setWarnings(Array.isArray(business.warnings) ? business.warnings : [])
this.setGoodStanding(business.goodStanding)
this.setBusinessStartDate(business.startDate)
}
/** Fetches authorizations and verifies roles. */
Expand Down
17 changes: 11 additions & 6 deletions src/components/Dissolution/AssociationDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
sm="3"
class="pr-4"
>
<label>{{ entityLabel }}</label>
<label id="entity-label">{{ entityLabel }}</label>
</v-col>

<v-col
Expand All @@ -17,10 +17,15 @@
class="mt-n1"
>
<label id="company-name">{{ entityName }}</label>
<div class="my-1">
<div
id="entity-description"
class="my-1"
>
{{ entityDescription }}
</div>
<div>{{ getBusinessId }}</div>
<div id="business-id">
{{ getBusinessId }}
</div>
</v-col>
</v-row>
</article>
Expand All @@ -35,7 +40,7 @@
sm="3"
class="pr-4"
>
<label>{{ addressLabel }}</label>
<label id="address-label">{{ addressLabel }}</label>
</v-col>

<v-col
Expand Down Expand Up @@ -194,12 +199,12 @@ export default class AssociationDetails extends Mixins(CommonMixin, DateMixin) {
/** The entity name. */
get entityName (): string {
return this.getBusinessLegalName || GetCorpNumberedDescription(this.getEntityType)
return this.getBusinessLegalName || GetCorpNumberedDescription(this.getEntityType as any)
}
/** The entity description. */
get entityDescription (): string {
return GetCorpFullDescription(this.getEntityType)
return GetCorpFullDescription(this.getEntityType as any)
}
/** The business start date. */
Expand Down
4 changes: 2 additions & 2 deletions src/components/Dissolution/CompleteAffidavit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export default class CompleteAffidavit extends Mixins(CommonMixin, DocumentMixin
/** The entity name. */
get entityName (): string {
return this.getBusinessLegalName || GetCorpNumberedDescription(this.getEntityType)
return this.getBusinessLegalName || GetCorpNumberedDescription(this.getEntityType as any)
}
get entityTitle (): string {
Expand Down Expand Up @@ -373,7 +373,7 @@ export default class CompleteAffidavit extends Mixins(CommonMixin, DocumentMixin
name: this.uploadAffidavitDoc.name,
lastModified: this.uploadAffidavitDoc.lastModified,
size: this.uploadAffidavitDoc.size
}
} as File
this.setAffidavit({
...this.getAffidavitStep,
affidavitFile,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Incorporation/UploadRules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ export default class UploadRules extends Mixins(CommonMixin, DocumentMixin) {
name: this.uploadRulesDoc.name,
lastModified: this.uploadRulesDoc.lastModified,
size: this.uploadRulesDoc.size
}
} as File
this.setRules({
...this.getCreateRulesStep,
rulesFile,
Expand Down
6 changes: 3 additions & 3 deletions src/components/common/EntityInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default class EntityInfo extends Mixins(DateMixin) {
/** The entity legal name (old name, new name, or numbered description). */
get entityLegalName (): string {
const numberedDescription = GetCorpNumberedDescription(this.getEntityType)
const numberedDescription = GetCorpNumberedDescription(this.getEntityType as any)
// name comes from different places depending on filing type
switch (this.getFilingType) {
Expand All @@ -146,9 +146,9 @@ export default class EntityInfo extends Mixins(DateMixin) {
return '' // should never happen
}
/** The entity description. */
/** The entity description. */
get entityDescription (): string {
const corpTypeDescription = GetCorpFullDescription(this.getEntityType)
const corpTypeDescription = GetCorpFullDescription(this.getEntityType as any)
if (this.isTypeSoleProp && this.getTempId) {
return `${corpTypeDescription} / Doing Business As (DBA)`
Expand Down
2 changes: 2 additions & 0 deletions src/interfaces/store-interfaces/state-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface StateModelIF {
dissolution: DissolutionStateIF
nameRequest: NameRequestIF
nameRequestApprovedName: string
operatingName: string
correctNameOption: CorrectNameOptions
nameTranslations: NameTranslationIF[]
nameTranslationsValid: boolean
Expand Down Expand Up @@ -81,6 +82,7 @@ export interface StateModelIF {
staffPaymentStep: StaffPaymentStepIF
courtOrderStep: CourtOrderStepIF

// to calculate if this is a mobile screen
windowWidth: number
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,24 @@ export interface BusinessWarningIF {
filing: string
}

/** The Alternate Name (aka operating name) object. */
export interface AlternateNameIF {
entityType: CorpTypeCd
identifier: string
nameRegisteredDate: ApiDateTimeUtc
nameStartDate: IsoDatePacific
operatingName: string
}

/** The Business object from the API. */
export interface BusinessIF {
adminFreeze: boolean
alternateNames?: Array<AlternateNameIF>
arMaxDate: IsoDatePacific // not used
arMinDate: IsoDatePacific // not used
businessContact: ContactPointIF
businessId: string
dissolutionDate: ApiDateTimeUtc // not used
warnings?: Array<BusinessWarningIF>
fiscalYearEndDate: IsoDatePacific // not used
foundingDate: ApiDateTimeUtc | string
goodStanding: boolean
Expand All @@ -35,9 +44,10 @@ export interface BusinessIF {
legalType: CorpTypeCd
officeAddress: OfficeAddressIF
nextAnnualReport: ApiDateTimeUtc // used for BCOMP only
taxId?: string // aka Business Number // may be undefined
state: EntityStates
stateFiling?: string
startDate: ApiDateTimeUtc
state: EntityState
stateFiling?: string
submitter: string // not used
taxId?: string // aka Business Number // may be undefined
warnings?: Array<BusinessWarningIF>
}
3 changes: 2 additions & 1 deletion src/mixins/document-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default class DocumentMixin extends Vue {

pdfjsLib: any

async created () {
// use beforeCreate() instead of created() to avoid type conflict with components that use this mixin
async beforeCreate (): Promise<void> {
// NB: we load the lib and worker this way to avoid a memory leak (esp in unit tests)
// NB: must use legacy build for unit tests not running in Node 18+
this.pdfjsLib = pdfjs
Expand Down
Loading

0 comments on commit e0e6026

Please sign in to comment.