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

18238 Applied director/party middleInitial/middleName workaround to all filings #541

Merged
merged 1 commit into from
Nov 9, 2023
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
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']
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out this workaround is needed for Alteration / LimitedRestorationExtension / LimitedRestorationToFull / SpecialResolution filings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample alteration:

image


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
})
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out this workaround is needed for Change / Conversion / CoopCorrection / CorpCorrection / FirmCorrection filings.

It was already implemented for Change and Conversion so I removed it from there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample change:

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample conversion:

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample coop correction:

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample corp correction:

image

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sample firm correction:

image

}
// 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: {} }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to be able to de-reference director.officer.

Ditto below for party.

]
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
Loading