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

18749 - add amalgamation statement to review #609

Merged
merged 15 commits into from
Jan 5, 2024
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.23",
"version": "5.6.24",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
119 changes: 119 additions & 0 deletions src/components/Amalgamation/AmalgamationStatement.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
<template>
<v-card
id="amalgamation-statement"
flat
>
<v-row>
<v-col
cols="12"
sm="3"
class="pr-4"
>
<label>
Amalgamation Statement
</label>
</v-col>

<v-col
cols="12"
sm="9"
>
<v-radio-group
v-model="courtApproval"
class="mt-0 pt-0"
@change="setCourtApproval()"
>
<v-radio
class="radio-button"
label="With Court Approval"
:value="true"
/>
<div
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
class="ml-8 statement-text"
>
This amalgamation has been approved by the court and a copy of the
entered court order approving the amalgamation has been obtained
and has been deposited in the records office of each of the
amalgamating companies.
</div>

<v-radio
class="pt-4 radio-button"
label="Without Court Approval"
:value="false"
/>
<div
class="ml-8 statement-text"
>
This amalgamation has been effected without court approval.
A copy of all of the required affidavits under section 277(1)
have been obtained and the affidavit obtained from each
amalgamating company has been deposited in that company’s
records office.
</div>
</v-radio-group>
</v-col>
</v-row>
</v-card>
</template>

<script lang="ts">
import Vue from 'vue'
import { Component, Emit } from 'vue-property-decorator'
import { AmalgamationStateIF } from '@/interfaces/store-interfaces/state-interfaces/amalgamation-state-interface'
import { Getter } from 'pinia-class'
import { useStore } from '@/store/store'

@Component({})
export default class AmalgamationStatement extends Vue {
@Getter(useStore) getAmalgamationCourtApproval!: boolean

// Local properties
courtApproval: AmalgamationStateIF['courtApproval'] = null
tshyun24 marked this conversation as resolved.
Show resolved Hide resolved

/** Called when component is mounted. */
mounted (): void {
if (this.getAmalgamationCourtApproval != null) {
this.courtApproval = this.getAmalgamationCourtApproval
}
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
}

// Emit a boolean which is whether the court approval have been selected
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
@Emit('update')
private courtApprovalUpdate (): boolean {
console.log(this.courtApproval)
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
return this.courtApproval
}

// Emit a boolean (validation) which is either option being selected
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
@Emit('valid')
private amalgamationStatementValid (event: boolean): boolean {
return event
}
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved

// Once either option being selected, update court approval and validation
setCourtApproval (): void {
this.courtApprovalUpdate()
this.amalgamationStatementValid(true)
}
}
</script>

<style lang="scss" scoped>
@import '@/assets/styles/theme.scss';

#amalgamation-statement {
padding: 1.25rem;
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
line-height: 1.2rem;
font-size: 1rem;
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
}

.statement-text {
color: $gray7;
}

label {
font-weight: bold;
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
}

</style>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add this for validation

Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@ export interface AmalgamationStateIF {
amalgamatingBusinesses: Array<AmalgamatingBusinessIF>
amalgamatingBusinessesValid: boolean
courtApproval: boolean
courtApprovalValid: boolean
type: AmalgamationTypes
}
2 changes: 1 addition & 1 deletion src/mixins/filing-template-mixin.ts
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
}

