Skip to content

Commit

Permalink
db_tenant_name will include legal names
Browse files Browse the repository at this point in the history
  • Loading branch information
mgtennant committed Aug 29, 2024
1 parent f9bd4fa commit 68d9432
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions backend/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,9 @@ export function grazingLeaseVariables(
};
}

function getFullName(tenant: { firstName: string; middleName: string; lastName: string }): string {
function getFullName(tenant: { firstName: string; middleName: string; lastName: string; legalName: string }): string {
const nameParts = [];
let legalName;
if (tenant.firstName !== null) {
nameParts.push(tenant.firstName);
}
Expand All @@ -356,7 +357,14 @@ function getFullName(tenant: { firstName: string; middleName: string; lastName:
if (tenant.lastName !== null) {
nameParts.push(tenant.lastName);
}
const fullName = nameParts.join(' ');
if (tenant.legalName !== null) {
legalName = tenant.legalName;
}

let fullName = nameParts.join(' ');
if (fullName.length === 0 && legalName) {
fullName = legalName;
}

return fullName;
}
Expand Down

0 comments on commit 68d9432

Please sign in to comment.