Skip to content

Commit

Permalink
- fixed non-affidavit validity
Browse files Browse the repository at this point in the history
  • Loading branch information
Severin Beauvais committed May 23, 2024
1 parent 2fca37d commit 9d12368
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ export default class ExtraproRegistration extends Mixins(DocumentMixin) {
return Math.min((this.authorization.files.length + 1), 5)
}
/** Called when this component is mounted. */
mounted (): void {
// set or initialize authorization object
this.authorization = this.getContinuationAuthorization || { files: [] } as ContinuationAuthorizationIF
Expand Down
16 changes: 9 additions & 7 deletions src/components/ContinuationIn/ExtraproRegistration.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@

<!-- Upload Affidavit -->
<v-row
v-if="isShowAffidavit"
v-if="isAffidavitRequired"
class="mt-6"
no-gutters
>
Expand Down Expand Up @@ -474,10 +474,10 @@ export default class ExtraproRegistration extends Mixins(DateMixin, DocumentMixi
}
/**
* Whether to show the affidavit upload.
* Whether the director's affidavit is required.
* Is true if the business is a Continued In ULC in Alberta or Nova Scotia.
*/
get isShowAffidavit (): boolean {
get isAffidavitRequired (): boolean {
return (
this.isTypeUlcContinueIn &&
this.business.homeJurisdiction?.country === JurisdictionLocation.CA &&
Expand Down Expand Up @@ -521,6 +521,7 @@ export default class ExtraproRegistration extends Mixins(DateMixin, DocumentMixi
return IntlJurisdictions.find(intl => intl.value === jurisdiction?.country)?.text || null
}
/** Called when this component is mounted. */
mounted (): void {
// point business variable to Existing Business Info object from the store, if it exists
if (this.getExistingBusinessInfo) this.business = this.getExistingBusinessInfo
Expand Down Expand Up @@ -675,7 +676,7 @@ export default class ExtraproRegistration extends Mixins(DateMixin, DocumentMixi
this.$set(this.business, 'affidavitFileUrl', psu.preSignedUrl)
}
} else {
// delete properties reactively if the file is cleared
// delete properties reactively when the file is cleared
this.$delete(this.business, 'affidavitFile')
this.$delete(this.business, 'affidavitFileKey')
this.$delete(this.business, 'affidavitFileName')
Expand All @@ -694,13 +695,14 @@ export default class ExtraproRegistration extends Mixins(DateMixin, DocumentMixi
@Watch('business', { deep: true })
@Emit('valid')
private onComponentValid (): boolean {
// this component is valid if we have looked up an active business
// and we have the affidavit if the business in the home jurisdiction is ULC
// this component is valid if we have looked up a business
// and the business is active
// and we have the affidavit if it's required
// and the user has checked the confirmation
return (
this.haveLookupBusiness &&
this.isBusinessActive &&
!!this.business.affidavitFileKey &&
(!this.isAffidavitRequired || !!this.business.affidavitFileKey) &&
this.business.isConfirmed
)
}
Expand Down
1 change: 1 addition & 0 deletions src/components/ContinuationIn/ManualBusinessInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ export default class ManualBusinessInfo extends Mixins(CountriesProvincesMixin,
isMrasJurisdiction = false
jurisdictionErrorMessage = ''
/** Called when this component is mounted. */
mounted (): void {
// point business variable to Existing Business Info object from the store, if it exists
if (this.getExistingBusinessInfo) {
Expand Down

0 comments on commit 9d12368

Please sign in to comment.