Skip to content

Commit

Permalink
- app version = 4.7.5 (#541)
Browse files Browse the repository at this point in the history
- moved director workaround to LegalServices
- moved parties workaround to LegalServices
- removed workaround from Change
- removed workaround from Conversion
- updated unit tests
  • Loading branch information
severinbeauvais authored Nov 9, 2023
1 parent 65de3eb commit e17ff0e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 34 deletions.
6 changes: 3 additions & 3 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-edit-ui",
"version": "4.7.4",
"version": "4.7.5",
"private": true,
"appName": "Edit UI",
"sbcName": "SBC Common Components",
Expand Down
19 changes: 18 additions & 1 deletion src/services/legal-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ export default class LegalServices {
if (directors) {
// convert director list to org-person list
return directors.map(director => {
// WORK-AROUND WARNING !!!
// convert directors from "middleInitial" to "middleName"
const middleInitial = director.officer['middleInitial']
if (middleInitial !== undefined) {
director.officer.middleName = middleInitial
delete director.officer['middleInitial']
}

const orgPerson: OrgPersonIF = {
deliveryAddress: director.deliveryAddress,
mailingAddress: director.mailingAddress,
Expand Down Expand Up @@ -236,7 +244,16 @@ export default class LegalServices {
.then(response => {
const parties = response?.data?.parties
if (parties) {
return parties
// WORK-AROUND WARNING !!!
// convert parties from "middleInitial" to "middleName"
return parties.map(party => {
const middleInitial = party.officer['middleInitial']
if (middleInitial !== undefined) {
party.officer.middleName = middleInitial
delete party.officer['middleInitial']
}
return party
})
}
// eslint-disable-next-line no-console
console.log('fetchParties() error - invalid response =', response)
Expand Down
13 changes: 1 addition & 12 deletions src/views/Change.vue
Original file line number Diff line number Diff line change
Expand Up @@ -285,22 +285,11 @@ export default class Change extends Mixins(CommonMixin, FeeMixin, FilingTemplate
if (items.length !== 4) throw new Error('Failed to fetch entity snapshot')
// WORK-AROUND WARNING !!!
// convert orgPersons from "middleInitial" to "middleName"
const orgPersons = items[3].map(orgPerson => {
const middleInitial = orgPerson.officer['middleInitial']
if (middleInitial !== undefined) {
orgPerson.officer.middleName = middleInitial
delete orgPerson.officer['middleInitial']
}
return orgPerson
})
return {
businessInfo: items[0],
authInfo: items[1],
addresses: items[2],
orgPersons
orgPersons: items[3]
} as EntitySnapshotIF
}
Expand Down
13 changes: 1 addition & 12 deletions src/views/Conversion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,22 +240,11 @@ export default class Conversion extends Mixins(CommonMixin, FeeMixin, FilingTemp
throw new Error('Failed to fetch entity addresses')
})
// WORK-AROUND WARNING !!!
// convert orgPersons from "middleInitial" to "middleName"
const orgPersons = items[2].map(orgPerson => {
const middleInitial = orgPerson.officer['middleInitial']
if (middleInitial !== undefined) {
orgPerson.officer.middleName = middleInitial
delete orgPerson.officer['middleInitial']
}
return orgPerson
})
return {
businessInfo: items[0],
authInfo: items[1],
addresses,
orgPersons
orgPersons: items[2]
} as EntitySnapshotIF
}
/** Emits Fetch Error event. */
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/legal-services.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ describe('Legal Services', () => {

it('fetches directors correctly', async () => {
const DIRECTORS = [
{ appointmentDate: '2022-04-01' },
{ appointmentDate: '2022-05-01' }
{ appointmentDate: '2022-04-01', officer: {} },
{ appointmentDate: '2022-05-01', officer: {} }
]
const ORGPERSONS = [
{ roles: [{ appointmentDate: '2022-04-01', roleType: 'Director' }] },
Expand All @@ -160,9 +160,9 @@ describe('Legal Services', () => {

it('fetches parties correctly', async () => {
const PARTIES = [
{ roles: [{ appointmentDate: '2022-04-01', roleType: 'Completing Party' }] },
{ roles: [{ appointmentDate: '2022-04-01', roleType: 'Incorporator' }] },
{ roles: [{ appointmentDate: '2022-05-01', roleType: 'Director' }] }
{ officer: {}, roles: [{ appointmentDate: '2022-04-01', roleType: 'Completing Party' }] },
{ officer: {}, roles: [{ appointmentDate: '2022-04-01', roleType: 'Incorporator' }] },
{ officer: {}, roles: [{ appointmentDate: '2022-05-01', roleType: 'Director' }] }
]

// mock endpoint
Expand Down

0 comments on commit e17ff0e

Please sign in to comment.