From 34e3e85bee7c22500b89755a5dfb7a2780262c2c Mon Sep 17 00:00:00 2001 From: Qin Date: Wed, 30 Oct 2024 14:20:41 -0700 Subject: [PATCH 1/3] added founding date not changed from colin Signed-off-by: Qin --- .../ContinuationIn/ExtraproRegistration.vue | 13 +++++++------ .../existing-business-info-interface.ts | 3 ++- src/mixins/filing-template-mixin.ts | 9 +++++---- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/components/ContinuationIn/ExtraproRegistration.vue b/src/components/ContinuationIn/ExtraproRegistration.vue index 1f2c718c..e9eb9f23 100644 --- a/src/components/ContinuationIn/ExtraproRegistration.vue +++ b/src/components/ContinuationIn/ExtraproRegistration.vue @@ -168,7 +168,7 @@ :persistentHint="true" :initialValue="business.prevIncorporationDate" :inputRules="getShowErrors ? incorporationDateRules: []" - :maxDate="business.bcRegistrationDate || getCurrentDate" + :maxDate="business.bcRegistrationDateFormatted || getCurrentDate" @emitDateSync="$set(business, 'prevIncorporationDate', $event)" /> @@ -203,7 +203,7 @@
- {{ yyyyMmDdToPacificDate(business.bcRegistrationDate, true, false) || '[Unknown]' }} + {{ yyyyMmDdToPacificDate(business.bcRegistrationDateFormatted, true, false) || '[Unknown]' }}
@@ -352,10 +352,10 @@ export default class ExtraproRegistration extends Mixins(DateMixin) { get incorporationDateRules (): Array { return [ (v) => !!v || 'Date of Incorporation is required', - () => (this.business.bcRegistrationDate && this.business.prevIncorporationDate <= this.getCurrentDate) || + () => (this.business.bcRegistrationDateFormatted && this.business.prevIncorporationDate <= this.getCurrentDate) || 'Date of Incorporation cannot be in the future', - () => !this.business.bcRegistrationDate || - (this.business.prevIncorporationDate <= this.business.bcRegistrationDate) || + () => !this.business.bcRegistrationDateFormatted || + (this.business.prevIncorporationDate <= this.business.bcRegistrationDateFormatted) || 'Date of Incorporation in previous jurisdiction must be before Date of Registration in B.C.' ] } @@ -409,7 +409,8 @@ export default class ExtraproRegistration extends Mixins(DateMixin) { } this.business = { - bcRegistrationDate: this.dateToYyyyMmDd(this.apiToDate(businessInfo.foundingDate)), + bcRegistrationDate: businessInfo.foundingDate, + bcRegistrationDateFormatted: this.dateToYyyyMmDd(this.apiToDate(businessInfo.foundingDate)), bcRegistrationNumber: businessInfo.identifier, bcRegisteredName: businessInfo.legalName, previousJurisdiction: this.getHomeJurisdiction(businessInfo.jurisdiction || ''), diff --git a/src/interfaces/store-interfaces/state-interfaces/existing-business-info-interface.ts b/src/interfaces/store-interfaces/state-interfaces/existing-business-info-interface.ts index 25d7fcbe..34452b1e 100644 --- a/src/interfaces/store-interfaces/state-interfaces/existing-business-info-interface.ts +++ b/src/interfaces/store-interfaces/state-interfaces/existing-business-info-interface.ts @@ -4,7 +4,8 @@ export interface ExistingBusinessInfoIF { affidavitFile?: File // only used by UI affidavitFileKey?: string affidavitFileName?: string - bcRegistrationDate?: string // expro only (YYYY-MM-DD) + bcRegistrationDate?: string + bcRegistrationDateFormatted?: string // expro only (YYYY-MM-DD) bcRegistrationNumber?: string // expro only (aka Identifier) bcRegisteredName?: string // expro only previousJurisdiction: { diff --git a/src/mixins/filing-template-mixin.ts b/src/mixins/filing-template-mixin.ts index 99a5440d..f79e5a59 100644 --- a/src/mixins/filing-template-mixin.ts +++ b/src/mixins/filing-template-mixin.ts @@ -419,9 +419,9 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM // Add expro business information. if (this.getExistingBusinessInfo?.mode === 'EXPRO') { - const foundingDate = this.yyyyMmDdToDate(this.getExistingBusinessInfo?.bcRegistrationDate) + const foundingDate = this.getExistingBusinessInfo?.bcRegistrationDate filing.continuationIn.business = { - foundingDate: this.dateToApi(foundingDate), + foundingDate: foundingDate, identifier: this.getExistingBusinessInfo?.bcRegistrationNumber, legalName: this.getExistingBusinessInfo?.bcRegisteredName } @@ -464,14 +464,15 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM // restore existing business information if (continuationIn.foreignJurisdiction) { - const foundingDate = this.apiToDate(continuationIn.business?.foundingDate) + const foundingDate = continuationIn.business?.foundingDate const exproConfirmation = (continuationIn.exproConfirmation === true) ? true : (continuationIn.exproConfirmation === false) ? false : undefined this.setExistingBusinessInfo({ affidavitFile: continuationIn.foreignJurisdiction.affidavitFile, affidavitFileKey: continuationIn.foreignJurisdiction.affidavitFileKey, affidavitFileName: continuationIn.foreignJurisdiction.affidavitFileName, - bcRegistrationDate: this.dateToYyyyMmDd(foundingDate), + bcRegistrationDate: foundingDate, + bcRegistrationDateFormatted: this.dateToYyyyMmDd(this.apiToDate(foundingDate)), bcRegistrationNumber: continuationIn.business?.identifier, bcRegisteredName: continuationIn.business?.legalName, // store previousJurisdiction as null if not saved From d6b2495d7feba96c98b739f72d1558866b6c5d6b Mon Sep 17 00:00:00 2001 From: Qin Date: Wed, 30 Oct 2024 14:48:11 -0700 Subject: [PATCH 2/3] change formatted to a getter Signed-off-by: Qin --- .../ContinuationIn/ExtraproRegistration.vue | 17 +++++++++++------ .../existing-business-info-interface.ts | 3 +-- src/mixins/filing-template-mixin.ts | 7 ++----- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/components/ContinuationIn/ExtraproRegistration.vue b/src/components/ContinuationIn/ExtraproRegistration.vue index e9eb9f23..2596eb69 100644 --- a/src/components/ContinuationIn/ExtraproRegistration.vue +++ b/src/components/ContinuationIn/ExtraproRegistration.vue @@ -168,7 +168,7 @@ :persistentHint="true" :initialValue="business.prevIncorporationDate" :inputRules="getShowErrors ? incorporationDateRules: []" - :maxDate="business.bcRegistrationDateFormatted || getCurrentDate" + :maxDate="bcRegistrationDateFormatted || getCurrentDate" @emitDateSync="$set(business, 'prevIncorporationDate', $event)" /> @@ -203,7 +203,7 @@
- {{ yyyyMmDdToPacificDate(business.bcRegistrationDateFormatted, true, false) || '[Unknown]' }} + {{ yyyyMmDdToPacificDate(bcRegistrationDateFormatted, true, false) || '[Unknown]' }}
@@ -352,10 +352,10 @@ export default class ExtraproRegistration extends Mixins(DateMixin) { get incorporationDateRules (): Array { return [ (v) => !!v || 'Date of Incorporation is required', - () => (this.business.bcRegistrationDateFormatted && this.business.prevIncorporationDate <= this.getCurrentDate) || + () => (this.bcRegistrationDateFormatted && this.business.prevIncorporationDate <= this.getCurrentDate) || 'Date of Incorporation cannot be in the future', - () => !this.business.bcRegistrationDateFormatted || - (this.business.prevIncorporationDate <= this.business.bcRegistrationDateFormatted) || + () => !this.bcRegistrationDateFormatted || + (this.business.prevIncorporationDate <= this.bcRegistrationDateFormatted) || 'Date of Incorporation in previous jurisdiction must be before Date of Registration in B.C.' ] } @@ -381,6 +381,12 @@ export default class ExtraproRegistration extends Mixins(DateMixin) { return IntlJurisdictions.find(intl => intl.value === jurisdiction?.country)?.text || null } + get bcRegistrationDateFormatted (): string | null { + return this.business.bcRegistrationDate + ? this.dateToYyyyMmDd(this.apiToDate(this.business.bcRegistrationDate)) + : null + } + /** Called when this component is mounted. */ mounted (): void { // point business variable to Existing Business Info object from the store, if it exists @@ -410,7 +416,6 @@ export default class ExtraproRegistration extends Mixins(DateMixin) { this.business = { bcRegistrationDate: businessInfo.foundingDate, - bcRegistrationDateFormatted: this.dateToYyyyMmDd(this.apiToDate(businessInfo.foundingDate)), bcRegistrationNumber: businessInfo.identifier, bcRegisteredName: businessInfo.legalName, previousJurisdiction: this.getHomeJurisdiction(businessInfo.jurisdiction || ''), diff --git a/src/interfaces/store-interfaces/state-interfaces/existing-business-info-interface.ts b/src/interfaces/store-interfaces/state-interfaces/existing-business-info-interface.ts index 34452b1e..33daa7bd 100644 --- a/src/interfaces/store-interfaces/state-interfaces/existing-business-info-interface.ts +++ b/src/interfaces/store-interfaces/state-interfaces/existing-business-info-interface.ts @@ -4,8 +4,7 @@ export interface ExistingBusinessInfoIF { affidavitFile?: File // only used by UI affidavitFileKey?: string affidavitFileName?: string - bcRegistrationDate?: string - bcRegistrationDateFormatted?: string // expro only (YYYY-MM-DD) + bcRegistrationDate?: string // expro only (ISO date-time: '2007-04-25T22:42:42-00:00') bcRegistrationNumber?: string // expro only (aka Identifier) bcRegisteredName?: string // expro only previousJurisdiction: { diff --git a/src/mixins/filing-template-mixin.ts b/src/mixins/filing-template-mixin.ts index f79e5a59..c9ab0776 100644 --- a/src/mixins/filing-template-mixin.ts +++ b/src/mixins/filing-template-mixin.ts @@ -419,9 +419,8 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM // Add expro business information. if (this.getExistingBusinessInfo?.mode === 'EXPRO') { - const foundingDate = this.getExistingBusinessInfo?.bcRegistrationDate filing.continuationIn.business = { - foundingDate: foundingDate, + foundingDate: this.getExistingBusinessInfo?.bcRegistrationDate, identifier: this.getExistingBusinessInfo?.bcRegistrationNumber, legalName: this.getExistingBusinessInfo?.bcRegisteredName } @@ -464,15 +463,13 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM // restore existing business information if (continuationIn.foreignJurisdiction) { - const foundingDate = continuationIn.business?.foundingDate const exproConfirmation = (continuationIn.exproConfirmation === true) ? true : (continuationIn.exproConfirmation === false) ? false : undefined this.setExistingBusinessInfo({ affidavitFile: continuationIn.foreignJurisdiction.affidavitFile, affidavitFileKey: continuationIn.foreignJurisdiction.affidavitFileKey, affidavitFileName: continuationIn.foreignJurisdiction.affidavitFileName, - bcRegistrationDate: foundingDate, - bcRegistrationDateFormatted: this.dateToYyyyMmDd(this.apiToDate(foundingDate)), + bcRegistrationDate: continuationIn.business?.foundingDate, bcRegistrationNumber: continuationIn.business?.identifier, bcRegisteredName: continuationIn.business?.legalName, // store previousJurisdiction as null if not saved From bf63203a96c96190b99e237eab112d440847cc3d Mon Sep 17 00:00:00 2001 From: Qin Date: Wed, 30 Oct 2024 15:04:35 -0700 Subject: [PATCH 3/3] update version no Signed-off-by: Qin --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0ce4bbe0..c025d3b9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "business-create-ui", - "version": "5.13.0", + "version": "5.14.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "business-create-ui", - "version": "5.13.0", + "version": "5.14.0", "dependencies": { "@babel/compat-data": "^7.21.5", "@bcrs-shared-components/approval-type": "1.1.3", diff --git a/package.json b/package.json index 33a8c934..7dbaa870 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "business-create-ui", - "version": "5.13.0", + "version": "5.14.0", "private": true, "appName": "Create UI", "sbcName": "SBC Common Components",