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

psp-8905 | Contact summary model standarization #4394

Merged
merged 3 commits into from
Oct 24, 2024

Conversation

FuriousLlama
Copy link
Collaborator

No description provided.

@FuriousLlama FuriousLlama changed the title psp-8905 psp-8905 | Contact summary model standarization Oct 11, 2024
@FuriousLlama FuriousLlama self-assigned this Oct 11, 2024
@FuriousLlama FuriousLlama added enhancement New feature or request tech-debt Removing technical debt labels Oct 11, 2024
Copy link
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/4394

3 similar comments
Copy link
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/4394

Copy link
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/4394

Copy link
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/4394

@@ -1237,17 +1237,13 @@ exports[`Contact List View > matches snapshot 1`] = `
role="cell"
style="box-sizing: border-box; flex: 60 0 auto; min-width: 30px; width: 60px; justify-content: left; text-align: left; flex-wrap: wrap; align-items: center; display: flex;"
title=""
>
first
Copy link
Collaborator

Choose a reason for hiding this comment

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

It looks like the test may be failing your new isPersonSummary test and returning an empty string. Can you please fix the test model so that it is not ignored (and potentially add an invalid model for testing that does return an empty result).

return stakeholder;
}) ?? [];
const formTenants = tenantsWithPersons?.map(t => new FormStakeholder(undefined, t)) ?? [];
const stakeholderType = isPayableLease ? 'OWNER' : 'TEN';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this may cause issues if a user has owners/tenants and then swaps the lease from payable to not-payable.

Just a note - let's be careful about the scope of these "refactors" - if we don't have existing tests, and the refactor doesn't include tests to validate the before/after functionality, than these are code changes and not refactors, since we are altering functionality. That is potentially fine - but we need to make sure that the FT team is aware of the scope of these changes - otherwise when this is merged the FT team will not know what to re-test. (this story is psp-8905, which talks about contact summary model changes, I don't think it would be obvious to the FT team that lease stakeholder functionality would be affected).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I agree that refactors should be minimal. In this case, the refactor exposed an improper use of a common model for something that is quite specific (the lease tenants). In an ideal world, the code would have been separated making the changes here much smaller. Fixing this is part of maintaining the code base and cleaning shortcuts that where taken at the time (tech debt). Also, all code changes introduce some risk into the application, and no changes make the application harder to enhance in the future, so there is always a tradeoff.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Fair enough, the point remains about the testing team, please make sure the scope of the changes included in this story are clear.


this.summary = selectedContactModel.summary;
this.email = selectedContactModel.email;
this.mailingAddress = { streetAddress1: selectedContactModel.mailingAddress } as FormAddress;
this.municipalityName = selectedContactModel?.municipalityName;
this.note = selectedContactModel.note;
this.note = undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, can you help me understand this change? Wouldn't these values already be undefined? Why were we populating these fields previously but not any more?

Copy link
Collaborator

@devinleighsmith devinleighsmith left a comment

Choose a reason for hiding this comment

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

See comments.

Copy link
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/4394

1 similar comment
Copy link
Contributor

See CodeCov Report Here: https://app.codecov.io/github/bcgov/psp/pull/4394

@asanchezr asanchezr merged commit 4f49773 into bcgov:dev Oct 24, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tech-debt Removing technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants