Skip to content

Commit

Permalink
20489 Cleanup of Name Request enums, interfaces, etc (bcgov#568)
Browse files Browse the repository at this point in the history
* - app version = 4.8.0
- imported latest shared interfaces
- imported latest shared mixins
- used "get NR xxx" getters consistently
- misc sorting of references, etc
- updated code to use latest interfaces (property names, etc)
- misc rename methods/properties/events for consistency/clarity
- save "name request legal name" separately from NR object
- cast some variables "as any" to hide (incorrect) IDE warnings
- added some computed properties (local getters)
- replaced local NameRequestStates enum with shared one
- updated misc filing interfaces
- deleted misc unused interfaces
- replaced local NameRequestIF interface with shared one
- changed filingData declaration to fix misc type warnings
- now save original NR + properties needed by Legal API
- now restore original NR data and legal name
- updated name request mixin to be closer to shared one (for eventual replacement)
- updated some typing
- updated some imports to reduce type clashes
- deleted misc unneeded imports
- updated/fixed unit tests

* - sorted some imports

* - deleted external import from index file
- imported it directly from shared repo in component

---------

Co-authored-by: Severin Beauvais <[email protected]>
  • Loading branch information
severinbeauvais and Severin Beauvais authored Apr 19, 2024
1 parent 848e34a commit d9e21d8
Show file tree
Hide file tree
Showing 102 changed files with 798 additions and 845 deletions.
46 changes: 26 additions & 20 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-edit-ui",
"version": "4.7.17",
"version": "4.8.0",
"private": true,
"appName": "Edit UI",
"sbcName": "SBC Common Components",
Expand All @@ -27,11 +27,11 @@
"@bcrs-shared-components/court-order-poa": "2.1.3",
"@bcrs-shared-components/date-picker": "1.2.5",
"@bcrs-shared-components/detail-comment": "1.1.3",
"@bcrs-shared-components/enums": "1.0.46",
"@bcrs-shared-components/enums": "1.1.9",
"@bcrs-shared-components/fee-summary": "1.2.5",
"@bcrs-shared-components/folio-number": "1.1.1",
"@bcrs-shared-components/help-business-number": "1.1.1",
"@bcrs-shared-components/interfaces": "1.0.71",
"@bcrs-shared-components/interfaces": "1.1.11",
"@bcrs-shared-components/limited-restoration-panel": "2.0.1",
"@bcrs-shared-components/nature-of-business": "1.2.4",
"@bcrs-shared-components/relationships-panel": "1.0.14",
Expand Down
5 changes: 3 additions & 2 deletions src/components/Alteration/AlterationSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
{{ companyName }}
</div>
<div class="company-name mt-2">
{{ getNameRequest.nrNumber }}
{{ getNameRequestNumber }}
</div>
</v-col>
</v-row>
Expand Down Expand Up @@ -192,6 +192,8 @@ export default class AlterationSummary extends Mixins(DateMixin, FeeMixin, Filin
@Getter(useStore) getBusinessNumber!: string
@Getter(useStore) getCurrentFees!: FeesIF[]
@Getter(useStore) getFlagsReviewCertify!: FlagsReviewCertifyIF
// @Getter(useStore) getNameRequestLegalName!: string
// @Getter(useStore) getNameRequestNumber!: string
@Getter(useStore) getOriginalResolutions!: ResolutionsIF[]
@Getter(useStore) haveNewResolutionDates!: boolean
@Getter(useStore) isBusySaving!: boolean
Expand All @@ -218,7 +220,6 @@ export default class AlterationSummary extends Mixins(DateMixin, FeeMixin, Filin
/** The company name (from NR, or incorporation number). */
get companyName (): string {
if (this.getNameRequestLegalName) return this.getNameRequestLegalName
return `${this.getBusinessNumber || '[Incorporation Number]'} B.C. Ltd.`
}
Expand Down
12 changes: 5 additions & 7 deletions src/components/Change/ChangeSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{{ companyName }}
</div>
<div class="company-name mt-2">
{{ getNameRequest.nrNumber }}
{{ getNameRequestNumber }}
</div>
</v-col>
</v-row>
Expand Down Expand Up @@ -115,7 +115,6 @@ import Vue from 'vue'
import { Component, Prop } from 'vue-property-decorator'
import { Getter } from 'pinia-class'
import { OfficeAddresses, ListPeopleAndRoles } from '@/components/common/'
import { NameRequestIF } from '@/interfaces/'
import { NaicsIF } from '@bcrs-shared-components/interfaces/'
import { useStore } from '@/store/store'
Expand All @@ -127,14 +126,14 @@ import { useStore } from '@/store/store'
})
export default class ChangeSummary extends Vue {
// Global getters
@Getter(useStore) getBusinessNumber!: string
@Getter(useStore) getCurrentNaics!: NaicsIF
@Getter(useStore) getNameRequestLegalName!: string
@Getter(useStore) getNameRequestNumber!: string
@Getter(useStore) hasBusinessNameChanged!: boolean
@Getter(useStore) hasNaicsChanged!: boolean
@Getter(useStore) haveOfficeAddressesChanged!: boolean
@Getter(useStore) havePeopleAndRolesChanged!: boolean
@Getter(useStore) getBusinessNumber!: string
@Getter(useStore) getCurrentNaics!: NaicsIF
@Getter(useStore) getNameRequest!: NameRequestIF
@Getter(useStore) getNameRequestLegalName!: string
@Getter(useStore) isSoleProp!: boolean
/** Whether to perform validation. */
Expand All @@ -143,7 +142,6 @@ export default class ChangeSummary extends Vue {
/** The company name (from NR, or incorporation number). */
get companyName (): string {
if (this.getNameRequestLegalName) return this.getNameRequestLegalName
return `${this.getBusinessNumber || '[Incorporation Number]'} B.C. Ltd.`
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/components/Restoration/RestorationSummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export default class RestorationSummary extends Mixins(DateMixin, FeeMixin, Fili
// Global getters
@Getter(useStore) getBusinessNumber!: string
@Getter(useStore) getCurrentFees!: FeesIF[]
// @Getter(useStore) getNameRequestLegalName!: string
// @Getter(useStore) getNameRequestNumber!: string
@Getter(useStore) isBusySaving!: boolean
/** Whether to perform validation. */
Expand All @@ -62,7 +64,6 @@ export default class RestorationSummary extends Mixins(DateMixin, FeeMixin, Fili
/** The company name (from NR, or incorporation number). */
get companyName (): string {
if (this.getNameRequestLegalName) return this.getNameRequestLegalName
return `${this.getBusinessNumber || '[Incorporation Number]'} B.C. Ltd.`
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/components/Restoration/YourCompanySummary.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{{ companyName }}
</div>
<div class="company-name mt-2">
{{ getNameRequest.nrNum }}
{{ getNameRequestNumber }}
</div>
</v-col>
</v-row>
Expand Down Expand Up @@ -105,7 +105,6 @@ import { Getter } from 'pinia-class'
import { useStore } from '@/store/store'
import { ApprovalTypes, RelationshipTypes } from '@bcrs-shared-components/enums'
import { OfficeAddresses, NameTranslation } from '@/components/common/'
import { NameRequestIF } from '@bcrs-shared-components/interfaces'
import { CourtOrderIF } from '@/interfaces/alteration-interfaces'
import { RestorationStateIF } from '@/interfaces'
Expand All @@ -122,8 +121,8 @@ export default class YourCompanySummary extends Vue {
@Getter(useStore) getBusinessNumber!: string
@Getter(useStore) getCourtOrderNumberText!: string
@Getter(useStore) getIsRestorationTypeCourtOrder!: boolean
@Getter(useStore) getNameRequest!: NameRequestIF
@Getter(useStore) getNameRequestLegalName!: string
@Getter(useStore) getNameRequestNumber!: string
@Getter(useStore) getRelationships!: RelationshipTypes[]
@Getter(useStore) getRestoration!: RestorationStateIF
@Getter(useStore) getRestorationExpiryText!: string
Expand Down
3 changes: 2 additions & 1 deletion src/components/SpecialResolution/Rules.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,7 @@
</div>
</v-col>
</template>

<!-- Editing Mode -->
<v-col
v-else
Expand Down Expand Up @@ -297,6 +298,7 @@
</div>
</section>
</v-col>

<!-- Actions -->
<v-col
v-if="!isEditing && !hasChanged"
Expand All @@ -323,7 +325,6 @@
cols="1"
class="pt-0 mt-n2 align-right"
>
<!-- Actions -->
<div class="actions mr-4">
<v-btn
id="rules-undo"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ export default class SpecialResolutionSummary extends Mixins(DateMixin, FeeMixin
// Global getters
@Getter(useStore) getBusinessNumber!: string
@Getter(useStore) getCurrentFees!: FeesIF[]
// @Getter(useStore) getNameRequestLegalName!: string
// @Getter(useStore) getNameRequestNumber!: string
/** Whether to perform validation. */
@Prop() readonly validate!: boolean
Expand All @@ -152,7 +154,6 @@ export default class SpecialResolutionSummary extends Mixins(DateMixin, FeeMixin
/** The company name (from NR, or incorporation number). */
get companyName (): string {
if (this.getNameRequestLegalName) return this.getNameRequestLegalName
return `${this.getBusinessNumber || '[Incorporation Number]'} B.C. Ltd.`
}
Expand Down
1 change: 1 addition & 0 deletions src/components/ViewWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export default class ViewWrapper extends Mixins(CommonMixin, FilingTemplateMixin
@Getter(useStore) getFilingId!: number
@Getter(useStore) getFlagsCompanyInfo!: FlagsCompanyInfoIF
@Getter(useStore) getFlagsReviewCertify!: FlagsReviewCertifyIF
// @Getter(useStore) getNameRequestNumber!: string
@Getter(useStore) haveUnsavedChanges!: boolean
@Getter(useStore) isAlterationFiling!: boolean
@Getter(useStore) isBusySaving!: boolean
Expand Down
13 changes: 7 additions & 6 deletions src/components/common/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import { useStore } from '@/store/store'
export default class Actions extends Mixins(DateMixin, FilingTemplateMixin, NameRequestMixin) {
// Global getters
@Getter(useStore) getFilingId!: number
// @Getter(useStore) getNameRequestNumber!: string
@Getter(useStore) hasAlterationDataChanged!: boolean // for testing state-getters
@Getter(useStore) hasCorrectionDataChanged!: boolean
@Getter(useStore) havePeopleAndRolesChanged!: boolean // for testing state-getters
Expand Down Expand Up @@ -167,16 +168,16 @@ export default class Actions extends Mixins(DateMixin, FilingTemplateMixin, Name
// Request is invalid, and clicking OK in the pop up redirects to My Business Registry.
if (this.getNameRequestNumber) {
try {
if (this.getNameRequest.applicant) {
await this.validateNameRequest(
if (this.getNameRequest.applicants) {
await this.fetchValidateNameRequest(
this.getNameRequestNumber,
this.getNameRequest.applicant.phoneNumber,
this.getNameRequest.applicant.emailAddress)
this.getNameRequest.applicants.phoneNumber,
this.getNameRequest.applicants.emailAddress)
} else {
await this.validateNameRequest(this.getNameRequestNumber)
await this.fetchValidateNameRequest(this.getNameRequestNumber)
}
} catch (error) {
// "validateNameRequest" handles its own errors
// "fetchValidateNameRequest" handles its own errors
this.setIsFilingPaying(false)
return
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/CertifySection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default class CertifySection extends Mixins(DateMixin) {
}
/** Handler for Valid change event. */
protected onIsCertified (val: boolean): void {
onIsCertified (val: boolean): void {
this.setCertifyState(
{
valid: val,
Expand All @@ -99,7 +99,7 @@ export default class CertifySection extends Mixins(DateMixin) {
}
/** Handler for CertifiedBy change event. */
protected onCertifiedBy (val: string): void {
onCertifiedBy (val: string): void {
this.setCertifyState(
{
valid: this.getCertifyState.valid,
Expand Down
7 changes: 4 additions & 3 deletions src/components/common/PeopleAndRoles/OrgPerson.vue
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
:editableBusinessName="wasReplaced(currentOrgPerson)"
:searchStatus="searchStatus"
@setBusiness="updateBusinessDetails($event)"
@undoBusiness="resetBusinessDetails($event)"
@undoBusiness="resetBusinessDetails()"
/>
</article>
</template>
Expand Down Expand Up @@ -444,8 +444,9 @@ import { cloneDeep, isEqual } from 'lodash'
import { mask } from 'vue-the-mask'
import { v4 as uuidv4 } from 'uuid'
import { IsSame } from '@/utils/'
import { OrgPersonIF, FormIF, AddressIF, AddressSchemaIF, RoleIF, ResourceIF, EmptyBusinessLookup,
BusinessLookupIF } from '@/interfaces/'
import { OrgPersonIF, FormIF, AddressIF, AddressSchemaIF, RoleIF, ResourceIF, BusinessLookupIF }
from '@/interfaces/'
import { EmptyBusinessLookup } from '@bcrs-shared-components/interfaces/'
import { BaseAddress } from '@bcrs-shared-components/base-address'
import { HelpSection } from '@/components/common/'
import { BusinessLookup as BusinessLookupShared } from '@bcrs-shared-components/business-lookup'
Expand Down
Loading

0 comments on commit d9e21d8

Please sign in to comment.