-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
19897 Fixed foreign jurisdiction region #661
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,7 +277,7 @@ import { AmalgamationMixin, CommonMixin } from '@/mixins' | |
import { BusinessLookupServices } from '@/services' | ||
import { BusinessLookup } from '@bcrs-shared-components/business-lookup' | ||
import { Jurisdiction } from '@bcrs-shared-components/jurisdiction' | ||
import { CanJurisdictions, MrasJurisdictions } from '@bcrs-shared-components/jurisdiction/list-data' | ||
import { MrasJurisdictions } from '@bcrs-shared-components/jurisdiction/list-data' | ||
import { AmalgamatingBusinessIF, BusinessLookupResultIF, EmptyBusinessLookup } from '@/interfaces' | ||
import { AmlRoles, AmlTypes, EntityStates } from '@/enums' | ||
import { JurisdictionLocation } from '@bcrs-shared-components/enums' | ||
|
@@ -316,8 +316,8 @@ export default class AmalgamatingBusinesses extends Mixins(AmalgamationMixin, Co | |
snackbar = false | ||
snackbarText = '' | ||
errorDialog = false | ||
errorDialogText = undefined as string | ||
errorDialogTitle = undefined as string | ||
errorDialogText = '' | ||
errorDialogTitle = '' | ||
|
||
// Foreign business properties | ||
jurisdiction = null | ||
|
@@ -418,12 +418,11 @@ export default class AmalgamatingBusinesses extends Mixins(AmalgamationMixin, Co | |
|
||
// Special case to handle Extra Pro A companies | ||
if ((businessLookup.legalType as any) === CorpTypeCd.EXTRA_PRO_A) { | ||
const region = CanJurisdictions.find(jurisdiction => jurisdiction.value === JurisdictionLocation.BC) | ||
const tingBusiness = { | ||
type: AmlTypes.FOREIGN, | ||
role: AmlRoles.AMALGAMATING, | ||
foreignJurisdiction: { | ||
region: region.text, | ||
region: JurisdictionLocation.BC, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
country: JurisdictionLocation.CA | ||
}, | ||
legalName: businessLookup.name, | ||
|
@@ -549,7 +548,7 @@ export default class AmalgamatingBusinesses extends Mixins(AmalgamationMixin, Co | |
type: AmlTypes.FOREIGN, | ||
role: AmlRoles.AMALGAMATING, | ||
foreignJurisdiction: { | ||
region: this.isCan ? this.jurisdiction.text : '', | ||
region: this.isCan ? this.jurisdiction.value : '', // no region outside Canada | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
country: this.isCan ? JurisdictionLocation.CA : this.jurisdiction.value | ||
}, | ||
legalName: this.legalName, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -255,7 +255,7 @@ describe('Amalgamating Businesses - add amalgamating business', () => { | |
const business = store.getAmalgamatingBusinesses[0] as any | ||
expect(business.type).toBe(AmlTypes.FOREIGN) | ||
expect(business.role).toBe(AmlRoles.AMALGAMATING) | ||
expect(business.foreignJurisdiction).toEqual({ country: 'CA', region: 'British Columbia' }) | ||
expect(business.foreignJurisdiction).toEqual({ country: 'CA', region: 'BC' }) | ||
expect(business.legalName).toBe('Extra Pro Business') | ||
expect(business.identifier).toBe('A1234567') | ||
|
||
|
@@ -638,7 +638,7 @@ describe('Amalgamating Businesses - add amalgamating foreign business', () => { | |
// simulate form data | ||
await wrapper.setData({ | ||
isCan: true, | ||
jurisdiction: { text: 'BC', value: 'CA' }, | ||
jurisdiction: { text: 'Alberta', value: 'AB' }, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is what the |
||
legalName: 'Foreign Business', | ||
identifier: 'ABC-123' | ||
}) | ||
|
@@ -654,7 +654,7 @@ describe('Amalgamating Businesses - add amalgamating foreign business', () => { | |
const business = store.getAmalgamatingBusinesses[0] as any | ||
expect(business.type).toBe(AmlTypes.FOREIGN) | ||
expect(business.role).toBe(AmlRoles.AMALGAMATING) | ||
expect(business.foreignJurisdiction).toEqual({ country: 'CA', region: 'BC' }) | ||
expect(business.foreignJurisdiction).toEqual({ country: 'CA', region: 'AB' }) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed this from BC to AB since BC isn't "foreign" :) |
||
expect(business.legalName).toBe('Foreign Business') | ||
expect(business.identifier).toBe('ABC-123') | ||
|
||
|
@@ -668,7 +668,7 @@ describe('Amalgamating Businesses - add amalgamating foreign business', () => { | |
{ | ||
type: AmlTypes.FOREIGN, | ||
role: AmlRoles.AMALGAMATING, | ||
foreignJurisdiction: { country: 'CA', region: 'British Columbia' }, | ||
foreignJurisdiction: { country: 'CA', region: 'AB' }, | ||
legalName: 'Foreign Business', | ||
identifier: 'ABC-123' | ||
} | ||
|
@@ -681,7 +681,7 @@ describe('Amalgamating Businesses - add amalgamating foreign business', () => { | |
// simulate form data | ||
await wrapper.setData({ | ||
isCan: true, | ||
jurisdiction: { text: 'British Columbia', value: 'CA' }, | ||
jurisdiction: { text: 'Alberta', value: 'AB' }, | ||
legalName: 'Foreign Business', | ||
identifier: 'ABC-123' | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was actually causing some template errors. I originally had it this way so the default props would be used if we didn't specify them, but we always specify them anyway so '' is a better initial value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(From a high level, default prop values are normally used when you DON'T specify the prop at all. If we do specify the prop, but want to use its default value, then we'll have to set it to undefined. Neither of these applies here.)