-
Notifications
You must be signed in to change notification settings - Fork 45
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
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 |
---|---|---|
|
@@ -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, | ||
|
@@ -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 | ||
}) | ||
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. 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. 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. 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. 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. 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. 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. |
||
} | ||
// eslint-disable-next-line no-console | ||
console.log('fetchParties() error - invalid response =', response) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: {} } | ||
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. Needed to be able to de-reference Ditto below for party. |
||
] | ||
const ORGPERSONS = [ | ||
{ roles: [{ appointmentDate: '2022-04-01', roleType: 'Director' }] }, | ||
|
@@ -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 | ||
|
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.
It turns out this workaround is needed for Alteration / LimitedRestorationExtension / LimitedRestorationToFull / SpecialResolution filings.
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.
Sample alteration: