Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Severin Beauvais committed Dec 21, 2023
1 parent e969f30 commit 538768e
Show file tree
Hide file tree
Showing 14 changed files with 148 additions and 105 deletions.
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@bcrs-shared-components/confirm-dialog": "1.2.1",
"@bcrs-shared-components/contact-info": "1.2.15",
"@bcrs-shared-components/corp-type-module": "1.0.11",
"@bcrs-shared-components/correct-name": "1.0.33",
"@bcrs-shared-components/correct-name": "1.0.34",
"@bcrs-shared-components/court-order-poa": "3.0.11",
"@bcrs-shared-components/date-picker": "1.2.15",
"@bcrs-shared-components/document-delivery": "1.2.0",
Expand All @@ -35,7 +35,7 @@
"@bcrs-shared-components/interfaces": "1.1.5",
"@bcrs-shared-components/jurisdiction": "1.0.1",
"@bcrs-shared-components/limited-restoration-panel": "1.0.5",
"@bcrs-shared-components/mixins": "1.1.33",
"@bcrs-shared-components/mixins": "1.1.34",
"@bcrs-shared-components/nature-of-business": "1.2.14",
"@bcrs-shared-components/relationships-panel": "1.0.9",
"@bcrs-shared-components/staff-comments": "1.3.15",
Expand Down
6 changes: 6 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -945,6 +945,12 @@ export default class App extends Mixins(CommonMixin, DateMixin, FilingTemplateMi
this.nameRequestInvalidErrorDialog = true
})
//
// The NR checks below are sort-of a duplicate of code in BusinessName.vue and
// ResultingBusinessName.vue, but we assume the other checks passed if the user
// was able to add the NR to this filing, so these checks should be sufficient.
//
// ensure NR was found
if (!nrResponse) {
this.nameRequestInvalidType = NameRequestStates.NOT_FOUND
Expand Down
6 changes: 4 additions & 2 deletions src/components/Amalgamation/BusinessTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export default class BusinessTable extends Mixins(AmalgamationMixin) {
readonly AmlTypes = AmlTypes
readonly GetCorpFullDescription = GetCorpFullDescription
@Action(useStore) setDefineCompanyStepValidity!: (x: boolean) => void
@Action(useStore) spliceAmalgamatingBusiness!: (x: number) => void
/**
Expand Down Expand Up @@ -173,7 +172,10 @@ export default class BusinessTable extends Mixins(AmalgamationMixin) {
@Watch('businesses', { deep: true, immediate: true })
@Emit('valid')
private emitValidity (): boolean {
return this.businesses.every(business => business.status === AmlStatuses.OK)
return (
this.businesses.length > 0 &&
this.businesses.every(business => business.status === AmlStatuses.OK)
)
}
}
</script>
Expand Down
82 changes: 46 additions & 36 deletions src/components/Amalgamation/ResultingBusinessName.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@
:formType="formType"
:nameRequest="getNameRequest"
@cancel="resetName()"
@saved="onSave($event)"
@update:companyName="onUpdateCompanyName($event)"
@update:formType="onUpdateFormType($event)"
@update:formType="formType = $event"
@update:nameRequest="onUpdateNameRequest($event)"
/>
</v-col>
Expand All @@ -47,7 +48,7 @@
<!-- Display Mode -->
<template v-else>
<NameRequestInfo />
<NameTranslations />
<NameTranslations class="mt-n8" />

<v-btn
text
Expand All @@ -65,11 +66,11 @@
</template>

<script lang="ts">
import { Component, Mixins } from 'vue-property-decorator'
import { Component, Mixins, Watch } from 'vue-property-decorator'
import { Getter, Action } from 'pinia-class'
import { useStore } from '@/store/store'
import { NameRequestMixin } from '@/mixins'
import { AmalgamatingBusinessIF, EmptyNameRequest, NameRequestIF } from '@/interfaces/'
import { AmalgamatingBusinessIF, EmptyNameRequest, NameRequestIF, NameTranslationIF } from '@/interfaces/'
import { LegalServices } from '@/services/'
import { CorrectNameOptions, NrRequestActionCodes } from '@bcrs-shared-components/enums/'
import { CorpTypeCd } from '@bcrs-shared-components/corp-type-module'
Expand Down Expand Up @@ -98,20 +99,22 @@ export default class ResultingBusinessName extends Mixins(NameRequestMixin) {
@Action(useStore) setCorrectNameOption!: (x: CorrectNameOptions) => void
@Action(useStore) setNameRequest!: (x: NameRequestIF) => void
@Action(useStore) setNameRequestApprovedName!: (x: string) => void
// Local properties
formType = null as CorrectNameOptions
@Action(useStore) setNameTranslations!: (x: NameTranslationIF[]) => void
readonly correctionNameChoices = [
CorrectNameOptions.CORRECT_AML_ADOPT,
CorrectNameOptions.CORRECT_NEW_NR,
CorrectNameOptions.CORRECT_AML_NUMBERED
]
/** Flag to trigger forms to submit. */
formType: CorrectNameOptions = null
/** The company name. */
get companyName (): string {
return (this.getNameRequestApprovedName || this.getBusinessLegalName)
}
/** This section's validity state (when prompted by app). */
get invalidSection (): boolean {
return (this.getShowErrors && !this.getCorrectNameOption)
Expand All @@ -120,55 +123,62 @@ export default class ResultingBusinessName extends Mixins(NameRequestMixin) {
/**
* Fetches and validation a NR.
* @param nrNum the NR number
* @param businessId the business id
* @param businessId the business id (not used here but needed in method signature)
* @param phone the phone number to match
* @param email the email address to match
* @returns a promise to return the NR, or throws a printable error
*/
async fetchAndValidateNr (nrNum: string, businessId: string, phone: string, email: string): Promise<NameRequestIF> {
async fetchAndValidateNr (
nrNum: string, businessId: string, phone: string, email: string
): Promise<NameRequestIF> {
console.log('*** fetching and validating NR, params =', nrNum, businessId, phone, email)
const nameRequest = await LegalServices.fetchValidContactNr(nrNum, phone, email)
if (!nameRequest) throw new Error('Error fetching Name Request')
// validateNameRequest() already throws printable errors
return this.validateNameRequest(nameRequest, NrRequestActionCodes.AMALGAMATE)
}
/** On company name update, sets store accordingly. */
onUpdateCompanyName (name: string): void {
console.log('*** updating company name')
this.setCorrectNameOption(this.formType)
this.setNameRequestApprovedName(name)
}
onUpdateFormType (type: CorrectNameOptions): void {
console.log('*** updating form type')
this.formType = type
}
/** On name request update, sets store accordingly. */
onUpdateNameRequest (nameRequest: NameRequestIF): void {
console.log('*** updating name request')
this.setNameRequest(nameRequest)
}
/** Whether a new business legal name was entered. */
get isNewName (): boolean {
// Approved Name is null when we start
// and is set when a name option is selected
return !!this.getNameRequestApprovedName
}
/** When cancel was clicked, resets business name values. */
/** Resets business name values (and name translations) when Cancel was clicked. */
resetName (): void {
console.log('*** resetting name')
// clear out existing data
this.setNameRequest(EmptyNameRequest)
this.setNameRequestApprovedName(null)
this.setCorrectNameOption(null)
this.setNameTranslations([])
// reset flag
this.formType = null
}
onSave (val: boolean): void {
console.log('*** on save =', val)
}
/** On company name update, sets store accordingly. */
onUpdateCompanyName (val: string): void {
console.log('*** updated company name =', val)
// set new data in store
this.setCorrectNameOption(this.formType)
this.setNameRequestApprovedName(val)
}
// onUpdateFormType (val: CorrectNameOptions): void {
// console.log('*** updated form type =', val)
// this.setCorrectNameOption(val)
// this.formType = val
// }
/** On name request update, sets store accordingly. */
onUpdateNameRequest (val: NameRequestIF): void {
// set new data in store
this.setNameRequest(val)
}
@Watch('getCorrectNameOption')
private onCorrectNameOption (val: CorrectNameOptions): void {
console.log('*** on correct name option =', val)
}
}
</script>

Expand Down
1 change: 1 addition & 0 deletions src/components/common/AddNameTranslation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<v-text-field
id="name-translation-input"
v-model="nameTranslation"
autofocus
filled
persistent-hint
label="Enter Name Translation"
Expand Down
39 changes: 21 additions & 18 deletions src/components/common/NameRequestInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,15 @@
<v-col
cols="12"
sm="3"
class="pr-4 mt-4"
class="pr-4 mt-8"
>
<label>Resulting Business Type</label>
</v-col>

<v-col
cols="12"
sm="9"
class="mt-4"
class="mt-4 mt-sm-8"
>
<ul class="entity-type-description">
<li>
Expand Down Expand Up @@ -166,15 +166,14 @@
>
<ul class="numbered-company-list-items">
<li id="numbered-company-title">
<strong>[Incorporation Number]</strong> B.C. LTD.
<strong>[Incorporation Number]</strong> {{ numberedCompanySuffix }}
</li>
<li class="bullet-point mt-4 ml-6">
You will be filing this Incorporation Application for a company
created by adding "B.C. LTD." after the Incorporation Number.
<span>The company is to be amalgamated with a name created by adding
"{{ numberedCompanySuffix }}" after the incorporation number.</span>
</li>
<li class="bullet-point ml-6">
Your Incorporation Number will be generated at the end of the filing
transaction.
Your Incorporation Number will be generated at the end of the filing transaction.
</li>
<li class="bullet-point ml-6">
It is not possible to request a specific Incorporation Number.
Expand All @@ -185,15 +184,15 @@
<v-col
cols="12"
sm="3"
class="pr-4 mt-4"
class="pr-4 mt-8"
>
<label>Resulting Business Type</label>
</v-col>

<v-col
cols="12"
sm="9"
class="mt-4"
class="mt-4 mt-sm-8"
>
<ul class="entity-type-description">
<li>
Expand Down Expand Up @@ -226,21 +225,17 @@
>
<ul class="numbered-company-list-items">
<li id="numbered-company-title">
<strong>[Incorporation Number]</strong> B.C. LTD.
<strong>[Incorporation Number]</strong> {{ numberedCompanySuffix }}
</li>
<li class="mt-4">
<strong>Entity Type:</strong> {{ getEntityTypeDescription }}
</li>
<li class="mt-2">
<strong>Request Type:</strong> {{ requestType }}
</li>
<li class="bullet-point mt-4 ml-6">
You will be filing this Incorporation Application for a company
created by adding "B.C. LTD." after the Incorporation Number.
<span>The company is to be incorporated with a name created by adding
"{{ numberedCompanySuffix }}" after the incorporation number.</span>
</li>
<li class="bullet-point ml-6">
Your Incorporation Number will be generated at the end of the filing
transaction.
Your Incorporation Number will be generated at the end of the filing transaction.
</li>
<li class="bullet-point ml-6">
It is not possible to request a specific Incorporation Number.
Expand Down Expand Up @@ -279,8 +274,16 @@ export default class NameRequestInfo extends Mixins(CommonMixin, DateMixin) {
@Getter(useStore) getNameRequest!: NameRequestIF
@Getter(useStore) getNameRequestApprovedName!: string
@Getter(useStore) getNameRequestNumber!: string
@Getter(useStore) isTypeSoleProp: boolean
@Getter(useStore) isAmalgamationFiling!: boolean
@Getter(useStore) isTypeBcCcc!: boolean
@Getter(useStore) isTypeBcUlcCompany!: boolean
@Getter(useStore) isTypeSoleProp: boolean
get numberedCompanySuffix (): string {
if (this.isTypeBcCcc) return 'B.C. Community Contribution Company'
if (this.isTypeBcUlcCompany) return 'B.C. Unlimited Liability Company'
return 'B.C. LTD.'
}
/** The entity type description. */
get getEntityTypeDescription (): string {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/NameTranslations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<v-col
cols="12"
sm="9"
class="pt-4 pt-sm-0"
class="pt-4 pt-sm-0 pl-5"
>
<v-checkbox
id="name-translation-checkbox"
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/Stepper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ import { RegistrationStateIF } from '@/interfaces'
@Component({})
export default class Stepper extends Vue {
@Getter(useStore) getAmalgamatingBusinessesValid!: boolean
@Getter(useStore) isAmalgamationInformationRegValid!: boolean
@Getter(useStore) getRegistration!: RegistrationStateIF
@Getter(useStore) getShowErrors!: boolean
@Getter(useStore) getSteps!: Array<any>
Expand All @@ -91,7 +91,7 @@ export default class Stepper extends Vue {
/** Returns true if the step route is valid. */
isValid (route: RouteNames): boolean {
switch (route) {
case RouteNames.AMALG_REG_INFORMATION: return this.getAmalgamatingBusinessesValid
case RouteNames.AMALG_REG_INFORMATION: return this.isAmalgamationInformationRegValid
case RouteNames.AMALG_REG_BUSINESS_INFO: return this.isDefineCompanyValid
case RouteNames.AMALG_REG_PEOPLE_ROLES: return this.isAddPeopleAndRolesValid
case RouteNames.AMALG_REG_SHARE_STRUCTURE: return this.isCreateShareStructureValid
Expand Down
Loading

0 comments on commit 538768e

Please sign in to comment.