Skip to content

Commit

Permalink
21297 - Fix for name for soleprop, fix for view and change address li…
Browse files Browse the repository at this point in the history
…nk (#16)

* 21297 - Fixes for name and type display for sole prop.

* 21297 - Fixed view and change business information disabled state.

* 21297 - PR comments.

* 21297 - Added env variables to examples and vaults.env.
  • Loading branch information
hfekete authored Jul 11, 2024
1 parent 5d11c03 commit 402adc3
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 9 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ 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_STATUS_API_URL="https://status-api-dev.apps.silver.devops.gov.bc.ca"
VUE_APP_STATUS_API_VERSION="/api/v1"
VUE_APP_BUSINESS_EDIT_URL="https://dev.edit.business.bcregistry.gov.bc.ca"

#vaults launchdarkly
# this is here to help CI pass and as this is already public it is OK to leave it here (dev value)
Expand Down
1 change: 1 addition & 0 deletions devops/vaults.env
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ 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_STATUS_API_URL="op://API/$APP_ENV/status-api/STATUS_API_URL"
VUE_APP_STATUS_API_VERSION="op://API/$APP_ENV/status-api/STATUS_API_VERSION"
VUE_APP_BUSINESS_EDIT_URL="op://web-url/$APP_ENV/business-edit/BUSINESS_EDIT_URL"

# vaults launchdarkly
VUE_APP_LD_CLIENT_ID="op://launchdarkly/$APP_ENV/business-filings/BUSINESS_FILING_LD_CLIENT_ID"
Expand Down
1 change: 1 addition & 0 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ export default defineNuxtConfig({
ldClientId: process.env.VUE_APP_LD_CLIENT_ID || '',
legalApiURL: `${process.env.VUE_APP_LEGAL_API_URL || ''}${process.env.VUE_APP_LEGAL_API_VERSION_2 || ''}`,
payApiURL: `${process.env.VUE_APP_PAY_API_URL || ''}${process.env.VUE_APP_PAY_API_VERSION || ''}`,
editApiURL: `${process.env.VUE_APP_BUSINESS_EDIT_URL || ''}`,
registryHomeURL: process.env.VUE_APP_REGISTRY_HOME_URL || '',
appEnv: `${process.env.VUE_APP_POD_NAMESPACE || 'unknown'}`,
requireLogin: true,
Expand Down
1 change: 1 addition & 0 deletions src/components/bcros/businessDetails/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
</template>

<script setup lang="ts">
const { currentBusinessName, isInLimitedRestoration, currentBusiness, stateFiling } = storeToRefs(useBcrosBusiness())
</script>
30 changes: 26 additions & 4 deletions src/components/bcros/businessDetails/Links.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,23 +125,45 @@ const isPendingDissolution = computed(() => {
})
const isChangeBusinessInfoDisabled = computed(() => {
// todo: add staff exclusion. Staff should be allowed when business is not in good standing
if (!currentBusiness.value.goodStanding) {
// todo: add staff exclusion. Staff should not be allowed to skip rules for business
// as if this is enabled, and not in good standing, only thing that will come is popup warning
return false
}
const isAllowed =
// if it's coop
(currentBusiness.value.legalType === CorpTypeCd.COOP &&
!!getStoredFlag('special-resolution-ui-enabled') &&
isAllowedToFile(FilingTypes.SPECIAL_RESOLUTION)) ||
// if it's firm
(isFirm && isAllowedToFile(FilingTypes.CHANGE_OF_REGISTRATION)) ||
// otherwise
isAllowedToFile(FilingTypes.ALTERATION)
return !currentBusiness.value.goodStanding || isAllowed
return !isAllowed
})
/**
* If business is Not In Good Standing and user isn't staff, emits an event to display NIGS dialog.
* Otherwise, navigates to Edit UI to create a Special Resolution or Change or Alteration filing.
*/
const promptChangeBusinessInfo = () => {
// todo: implement
const baseUrl = useRuntimeConfig().public.editApiURL
const editUrl = `${baseUrl}/${currentBusiness.value.identifier}`
navigateTo('https://www.corporateonline.gov.bc.ca/', { external: true })
// if (!isGoodStanding && !isRoleStaff) {
if (!currentBusiness.value.goodStanding) {
alert('change company info')
// this.emitNotInGoodStanding(NigsMessage.CHANGE_COMPANY_INFO)
} else if (currentBusiness.value.legalType === CorpTypeCd.COOP) {
navigateTo(`${editUrl}/special-resolution`, { external: true })
} else if (isFirm) {
navigateTo(`${editUrl}/change`, { external: true })
} else {
navigateTo(`${editUrl}/alteration`, { external: true })
}
}
/** Request and Download Business Summary Document. */
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/business-i.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { CorpTypeCd, AmalgamationTypes, FilingTypes } from '@bcrs-shared-components/enums'
import type { ApiDateTimeUtc, IsoDatePacific } from '@bcrs-shared-components/interfaces'
import type { AlternateNameIF, ApiDateTimeUtc, IsoDatePacific } from '@bcrs-shared-components/interfaces'

import { BusinessStateE } from '~/enums/business-state-e'
import { FilingSubTypeE } from '~/enums/filing-sub-type-e'
Expand All @@ -8,7 +8,7 @@ import type { WarningTypesE } from '~/enums/warning-types-e'

export interface SlimBusinessI {
adminFreeze: boolean
alternateNames: { operatingName: string }[]
alternateNames: AlternateNameIF[]
goodStanding: boolean
identifier: string
legalName: string
Expand Down
2 changes: 1 addition & 1 deletion src/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"BEN": "BC Benefit Company",
"BC": "BC Limited Company",
"CP": "BC Cooperative Association",
"SP": "Sole Proprietorship",
"SP": "BC Sole Proprietorship",
"GP": "BC General Partnership",
"undefined": "N/A"
}
Expand Down
10 changes: 8 additions & 2 deletions src/stores/business.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ export const useBcrosBusiness = defineStore('bcros/business', () => {
const currentParties: Ref<PartiesI> = ref({} as PartiesI)
const currentBusinessIdentifier = computed((): string => currentBusiness.value.identifier)
const currentBusinessName = computed((): string => {
if (currentBusiness.value.alternateNames && currentBusiness.value.legalType === CorpTypeCd.SOLE_PROP) {
return currentBusiness.value.alternateNames[0].operatingName
const isSolePropOrGp = currentBusiness.value.legalType === CorpTypeCd.SOLE_PROP ||
currentBusiness.value.legalType === CorpTypeCd.PARTNERSHIP

if (currentBusiness.value.alternateNames && isSolePropOrGp) {
const alternateName = currentBusiness.value.alternateNames
.find(alternateName => alternateName.identifier === currentBusinessIdentifier.value)
return alternateName?.name || currentBusiness.value.legalName
}

return currentBusiness.value.legalName
})
const currentBusinessContact = ref({} as ContactBusinessI)
Expand Down

0 comments on commit 402adc3

Please sign in to comment.