Skip to content

Commit

Permalink
17347 - Add additional fields to Correction (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jxio authored Sep 18, 2023
1 parent 231123c commit df2a497
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 21 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-edit-ui",
"version": "4.6.2",
"version": "4.6.3",
"private": true,
"appName": "Edit UI",
"sbcName": "SBC Common Components",
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/YourCompany/FolioInformation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default class FolioInformation extends Mixins(CommonMixin) {
/** Helps builds edit label and determine if folio number update should be instant. */
get isInstantUpdate (): boolean {
return this.isAlterationFiling || this.isSpecialResolutionFiling
return this.isAlterationFiling
}
/** Modifies label for instant update of folio number. */
Expand Down
24 changes: 19 additions & 5 deletions src/components/common/YourCompany/OfficeAddresses.vue
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ export default class OfficeAddresses extends Mixins(CommonMixin) {
@Getter(useStore) isAlterationFiling!: boolean
@Getter(useStore) isBenBcCccUlc!: boolean
@Getter(useStore) isBenBcCccUlcCorrectionFiling!: boolean
@Getter(useStore) isCoopCorrectionFiling!: boolean
@Getter(useStore) isCorrectionFiling!: boolean
@Getter(useStore) isFirmChangeFiling!: boolean
@Getter(useStore) isFirmConversionFiling!: boolean
Expand Down Expand Up @@ -711,7 +712,8 @@ export default class OfficeAddresses extends Mixins(CommonMixin) {
* Sets local address data and "inherit" flags from store.
*/
private setLocalProperties (): void {
if (this.isBenBcCccUlcCorrectionFiling || this.isAlterationFiling || this.isRestorationFiling) {
if (this.isBenBcCccUlcCorrectionFiling || this.isAlterationFiling ||
this.isRestorationFiling) {
// assign registered office addresses (may be {})
this.mailingAddress = { ...this.getOfficeAddresses?.registeredOffice?.mailingAddress }
this.deliveryAddress = { ...this.getOfficeAddresses?.registeredOffice?.deliveryAddress }
Expand Down Expand Up @@ -747,15 +749,15 @@ export default class OfficeAddresses extends Mixins(CommonMixin) {
IsSame(this.recMailingAddress, this.recDeliveryAddress, ['addressType', 'addressCountryDescription', 'id'])
)
}
if (this.isFirmChangeFiling || this.isFirmConversionFiling || this.isFirmCorrectionFiling) {
if (this.isFirmChangeFiling || this.isFirmConversionFiling ||
this.isFirmCorrectionFiling) {
// assign business office addresses (may be {})
this.mailingAddress = { ...this.getOfficeAddresses?.businessOffice?.mailingAddress }
this.deliveryAddress = { ...this.getOfficeAddresses?.businessOffice?.deliveryAddress }
this.initializeNonRecordsAddressValidation()
}
if (this.isSpecialResolutionFiling) {
if (this.isSpecialResolutionFiling || this.isCoopCorrectionFiling) {
// assign registered office addresses (may be {})
this.mailingAddress = { ...this.getOfficeAddresses?.registeredOffice?.mailingAddress }
this.deliveryAddress = { ...this.getOfficeAddresses?.registeredOffice?.deliveryAddress }
Expand Down Expand Up @@ -940,7 +942,8 @@ export default class OfficeAddresses extends Mixins(CommonMixin) {
})
}
if (this.isFirmChangeFiling || this.isFirmConversionFiling || this.isFirmCorrectionFiling) {
if (this.isFirmChangeFiling || this.isFirmConversionFiling ||
this.isFirmCorrectionFiling) {
// at the moment, only firm changes, conversions and corrections are supported
this.setOfficeAddresses({
businessOffice: {
Expand All @@ -949,6 +952,16 @@ export default class OfficeAddresses extends Mixins(CommonMixin) {
}
})
}
if (this.isCoopCorrectionFiling) {
// at the moment, only coop changes, corrections are supported
this.setOfficeAddresses({
registeredOffice: {
deliveryAddress: this.deliveryAddress,
mailingAddress: this.mailingAddress
}
})
}
}
/**
Expand Down Expand Up @@ -1017,6 +1030,7 @@ export default class OfficeAddresses extends Mixins(CommonMixin) {
@Watch('isBenBcCccUlcCorrectionFiling')
@Watch('isFirmCorrectionFiling')
@Watch('isRestorationFiling')
@Watch('isCoopCorrectionFiling')
private updateAddresses (): void {
// set local properties from store
this.setLocalProperties()
Expand Down
3 changes: 2 additions & 1 deletion src/components/common/YourCompany/RecognitionDateTime.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ export default class RecognitionDateTime extends Vue {
@Getter(useStore) getCorrectedFilingDate!: string
@Getter(useStore) isAlterationFiling!: boolean
@Getter(useStore) isBenBcCccUlcCorrectionFiling!: boolean
@Getter(useStore) isCoopCorrectionFiling!: boolean
@Getter(useStore) isRestorationFiling!: boolean
/** The recognition date or business start date string. */
get recognitionDateTime (): string {
if (this.isBenBcCccUlcCorrectionFiling || this.isRestorationFiling) {
if (this.isBenBcCccUlcCorrectionFiling || this.isRestorationFiling || this.isCoopCorrectionFiling) {
if (this.getBusinessFoundingDateTime) {
return DateUtilities.apiToPacificDateTime(this.getBusinessFoundingDateTime)
}
Expand Down
3 changes: 0 additions & 3 deletions src/mixins/filing-template-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,6 @@ export default class FilingTemplateMixin extends DateMixin {
}

if (this.isCoopCorrectionFiling) {
// Offices aren't required for Coop corrections.
delete filing.correction.offices

// Apply Court Order ONLY when it is required and applied
if (this.getHasPlanOfArrangement || this.getFileNumber) {
filing.correction.courtOrder = {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/Correction/CP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const CpCorrectionResource: ResourceIF = {
contactLabel: 'Registered Office',
displayName: null, // not used
entityType: CorpTypeCd.COOP,
addressLabel: 'Business Addresses',
addressLabel: 'Registered Office',
filingData: {
filingTypeCode: FilingCodes.CORRECTION,
entityType: CorpTypeCd.COOP,
Expand Down
14 changes: 13 additions & 1 deletion src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ export const useStore = defineStore('store', {
this.hasBusinessNameChanged ||
this.hasAssociationTypeChanged ||
this.hasSpecialResolutionMemorandumChanged ||
this.haveOfficeAddressesChanged ||
this.hasSpecialResolutionRulesChanged ||
this.hasSpecialResolutionResolutionChanged
)
Expand Down Expand Up @@ -738,6 +739,7 @@ export const useStore = defineStore('store', {
if (this.isCoopCorrectionFiling) {
return (
this.getFlagsCompanyInfo.isValidCompanyName &&
this.getFlagsCompanyInfo.isValidAddress &&
this.getFlagsCompanyInfo.isValidAssociationType &&
this.getFlagsCompanyInfo.isValidContactInfo &&
this.getFlagsCompanyInfo.isValidRules &&
Expand Down Expand Up @@ -938,6 +940,15 @@ export const useStore = defineStore('store', {
['addressCountryDescription', 'id']
)
}
if (
this.isCoopCorrectionFiling
) {
return !IsSame(
this.getOfficeAddresses?.registeredOffice?.mailingAddress,
this.getOriginalOfficeAddresses?.registeredOffice?.mailingAddress,
['addressCountryDescription', 'id']
)
}
return false // should never happen
},

Expand All @@ -957,7 +968,8 @@ export const useStore = defineStore('store', {
if (
this.isFirmChangeFiling ||
this.isFirmConversionFiling ||
this.isFirmCorrectionFiling
this.isFirmCorrectionFiling ||
this.isCoopCorrectionFiling
) {
return !IsSame(
this.getOfficeAddresses?.businessOffice?.deliveryAddress,
Expand Down
17 changes: 11 additions & 6 deletions src/views/Correction/CoopCorrection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
id="coop-correction-view"
>
<header>
<h1>Special Resolution Register Correction</h1>
<h1>REGISTER CORRECTION</h1>
</header>

<section
Expand All @@ -24,6 +24,8 @@
<EntityName />
</div>
<AssociationType />
<RecognitionDateTime />
<OfficeAddresses />
<BusinessContactInfo />
</YourCompanyWrapper>

Expand Down Expand Up @@ -72,8 +74,8 @@
import { Component, Emit, Mixins, Prop, Watch } from 'vue-property-decorator'
import { SpecialResolutionSummary, Resolution } from '@/components/SpecialResolution'
import { AssociationType, BusinessContactInfo, BusinessType, CertifySection, CompletingParty, CourtOrderPoa,
CurrentDirectors, Detail, DocumentsDelivery, EntityName, FolioInformation, OfficeAddresses, StaffPayment,
TransactionalFolioNumber, YourCompanyWrapper } from '@/components/common/'
CurrentDirectors, Detail, DocumentsDelivery, EntityName, FolioInformation, OfficeAddresses, RecognitionDateTime,
StaffPayment, TransactionalFolioNumber, YourCompanyWrapper } from '@/components/common/'
import { CommonMixin, DateMixin, FeeMixin, FilingTemplateMixin } from '@/mixins/'
import ViewWrapper from '@/components/ViewWrapper.vue'
import Rules from '@/components/SpecialResolution/Rules.vue'
Expand Down Expand Up @@ -102,6 +104,7 @@ import { FilingDataIF } from '@bcrs-shared-components/interfaces'
EntityName,
FolioInformation,
OfficeAddresses,
RecognitionDateTime,
SpecialResolutionSummary,
StaffPayment,
TransactionalFolioNumber,
Expand Down Expand Up @@ -184,17 +187,19 @@ export default class CoopCorrection extends Mixins(CommonMixin, DateMixin, FeeMi
AuthServices.fetchAuthInfo(this.getBusinessId),
LegalServices.fetchBusinessDocuments(this.getBusinessId),
LegalServices.fetchResolutions(this.getBusinessId, true),
LegalServices.fetchParties(this.getBusinessId)
LegalServices.fetchParties(this.getBusinessId),
LegalServices.fetchAddresses(this.getBusinessId)
])
if (items.length !== 5) throw new Error('Failed to fetch entity snapshot')
if (items.length !== 6) throw new Error('Failed to fetch entity snapshot')
return {
businessInfo: items[0],
authInfo: items[1],
businessDocuments: items[2],
resolutions: items[3],
orgPersons: items[4]
orgPersons: items[4],
addresses: items[5]
} as EntitySnapshotIF
}
Expand Down
34 changes: 34 additions & 0 deletions tests/unit/CoopCorrection.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import Vuetify from 'vuetify'
import flushPromises from 'flush-promises'
import { mount } from '@vue/test-utils'
import { AssociationType, BusinessContactInfo, CertifySection, CompletingParty, CourtOrderPoa, Detail, EntityName,
OfficeAddresses,
RecognitionDateTime,
StaffPayment, YourCompanyWrapper } from '@/components/common/'
import CoopCorrection from '@/views/Correction/CoopCorrection.vue'
import { createPinia, setActivePinia } from 'pinia'
Expand Down Expand Up @@ -161,6 +163,36 @@ describe('Coop Correction component', () => {
}
])

LegalServices.fetchAddresses = vi.fn().mockResolvedValue([
{
'registeredOffice': {
'deliveryAddress': {
'addressCity': 'Scarborough',
'addressCountry': 'CA',
'addressRegion': 'BC',
'addressType': 'delivery',
'deliveryInstructions': null,
'id': 2660329,
'postalCode': 'M1B 4B9',
'streetAddress': '34-70 Alford Cres',
'streetAddressAdditional': ''
},
'mailingAddress': {
'addressCity': 'Scarborough',
'addressCountry': 'CA',
'addressRegion': 'BC',
'addressType': 'mailing',
'deliveryInstructions': null,
'id': 2660328,
'postalCode': 'M1B 4B9',
'streetAddress': '34-70 Alford Cres',
'streetAddressAdditional': ''
}
}
}

])

LegalServices.fetchParties = vi.fn().mockResolvedValue([
{ roles: [{ appointmentDate: '2022-04-01', roleType: 'Completing Party' }] },
{ roles: [{ appointmentDate: '2022-04-01', roleType: 'Incorporator' }] },
Expand Down Expand Up @@ -192,6 +224,8 @@ describe('Coop Correction component', () => {
expect(wrapper.findComponent(YourCompanyWrapper).exists()).toBe(true)
expect(wrapper.findComponent(EntityName).exists()).toBe(true)
expect(wrapper.findComponent(AssociationType).exists()).toBe(true)
expect(wrapper.findComponent(RecognitionDateTime).exists()).toBe(true)
expect(wrapper.findComponent(OfficeAddresses).exists()).toBe(true)
expect(wrapper.findComponent(BusinessContactInfo).exists()).toBe(true)
expect(wrapper.findComponent(Rules).exists()).toBe(true)
expect(wrapper.findComponent(Memorandum).exists()).toBe(true)
Expand Down

0 comments on commit df2a497

Please sign in to comment.