// restore the amalgamation court approval
if (draftFiling.amalgamationApplication.courtApproval) {
if (draftFiling.amalgamationApplication.courtApproval != null) {
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
this.setAmalgamationCourtApproval(draftFiling.amalgamationApplication.courtApproval)
}

Expand Down
1 change: 1 addition & 0 deletions src/store/state/state-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export const stateModel: StateModelIF = {
amalgamatingBusinesses: [],
amalgamatingBusinessesValid: false,
courtApproval: null,
courtApprovalValid: false,
type: null
},
restoration: {
Expand Down
12 changes: 11 additions & 1 deletion src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -591,14 +591,16 @@ export const useStore = defineStore('store', {
// *** TODO: add checks for review page components
const isFolioNumberValid = !this.isPremiumAccount || this.getFolioNumberValid
const isCourtOrderValid = this.isRoleStaff ? this.getCourtOrderStep.valid : true
const isCourtApprovalValid = this.getAmalgamationCourtApprovalValid
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved

return (
this.isAmalgamationInformationRegValid &&
this.isDefineCompanyValid &&
this.isAddPeopleAndRolesValid &&
this.isCreateShareStructureValid &&
isFolioNumberValid &&
isCourtOrderValid
isCourtOrderValid &&
isCourtApprovalValid
)
},

Expand Down Expand Up @@ -780,6 +782,11 @@ export const useStore = defineStore('store', {
return this.stateModel.amalgamation.courtApproval
},

/** The amalgamation court approval validity. */
getAmalgamationCourtApprovalValid (): boolean {
return this.stateModel.amalgamation.courtApprovalValid
},

//
// Dissolution getters
//
Expand Down Expand Up @@ -1275,6 +1282,9 @@ export const useStore = defineStore('store', {
setAmalgamationCourtApproval (courtApproval: boolean) {
this.stateModel.amalgamation.courtApproval = courtApproval
},
setAmalgamationCourtApprovalValid (valid: boolean) {
this.stateModel.amalgamation.courtApprovalValid = valid
},
setAmalgamationType (type: AmalgamationTypes) {
this.stateModel.amalgamation.type = type
},
Expand Down
21 changes: 18 additions & 3 deletions src/views/AmalgamationRegular/ReviewConfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,21 @@
<header>
<h2>Amalgamation Statement</h2>
<p class="mt-4">
[*** TODO: blurb ***]
Please indicate the statement applicable to this amalgamation.
</p>
</header>

<v-card
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
flat
class="mt-6"
>
<div class="pa-4">
[*** TODO: Amalgamation Statement component ***]
<div class="pt-4 pr-4 pl-1">
<AmalgamationStatement
:class="{ 'invalid-section': isAmalgamationStatementInvalid }"
:invalidSection="isAmalgamationStatementInvalid"
@update="setAmalgamationCourtApproval($event)"
@valid="setAmalgamationCourtApprovalValid($event)"
/>
</div>
</v-card>
</section>
Expand Down Expand Up @@ -280,6 +285,7 @@ import { CourtOrderPoa } from '@bcrs-shared-components/court-order-poa'
import { DocumentDelivery } from '@bcrs-shared-components/document-delivery'
import FolioNumber from '@/components/common/FolioNumber.vue'
import BusinessTableSummary from '@/components/Amalgamation/BusinessTableSummary.vue'
import AmalgamationStatement from '@/components/Amalgamation/AmalgamationStatement.vue'
import IncorporationDateTime from '@/components/Incorporation/IncorporationDateTime.vue'
import ListPeopleAndRoles from '@/components/common/ListPeopleAndRoles.vue'
import ListShareClass from '@/components/common/ListShareClass.vue'
Expand All @@ -289,6 +295,7 @@ import { CorpTypeCd, GetCorpFullDescription } from '@bcrs-shared-components/corp

@Component({
components: {
AmalgamationStatement,
BusinessTableSummary,
CardHeader,
Certify,
Expand All @@ -304,6 +311,7 @@ import { CorpTypeCd, GetCorpFullDescription } from '@bcrs-shared-components/corp
})
export default class AmalgamationRegularReviewConfirm extends Vue {
@Getter(useStore) getAmalgamatingBusinessesValid!: boolean
@Getter(useStore) getAmalgamationCourtApprovalValid!: boolean
@Getter(useStore) getBusinessContact!: ContactPointIF
@Getter(useStore) getCertifyState!: CertifyIF
@Getter(useStore) getCourtOrderStep!: CourtOrderStepIF
Expand All @@ -318,6 +326,8 @@ export default class AmalgamationRegularReviewConfirm extends Vue {
@Getter(useStore) isPremiumAccount!: boolean
@Getter(useStore) isRoleStaff!: boolean

@Action(useStore) setAmalgamationCourtApproval!: (x: boolean) => void
@Action(useStore) setAmalgamationCourtApprovalValid!: (x: boolean) => void
@Action(useStore) setCertifyState!: (x: CertifyIF) => void
@Action(useStore) setCourtOrderFileNumber!: (x: string) => void
@Action(useStore) setCourtOrderValidity!: (x: boolean) => void
Expand Down Expand Up @@ -352,6 +362,11 @@ export default class AmalgamationRegularReviewConfirm extends Vue {
get isFolioInvalid (): boolean {
return this.getValidateSteps && !(this.getFolioNumberValid)
}

/** Is true when the amalgamation statement is not valid */
get isAmalgamationStatementInvalid (): boolean {
return this.getValidateSteps && !(this.getAmalgamationCourtApprovalValid)
}
}
</script>

Expand Down
Loading