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

Fix rate history contract revisions #2002

Merged
merged 7 commits into from
Oct 25, 2023

Conversation

JasonLin0991
Copy link
Contributor

@JasonLin0991 JasonLin0991 commented Oct 24, 2023

Summary

Fixes rate history revisions contract data.

This fix refactors rateWithHistoryToDomainModel to only include the earliest submitted contract after the rate revision submission submitInfo.updatedAt. Any proceeding contract revision with the same contractID will be skipped.

There was a discussion in DTBM 10.24.23 around the Submission this rate was submitted with and if it should link to the latest submission summary or the submission summary that this rate was submitted with. Specifically, when a rate was removed, the summary is still linked to the latest submission summary.

Related issues

Screenshots

Test cases covered

QA guidance

Copy link
Contributor

@pearl-truss pearl-truss left a comment

Choose a reason for hiding this comment

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

code changes LGTM

@@ -165,42 +166,58 @@ function rateWithHistoryToDomainModel(
)
}

// if it's from before this rate was submitted, it's there at the beginning.
// Finding the single earliest contract rev submitted right after rate rev submission date time.
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment confuses me. Isn't this code finding multiple revs not just a single contract rev? Seems like we adding any contract rev that was submitted after rate rev to initialEntry.contractRevs with an array push.

Also why are keeping all this commented old code along? I think we can delete - its in version history.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is building the rate history using the rate.revisions in the type RateType.

  • Since rate.revisions are all submitted rates, we need to attach the single contract revision that was submitted along with this rate to preserve the same submission data at that time.
  • We don't want future submission revisions of the same contract attached to it otherwise, this data would have future edits trickle down the revision history.

Let me know if that makes sense.

)

// Each Revision needs a Reason, one of the contracts or revisions associated with it should have changed and why.
// Expect no draft revision
expect(latestRateTwoResubmit.draftRevision).toBeUndefined()
Copy link
Contributor

Choose a reason for hiding this comment

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

Good to test this

@JasonLin0991 JasonLin0991 merged commit c86a217 into main Oct 25, 2023
27 checks passed
@JasonLin0991 JasonLin0991 deleted the jl-fix-rate-history-contract-revisions branch October 25, 2023 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants