From 030b6eada07c1b858a39f46c814a0470c4ac168a Mon Sep 17 00:00:00 2001 From: Karim El Jazzar <122301442+JazzarKarim@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:29:08 -0800 Subject: [PATCH] 18535 - Save and Resume Draft Amalgamation (#592) * Save and resume draft amalgamation * Properly initialize array if continuing a draft * updated package version --- package-lock.json | 4 ++-- package.json | 2 +- .../Amalgamation/AmalgamatingBusinesses.vue | 5 +++++ .../filing-interfaces/filing-interfaces.ts | 6 ++++-- src/mixins/filing-template-mixin.ts | 20 +++++++++++++++++-- src/store/store.ts | 8 ++++++++ 6 files changed, 38 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index bb3324427..9c6804b59 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-create-ui", - "version": "5.6.8", + "version": "5.6.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-create-ui", - "version": "5.6.8", + "version": "5.6.9", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/approval-type": "1.0.19", diff --git a/package.json b/package.json index 5b3f94ea3..b8580fdd4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-create-ui", - "version": "5.6.8", + "version": "5.6.9", "private": true, "appName": "Create UI", "sbcName": "SBC Common Components", diff --git a/src/components/Amalgamation/AmalgamatingBusinesses.vue b/src/components/Amalgamation/AmalgamatingBusinesses.vue index b7e6d3de8..0d2131f41 100644 --- a/src/components/Amalgamation/AmalgamatingBusinesses.vue +++ b/src/components/Amalgamation/AmalgamatingBusinesses.vue @@ -176,6 +176,11 @@ export default class AmalgamatingBusinesses extends Mixins(CommonMixin) { readonly BusinessLookupServices = BusinessLookupServices + // If continuing a draft, initialize the amalgamatingBusinesses array as the previously saved one. + mounted (): void { + if (this.getAmalgamatingBusinesses) this.amalgamatingBusinesses = this.getAmalgamatingBusinesses + } + // Cancel button in "Add an Amalgamating Business" is pressed. addAmalgamatingBusinessCancel (): void { this.isAddingAmalgamatingBusiness = false diff --git a/src/interfaces/filing-interfaces/filing-interfaces.ts b/src/interfaces/filing-interfaces/filing-interfaces.ts index 203dd9ed7..a1ed17dfc 100644 --- a/src/interfaces/filing-interfaces/filing-interfaces.ts +++ b/src/interfaces/filing-interfaces/filing-interfaces.ts @@ -1,5 +1,5 @@ -import { BusinessAddressIF, CourtOrderIF, RegisteredRecordsAddressesIF, NaicsIF, NameTranslationIF, - OfficeAddressIF, PartyIF, ShareClassIF, SpecialResolutionIF } from '@/interfaces' +import { AmalgamatingBusinessIF, BusinessAddressIF, CourtOrderIF, RegisteredRecordsAddressesIF, NaicsIF, + NameTranslationIF, OfficeAddressIF, PartyIF, ShareClassIF, SpecialResolutionIF } from '@/interfaces' import { AmalgamationTypes, ApprovalTypes, BusinessTypes, DissolutionStatementTypes, DissolutionTypes, FilingTypes, RestorationTypes, RelationshipTypes } from '@/enums' import { CorrectNameOptions } from '@bcrs-shared-components/enums/' @@ -41,6 +41,8 @@ export interface AmalgamationFilingIF { identifier: string } amalgamation: { + amalgamatingBusinesses: AmalgamatingBusinessIF[] + courtApproval: boolean type: AmalgamationTypes nameRequest: NameRequestFilingIF nameTranslations: NameTranslationIF[] diff --git a/src/mixins/filing-template-mixin.ts b/src/mixins/filing-template-mixin.ts index 9c62cdb8e..3a9fc91fd 100644 --- a/src/mixins/filing-template-mixin.ts +++ b/src/mixins/filing-template-mixin.ts @@ -3,8 +3,8 @@ import { Getter, Action } from 'pinia-class' import { useStore } from '@/store/store' import { DateMixin } from '@/mixins' import { - AmalgamationFilingIF, BusinessAddressIF, ContactPointIF, CertifyIF, CompletingPartyIF, CourtOrderIF, - CourtOrderStepIF, CreateMemorandumIF, CreateResolutionIF, CreateRulesIF, DefineCompanyIF, + AmalgamatingBusinessIF, AmalgamationFilingIF, BusinessAddressIF, ContactPointIF, CertifyIF, CompletingPartyIF, + CourtOrderIF, CourtOrderStepIF, CreateMemorandumIF, CreateResolutionIF, CreateRulesIF, DefineCompanyIF, DissolutionFilingIF, DissolutionStatementIF, DocumentDeliveryIF, EffectiveDateTimeIF, EmptyContactPoint, EmptyNaics, IncorporationAgreementIF, IncorporationFilingIF, NaicsIF, NameRequestFilingIF, NameTranslationIF, OfficeAddressIF, OrgPersonIF, PartyIF, PeopleAndRoleIF, RegisteredRecordsAddressesIF, @@ -24,6 +24,8 @@ import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module/' export default class FilingTemplateMixin extends Mixins(DateMixin) { @Getter(useStore) getAddPeopleAndRoleStep!: PeopleAndRoleIF @Getter(useStore) getAffidavitStep!: UploadAffidavitIF + @Getter(useStore) getAmalgamatingBusinesses!: AmalgamatingBusinessIF[] + @Getter(useStore) getAmalgamationCourtApproval!: boolean @Getter(useStore) getAmalgamationType!: AmalgamationTypes @Getter(useStore) getBusinessContact!: ContactPointIF @Getter(useStore) getBusinessFoundingDate!: string @@ -70,6 +72,8 @@ export default class FilingTemplateMixin extends Mixins(DateMixin) { @Action(useStore) setAffidavit!: (x: UploadAffidavitIF) => void @Action(useStore) setAmalgamationType!: (x: AmalgamationTypes) => void + @Action(useStore) setAmalgamatingBusinesses!: (x: Array) => void + @Action(useStore) setAmalgamationCourtApproval!: (x: boolean) => void @Action(useStore) setBusinessAddress!: (x: OfficeAddressIF) => void @Action(useStore) setBusinessContact!: (x: ContactPointIF) => void @Action(useStore) setCertifyState!: (x: CertifyIF) => void @@ -146,6 +150,7 @@ export default class FilingTemplateMixin extends Mixins(DateMixin) { identifier: this.getTempId }, amalgamation: { + amalgamatingBusinesses: this.getAmalgamatingBusinesses, type: this.getAmalgamationType, nameRequest: { legalType: this.getEntityType @@ -160,6 +165,7 @@ export default class FilingTemplateMixin extends Mixins(DateMixin) { ? { extension: +this.getBusinessContact.extension } : {} }, + courtApproval: this.getAmalgamationCourtApproval, parties: fixNullAddressType(this.getAddPeopleAndRoleStep.orgPeople) } } @@ -217,6 +223,16 @@ export default class FilingTemplateMixin extends Mixins(DateMixin) { // restore Entity Type this.setEntityType(draftFiling.amalgamation.nameRequest.legalType) + // restore the amalgamating businesses array + if (draftFiling.amalgamation.amalgamatingBusinesses) { + this.setAmalgamatingBusinesses(draftFiling.amalgamation.amalgamatingBusinesses) + } + + // restore the amalgamation court approval + if (draftFiling.amalgamation.courtApproval) { + this.setAmalgamationCourtApproval(draftFiling.amalgamation.courtApproval) + } + // restore Office Addresses // *** TODO: verify whether we need to assign fallback // *** also fix IAs and registrations the same way? diff --git a/src/store/store.ts b/src/store/store.ts index 695536be0..1e60169a9 100644 --- a/src/store/store.ts +++ b/src/store/store.ts @@ -752,6 +752,11 @@ export const useStore = defineStore('store', { return this.stateModel.amalgamation.amalgamatingBusinessesValid }, + /** The amalgamation court approval. */ + getAmalgamationCourtApproval (): boolean { + return this.stateModel.amalgamation.courtApproval + }, + // // Dissolution getters // @@ -1236,6 +1241,9 @@ export const useStore = defineStore('store', { setAmalgamatingBusinessesValid (valid: boolean) { this.stateModel.amalgamation.amalgamatingBusinessesValid = valid }, + setAmalgamationCourtApproval (courtApproval: boolean) { + this.stateModel.amalgamation.courtApproval = courtApproval + }, setAmalgamationType (type: AmalgamationTypes) { this.stateModel.amalgamation.type = type },