Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

18535 - Save and Resume Draft Amalgamation #592

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so you have the array in the store and a local copy here... I may rework this after you merge and I rebase.


// 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
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we had a ticket to implement the court approval component, but I can't find it. Can you? If not, please create one in the epic that we can groom tomorrow.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@severinbeauvais severinbeauvais Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks. (I've updated its title to make it easier to find next time 😉 )

I guess you can check off a couple of items in that ticket.

And maybe link this PR to that ticket as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, will do that.

setAmalgamationType (type: AmalgamationTypes) {
this.stateModel.amalgamation.type = type
},
Expand Down
Loading