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

24141 - Added founding date not changed from Colin #755

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all 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.13.0",
"version": "5.14.0",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
18 changes: 12 additions & 6 deletions src/components/ContinuationIn/ExtraproRegistration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
:persistentHint="true"
:initialValue="business.prevIncorporationDate"
:inputRules="getShowErrors ? incorporationDateRules: []"
:maxDate="business.bcRegistrationDate || getCurrentDate"
:maxDate="bcRegistrationDateFormatted || getCurrentDate"
@emitDateSync="$set(business, 'prevIncorporationDate', $event)"
/>
</v-col>
Expand Down Expand Up @@ -203,7 +203,7 @@
</div>
<div class="date-registration-bc font-15 mt-2">
<label>Date of Registration in B.C.:</label>
{{ yyyyMmDdToPacificDate(business.bcRegistrationDate, true, false) || '[Unknown]' }}
{{ yyyyMmDdToPacificDate(bcRegistrationDateFormatted, true, false) || '[Unknown]' }}
</div>
</v-col>
</v-row>
Expand Down Expand Up @@ -352,10 +352,10 @@ export default class ExtraproRegistration extends Mixins(DateMixin) {
get incorporationDateRules (): Array<VuetifyRuleFunction> {
return [
(v) => !!v || 'Date of Incorporation is required',
() => (this.business.bcRegistrationDate && this.business.prevIncorporationDate <= this.getCurrentDate) ||
() => (this.bcRegistrationDateFormatted && this.business.prevIncorporationDate <= this.getCurrentDate) ||
'Date of Incorporation cannot be in the future',
() => !this.business.bcRegistrationDate ||
(this.business.prevIncorporationDate <= this.business.bcRegistrationDate) ||
() => !this.bcRegistrationDateFormatted ||
(this.business.prevIncorporationDate <= this.bcRegistrationDateFormatted) ||
'Date of Incorporation in previous jurisdiction must be before Date of Registration in B.C.'
]
}
Expand All @@ -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
Expand Down Expand Up @@ -409,7 +415,7 @@ export default class ExtraproRegistration extends Mixins(DateMixin) {
}

this.business = {
bcRegistrationDate: this.dateToYyyyMmDd(this.apiToDate(businessInfo.foundingDate)),
bcRegistrationDate: businessInfo.foundingDate,
bcRegistrationNumber: businessInfo.identifier,
bcRegisteredName: businessInfo.legalName,
previousJurisdiction: this.getHomeJurisdiction(businessInfo.jurisdiction || ''),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export interface ExistingBusinessInfoIF {
affidavitFile?: File // only used by UI
affidavitFileKey?: string
affidavitFileName?: string
bcRegistrationDate?: 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: {
Expand Down
6 changes: 2 additions & 4 deletions src/mixins/filing-template-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,8 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM

// Add expro business information.
if (this.getExistingBusinessInfo?.mode === 'EXPRO') {
const foundingDate = this.yyyyMmDdToDate(this.getExistingBusinessInfo?.bcRegistrationDate)
filing.continuationIn.business = {
foundingDate: this.dateToApi(foundingDate),
foundingDate: this.getExistingBusinessInfo?.bcRegistrationDate,
identifier: this.getExistingBusinessInfo?.bcRegistrationNumber,
legalName: this.getExistingBusinessInfo?.bcRegisteredName
}
Expand Down Expand Up @@ -464,14 +463,13 @@ export default class FilingTemplateMixin extends Mixins(AmalgamationMixin, DateM

// restore existing business information
if (continuationIn.foreignJurisdiction) {
const foundingDate = this.apiToDate(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: continuationIn.business?.foundingDate,
bcRegistrationNumber: continuationIn.business?.identifier,
bcRegisteredName: continuationIn.business?.legalName,
// store previousJurisdiction as null if not saved
Expand Down
Loading