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

18689 More Amalgamation fixes/updates #614

Merged
merged 5 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
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.28",
"version": "5.6.29",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
19 changes: 17 additions & 2 deletions src/components/common/Actions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,13 @@ import { Component, Emit, Mixins } from 'vue-property-decorator'
import { Getter, Action } from 'pinia-class'
import { useStore } from '@/store/store'
import { Navigate } from '@/utils'
import { CommonMixin, DateMixin, FilingTemplateMixin, NameRequestMixin } from '@/mixins'
import { AmalgamationMixin, CommonMixin, DateMixin, FilingTemplateMixin, NameRequestMixin } from '@/mixins'
import { LegalServices } from '@/services/'
import { FilingTypes, NameRequestStates, RouteNames } from '@/enums'

@Component({})
export default class Actions extends Mixins(CommonMixin, DateMixin, FilingTemplateMixin, NameRequestMixin) {
export default class Actions extends Mixins(AmalgamationMixin, CommonMixin,
DateMixin, FilingTemplateMixin, NameRequestMixin) {
@Getter(useStore) getCurrentStep!: number
@Getter(useStore) getEntityIdentifier!: string
@Getter(useStore) getFilingType!: string
Expand Down Expand Up @@ -138,6 +139,7 @@ export default class Actions extends Mixins(CommonMixin, DateMixin, FilingTempla

get isSummaryStep (): boolean {
return (
this.$route.name === RouteNames.AMALG_REG_REVIEW_CONFIRM ||
this.$route.name === RouteNames.DISSOLUTION_REVIEW_CONFIRM ||
this.$route.name === RouteNames.INCORPORATION_REVIEW_CONFIRM ||
this.$route.name === RouteNames.REGISTRATION_REVIEW_CONFIRM ||
Expand Down Expand Up @@ -246,6 +248,19 @@ export default class Actions extends Mixins(CommonMixin, DateMixin, FilingTempla
}
}

// If we're filing an amalgamation, we need to re-fetch the business table data on file and pay.
// We do that in case one of the businesses became invalid (e.g. historical) while the draft is open.
if (this.getFilingType === FilingTypes.AMALGAMATION_APPLICATION) {
try {
await this.refetchAmalgamatingBusinessesInfo()
console.log(this.getAmalgamatingBusinesses)
} catch (error) {
console.log('Error validating table in onClickFilePay(): ', error) // eslint-disable-line no-console
this.setIsFilingPaying(false)
return
}
}

let filingComplete: any
try {
const filing = await this.prepareFiling()
Expand Down
5 changes: 3 additions & 2 deletions src/mixins/amalgamation-mixin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Vue } from 'vue-property-decorator'
import { Action, Getter } from 'pinia-class'
import { useStore } from '@/store/store'
import { AmlRoles, AmlStatuses, AmlTypes, RestorationTypes } from '@/enums'
import { AmlRoles, AmlStatuses, AmlTypes, EntityStates, RestorationTypes } from '@/enums'
import { AmalgamatingBusinessIF } from '@/interfaces'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module'
import { AuthServices, LegalServices } from '@/services'
Expand Down Expand Up @@ -221,7 +221,8 @@ export default class AmalgamationMixin extends Vue {
address: tingBusiness.addresses?.registeredOffice.mailingAddress || null,
isNotInGoodStanding: (tingBusiness.businessInfo.goodStanding === false),
isFutureEffective: (tingBusiness.firstFiling.isFutureEffective === true),
isLimitedRestoration: await this.isLimitedRestoration(tingBusiness)
isLimitedRestoration: await this.isLimitedRestoration(tingBusiness),
isHistorical: (tingBusiness.businessInfo.state === EntityStates.HISTORICAL)
Copy link
Collaborator Author

@JazzarKarim JazzarKarim Jan 8, 2024

Choose a reason for hiding this comment

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

This was missing. We want to re-fetch this.

} as AmalgamatingBusinessIF
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -588,17 +588,20 @@ export const useStore = defineStore('store', {

/** Whether all the amalgamation (regular) steps are valid. */
isAmalgamationRegularValid (): boolean {
// *** TODO: add checks for review page components
const isFolioNumberValid = !this.isPremiumAccount || this.getFolioNumberValid
const isCertifyValid = this.getCertifyState.valid && !!this.getCertifyState.certifiedBy
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Found this missing. Now we're not able to file and pay if the review and confirm page is invalid.

const isCourtOrderValid = this.isRoleStaff ? this.getCourtOrderStep.valid : true
const isFolioNumberValid = !this.isPremiumAccount || this.getFolioNumberValid
const isStaffPaymentValid = this.isRoleStaff ? this.getStaffPaymentStep.valid : true

return (
this.isAmalgamationInformationRegValid &&
this.isDefineCompanyValid &&
this.isAddPeopleAndRolesValid &&
this.isCreateShareStructureValid &&
isFolioNumberValid &&
isCertifyValid &&
isCourtOrderValid &&
isFolioNumberValid &&
isStaffPaymentValid &&
this.getAmalgamationCourtApprovalValid
)
},
Expand Down
Loading