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

HOTFIX: h0074 standardize agreement owner string other name. #3315

Merged
merged 2 commits into from
Jul 11, 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
2 changes: 1 addition & 1 deletion source/frontend/src/models/generate/GenerateOwner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe('GenerateOwner tests', () => {
const owner = new Api_GenerateOwner(
acqFile?.acquisitionFileOwners ? acqFile?.acquisitionFileOwners[0] : null,
);
expect(owner.owner_string).toBe(`John Doe Jr.`);
expect(owner.owner_string).toBe(`John Doe (Jr.)`);
});

it('Can Generate an owner organization string in the expected format', () => {
Expand Down
6 changes: 5 additions & 1 deletion source/frontend/src/models/generate/GenerateOwner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export class Api_GenerateOwner {
given_name: string;
last_name_or_corp_name: string;
other_name: string;
formatted_other_name: string;
incorporation_number: string;
registration_number: string;
address: Api_GenerateAddress;
Expand All @@ -19,6 +20,7 @@ export class Api_GenerateOwner {
this.given_name = owner?.givenName ?? '';
this.last_name_or_corp_name = owner?.lastNameAndCorpName ?? '';
this.other_name = owner?.otherName ?? '';
this.formatted_other_name = owner?.otherName ? `(${owner?.otherName})` : '';
this.incorporation_number = owner?.incorporationNumber ?? '';
this.registration_number = owner?.registrationNumber ?? '';
this.address = new Api_GenerateAddress(owner?.address ?? null);
Expand All @@ -31,6 +33,8 @@ export class Api_GenerateOwner {
this.is_primary_contact = this.is_primary_contact = owner?.isPrimaryContact ?? false;
this.owner_string = this.is_corporation
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

FYI apparently all instances of this pattern can have the other name in brackets, thus the non-passive change.

? `${this.last_name_or_corp_name}, Inc. No. ${this.incorporation_number} (OR Reg. No. ${this.registration_number})`
: [this.given_name, this.last_name_or_corp_name, this.other_name].filter(x => !!x).join(' ');
: [this.given_name, this.last_name_or_corp_name, this.formatted_other_name]
.filter(x => !!x)
.join(' ');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe('GenerateFile tests', () => {
interestHolders: [],
});
expect(file.primary_owner).not.toBeNull();
expect(file.primary_owner?.owner_string).toBe('John Doe Jr.');
expect(file.primary_owner?.owner_string).toBe('John Doe (Jr.)');
});

it('saves a list of the person owners on the file', () => {
Expand All @@ -44,7 +44,7 @@ describe('GenerateFile tests', () => {
interestHolders: [],
});
expect(file.person_owners).toHaveLength(1);
expect(file.person_owners[0].owner_string).toBe('John Doe Jr.');
expect(file.person_owners[0].owner_string).toBe('John Doe (Jr.)');
});

it('saves a list of the organization owners on the file', () => {
Expand Down