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

22846 - show resolution dates in amalgamations #745

Merged
merged 6 commits into from
Oct 11, 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
89 changes: 89 additions & 0 deletions src/components/common/ListResolutions.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
<template>
<div
v-if="resolutionList.length > 0"
id="list-resolutions"
>
<v-divider class="mx-4" />
<article class="pa-4">
<v-row no-gutters>
<v-col
cols="12"
sm="3"
class="pr-4"
>
<label
id="resolution-label"
>Resolution or court Order Dates</label>
</v-col>
<v-col
cols="12"
sm="9"
class="pt-sm-0"
severinbeauvais marked this conversation as resolved.
Show resolved Hide resolved
>
<p>
Dates of resolution or court orders to alter the company's share structure or the
special rights or restrictions to a class or a series of shares:
</p>
</v-col>
</v-row>
<v-row no-gutters>
<v-col
cols="12"
sm="3"
class="pr-4"
/>
<v-col
cols="12"
sm="9"
class="pt-sm-0"
>
<div>
<tr
v-for="(item, index) in resolutionList"
:key="index"
>
<td class="font-weight-bold">
{{ item.date }}
</td>
</tr>
</div>
</v-col>
</v-row>
</article>
</div>
</template>

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

@Component({})
export default class ListResolutions extends Vue {
@Getter(useStore) getResolutions!: ResolutionIF[]

get resolutionList (): ResolutionIF[] {
return this.getResolutions
}
}
</script>

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

#list-resolutions {
font-size: $px-14;
color: $gray7;

p {
font-size: $px-14;
}
}

label {
font-weight: bold;
color: $gray9;
}

</style>
33 changes: 28 additions & 5 deletions src/components/common/ListShareClass.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,23 @@
disable-pagination
disable-sort
hide-default-footer
hide-default-header
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

used hide-default-header to apply custom style.

>
<template
#header="{ props: { headers } }"
>
<thead>
<tr>
<th
v-for="(h, index) in headers"
:key="index"
:class="h.class"
>
<span>{{ h.text }}</span>
</th>
</tr>
</thead>
</template>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As this is a common component, this is how it looks when just a list:
Before/DEV:
image

After:
image

When in edit mode:
Before/DEV:
image

After:
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

Awesome! Looks great.

<template #item="row">
<!-- Share Class Rows-->
<tr
Expand Down Expand Up @@ -241,12 +257,13 @@ export default class ListShareClass extends Vue {
text: 'Name of Share Class or Series',
align: 'start',
sortable: false,
value: 'name'
value: 'name',
class: 'share-structure-header'
},
{ text: 'Maximum Number of Shares', value: 'maxNumberOfShares' },
{ text: 'Par Value', value: 'parValue' },
{ text: 'Currency', value: 'currency' },
{ text: 'Special Rights or Restrictions', value: 'hasRightsOrRestrictions' },
{ text: 'Maximum Number of Shares', value: 'maxNumberOfShares', class: 'share-structure-header' },
{ text: 'Par Value', value: 'parValue', class: 'share-structure-header' },
{ text: 'Currency', value: 'currency', class: 'share-structure-header' },
{ text: 'Special Rights or Restrictions', value: 'hasRightsOrRestrictions', class: 'share-structure-header' },
{ text: '', value: 'actions' }
]

