Skip to content

Commit

Permalink
18535 - Save and Resume Draft Amalgamation (#592)
Browse files Browse the repository at this point in the history
* Save and resume draft amalgamation

* Properly initialize array if continuing a draft

* updated package version
  • Loading branch information
JazzarKarim authored Dec 7, 2023
1 parent eaca75d commit 3fbf5c8
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 7 deletions.
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.6.8",
"version": "5.6.9",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
5 changes: 5 additions & 0 deletions src/components/Amalgamation/AmalgamatingBusinesses.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/interfaces/filing-interfaces/filing-interfaces.ts
Original file line number Diff line number Diff line change
@@ -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/'
Expand Down Expand Up @@ -41,6 +41,8 @@ export interface AmalgamationFilingIF {
identifier: string
}
amalgamation: {
amalgamatingBusinesses: AmalgamatingBusinessIF[]
courtApproval: boolean
type: AmalgamationTypes
nameRequest: NameRequestFilingIF
nameTranslations: NameTranslationIF[]
Expand Down
20 changes: 18 additions & 2 deletions src/mixins/filing-template-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down Expand Up @@ -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<any>) => 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
Expand Down Expand Up @@ -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
Expand All @@ -160,6 +165,7 @@ export default class FilingTemplateMixin extends Mixins(DateMixin) {
? { extension: +this.getBusinessContact.extension }
: {}
},
courtApproval: this.getAmalgamationCourtApproval,
parties: fixNullAddressType(this.getAddPeopleAndRoleStep.orgPeople)
}
}
Expand Down Expand Up @@ -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?
Expand Down
8 changes: 8 additions & 0 deletions src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,11 @@ export const useStore = defineStore('store', {
return this.stateModel.amalgamation.amalgamatingBusinessesValid
},

/** The amalgamation court approval. */
getAmalgamationCourtApproval (): boolean {
return this.stateModel.amalgamation.courtApproval
},

//
// Dissolution getters
//
Expand Down Expand Up @@ -1232,6 +1237,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
},
Expand Down

0 comments on commit 3fbf5c8

Please sign in to comment.