Expand Down Expand Up @@ -412,4 +429,10 @@ tbody {
.v-icon.mdi-information-outline {
margin-top: -2px;
}

.share-structure-header {
font-size: $px-14 !important;
color: $gray9 !important;
font-weight: bold !important;
}
</style>
5 changes: 4 additions & 1 deletion src/interfaces/filing-interfaces/filing-interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AmalgamatingBusinessIF, BusinessAddressIF, AuthorizationProofIF, CourtOrderIF, NaicsIF,
NameTranslationIF, OfficeAddressIF, OrgPersonIF, PartyIF, RegisteredRecordsAddressesIF, ShareClassIF,
SpecialResolutionIF } from '@/interfaces'
SpecialResolutionIF,
ResolutionIF } from '@/interfaces'
import { AmalgamationTypes, ApprovalTypes, BusinessTypes, DissolutionStatementTypes, DissolutionTypes,
FilingStatus, FilingTypes, RestorationTypes, RelationshipTypes } from '@/enums'
import { CorrectNameOptions, EntityStates } from '@bcrs-shared-components/enums/'
Expand Down Expand Up @@ -60,6 +61,8 @@ export interface AmalgamationFilingIF {
incorporationAgreement?: {
agreementType: string
}
resolutions: ResolutionIF[]

// ULC only:
courtOrder?: CourtOrderIF
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,9 @@ export interface SpecialResolutionIF {
signingDate: string
signatory: PersonIF
}

export interface ResolutionIF {
date: string
id: number
type: string
}
4 changes: 3 additions & 1 deletion src/interfaces/store-interfaces/state-interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import {
ShareStructureIF,
StaffPaymentStepIF,
TombstoneIF,
UploadAffidavitIF
UploadAffidavitIF,
ResolutionIF
} from '@/interfaces'

// State model interface
Expand Down Expand Up @@ -77,6 +78,7 @@ export interface StateModelIF {
amalgamation: AmalgamationStateIF
continuationIn: ContinuationInStateIF
restoration: RestorationStateIF
resolutions?: ResolutionIF[]

// staffPaymentStep and courtOrder are common and for now are only used in dissolution
staffPaymentStep: StaffPaymentStepIF
Expand Down
9 changes: 6 additions & 3 deletions src/mixins/amalgamation-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
import {
AmalgamatingBusinessIF, ContactPointIF, EmptyContactPoint, EmptyNameRequest, NameRequestIF,
NameTranslationIF, OrgPersonIF, PeopleAndRoleIF, RegisteredRecordsAddressesIF, ResourceIF,
ShareClassIF
ShareClassIF, ResolutionIF
} from '@/interfaces'
import { CorrectNameOptions } from '@bcrs-shared-components/enums/'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module'
Expand Down Expand Up @@ -44,6 +44,7 @@ export default class AmalgamationMixin extends Vue {
@Action(useStore) setOrgPersonList!: (x: OrgPersonIF[]) => void
@Action(useStore) setResources!: (x: ResourceIF) => void
@Action(useStore) setShareClasses!: (x: ShareClassIF[]) => void
@Action(useStore) setResolutions!: (x: ResolutionIF[]) => void

/** Iterable array of rule functions, in order of evaluation. */
readonly rules = [
Expand Down Expand Up @@ -390,10 +391,11 @@ export default class AmalgamationMixin extends Vue {
// NB - addresses and auth info have already been fetched (and checked above)
// NB - make all API calls concurrently without rejection
// NB - if any call failed, that item will be null
const [ directors, shareStructure ] =
const [ directors, shareStructure, resolutions ] =
await Promise.allSettled([
LegalServices.fetchDirectors(business.identifier),
LegalServices.fetchShareStructure(business.identifier)
LegalServices.fetchShareStructure(business.identifier),
LegalServices.fetchResolutions(business.identifier)
]).then(results => results.map((result: any) => result.value || null))

// check for errors before changing anything
Expand Down Expand Up @@ -424,6 +426,7 @@ export default class AmalgamationMixin extends Vue {

// overwrite share structure
this.setShareClasses(shareStructure.shareClasses)
this.setResolutions(resolutions)

// overwrite business contact -- only when user has marked new holding/primary business,
// otherwise leave existing data from restored draft
Expand Down
14 changes: 11 additions & 3 deletions src/mixins/filing-template-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
ExistingBusinessInfoIF, IncorporationAgreementIF, IncorporationFilingIF, NaicsIF, NrApplicantIF,
NameRequestFilingIF, NameTranslationIF, OfficeAddressIF, OrgPersonIF, PartyIF,
RegistrationFilingIF, RegistrationStateIF, RestorationFilingIF, RestorationStateIF,
ShareStructureIF, SpecialResolutionIF, StaffPaymentIF, StaffPaymentStepIF, UploadAffidavitIF
} from '@/interfaces'
ShareStructureIF, SpecialResolutionIF, StaffPaymentIF, StaffPaymentStepIF, UploadAffidavitIF,
ResolutionIF } from '@/interfaces'
import {
AmalgamationTypes, ApprovalTypes, BusinessTypes, CoopTypes, DissolutionTypes, EffectOfOrders,
FilingTypes, PartyTypes, RelationshipTypes, RestorationTypes, RoleTypes, StaffPaymentOptions
Expand Down Expand Up @@ -73,6 +73,7 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
@Getter(useStore) isEntityFirm!: boolean
@Getter(useStore) isEntitySoleProp!: boolean
@Getter(useStore) isPremiumAccount!: boolean
@Getter(useStore) getResolutions!: ResolutionIF[]

@Action(useStore) setAffidavit!: (x: UploadAffidavitIF) => void
@Action(useStore) setAmalgamationType!: (x: AmalgamationTypes) => void
Expand Down Expand Up @@ -166,7 +167,8 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
parties: this.fixOrgPeopleProperties(this.getAddPeopleAndRoleStep.orgPeople),
shareStructure: {
shareClasses: this.getCreateShareStructureStep.shareClasses
}
},
resolutions: this.getResolutions
}
}

Expand Down Expand Up @@ -247,6 +249,12 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM
this.setShareClasses(draftFiling.amalgamationApplication.shareStructure.shareClasses)
}

// restore Resolutions
// NB - short-form amalg will overwrite this from the holding/primary business
if (draftFiling.amalgamationApplication.resolutions) {
this.setShareClasses(draftFiling.amalgamationApplication.resolutions)
}

// restore business name data
const nameRequest = draftFiling.amalgamationApplication.nameRequest as NameRequestFilingIF
switch (nameRequest?.correctNameOption) {
Expand Down
20 changes: 19 additions & 1 deletion src/services/legal-services.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AxiosInstance as axios } from '@/utils'
import { StatusCodes } from 'http-status-codes'
import { BusinessIF, DissolutionFilingIF, IncorporationFilingIF, NameRequestIF, OrgPersonIF }
import { BusinessIF, DissolutionFilingIF, IncorporationFilingIF, NameRequestIF, OrgPersonIF, ResolutionIF }
from '@/interfaces'
import { FilingTypes, RoleTypes } from '@/enums'
import { ShareStructureIF } from '@bcrs-shared-components/interfaces'
Expand Down Expand Up @@ -247,6 +247,24 @@ export default class LegalServices {
})
}

/**
* Fetch the resolutions of the current business.
* @param businessId the business identifier
* @returns a promise to return the resolutions
*/
static async fetchResolutions (businessId: string): Promise<ResolutionIF[]> {
const url = `businesses/${businessId}/resolutions`

return axios.get(url)
.then(response => {
const resolutions = response?.data.resolutions

if (!resolutions) throw new Error('Invalid API response')

return resolutions
})
}

/**
* Fetches the addresses.
* @param businessId the business identifier
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 @@ -237,5 +237,6 @@ export const stateModel: StateModelIF = {
},
completingParty: null,
parties: null,
resolutions: [],
windowWidth: 0
}
12 changes: 11 additions & 1 deletion src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ import {
StateIF,
StepIF,
UploadAffidavitIF,
ValidationDetailIF
ValidationDetailIF,
ResolutionIF
} from '@/interfaces'
import { GetFeatureFlag } from '@/utils/feature-flag-utils'

Expand Down Expand Up @@ -1028,6 +1029,11 @@ export const useStore = defineStore('store', {
return this.stateModel.parties
},

/** The resolutions list. */
getResolutions (): ResolutionIF[] {
return this.stateModel.resolutions
},

//
// The getters below return values from the current resource
// model -- in other words, for the currently-selected entity type.
Expand Down Expand Up @@ -1433,6 +1439,10 @@ export const useStore = defineStore('store', {
setParties (parties: Array<PartyIF>) {
this.stateModel.parties = parties
},
setResolutions (resolutions: ResolutionIF[]) {
this.stateModel.resolutions = resolutions
if (!this.stateModel.ignoreChanges) this.stateModel.haveChanges = true
},
setAdminFreeze (adminFreeze: boolean) {
this.stateModel.business.adminFreeze = adminFreeze
},
Expand Down
3 changes: 3 additions & 0 deletions src/views/Amalgamation/ReviewConfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
:showErrorSummary="showErrorSummary"
:isAmalgamationFiling="true"
/>
<ListResolutions />
</v-card>
</section>

Expand Down Expand Up @@ -283,6 +284,7 @@ import ListShareClass from '@/components/common/ListShareClass.vue'
import SummaryDefineCompany from '@/components/common/SummaryDefineCompany.vue'
import StaffPayment from '@/components/common/StaffPayment.vue'
import { CorpTypeCd, GetCorpFullDescription } from '@bcrs-shared-components/corp-type-module'
import ListResolutions from '@/components/common/ListResolutions.vue'

@Component({
components: {
Expand All @@ -296,6 +298,7 @@ import { CorpTypeCd, GetCorpFullDescription } from '@bcrs-shared-components/corp
EffectiveDateTime,
ListPeopleAndRoles,
ListShareClass,
ListResolutions,
SummaryDefineCompany,
StaffPayment
}
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/AmalgamationReviewConfirm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { DocumentDelivery } from '@bcrs-shared-components/document-delivery'
import Certify from '@/components/common/Certify.vue'
import StaffPayment from '@/components/common/StaffPayment.vue'
import { AmalgamationTypes, FilingTypes } from '@bcrs-shared-components/enums'
import ListResolutions from '@/components/common/ListResolutions.vue'

// Test Case Data
const amalgamationBusinessInfo = [
Expand Down Expand Up @@ -83,6 +84,7 @@ for (const test of amalgamationBusinessInfo) {
vcard = section.find('#share-structure-vcard')
expect(vcard.findComponent(CardHeader).attributes('label')).toBe('Share Structure')
expect(vcard.findComponent(ListShareClass).exists()).toBe(true)
expect(vcard.findComponent(ListResolutions).exists()).toBe(true)
})

it('displays Amalgamation Date and Time section', () => {
Expand Down Expand Up @@ -183,6 +185,7 @@ for (const test of amalgamationBusinessInfo) {
vcard = section.find('#share-structure-vcard')
expect(vcard.findComponent(CardHeader).attributes('label')).toBe('Share Structure')
expect(vcard.findComponent(ListShareClass).exists()).toBe(true)
expect(vcard.findComponent(ListResolutions).exists()).toBe(true)
})

it('displays Amalgamation Date and Time section', () => {
Expand Down
Loading
Loading