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

Change grant update logic #100

Merged
merged 11 commits into from
Mar 13, 2024
Merged

Change grant update logic #100

merged 11 commits into from
Mar 13, 2024

Conversation

rpoet-jh
Copy link
Contributor

@rpoet-jh rpoet-jh commented Mar 12, 2024

This PR has changes to simplify and make the grant update logic more consistent. The following changes were made:

  • Change source grant query to pull all records for any grants updated since last updated filter.
  • Change grant update logic to update all grant fields if source grant system result set contains records for a grant. This can be done because it is now assumed that if a grant is changing, then all records for the grant are supplied in result set.
  • Change aggregation logic so that setting of start/end/pi based on grant record aggregation is more consistent.
  • Make piEmail field optional, user.email is now optional.
  • Add more tests for update scenarios.

The rules for aggregation of grant records are as follows:

  • For all grant records for a grant, use the grant record with awardDate to compute the earliest record base on awardDate to set the start attributes.
  • For all grant records for a grant, use the grant record with awardDate to compute the latest record base on awardDate to set the end attributes and PI.
  • If all grant records for a grant have no awardDate, then the startDate and endDate will be used to compute the earliest and latest records respectively.
  • If all grant records for a grant contains records with and without awardDate, the records with awardDate will take precedence in determining the earliest and latest records.

rpoet-jh added 7 commits March 8, 2024 07:47
So logic assumes all records are there when
an updating a grant.
So that start and end conditions are properly met regardless
of the order of the grant records
Try to make update logic more consistent with start and
end dates and setting PI
To simplify for understanding start, end, pi aggregation
logic.
@rpoet-jh rpoet-jh self-assigned this Mar 12, 2024
@rpoet-jh rpoet-jh linked an issue Mar 13, 2024 that may be closed by this pull request
@markpatton markpatton self-requested a review March 13, 2024 15:07
Copy link
Contributor

@markpatton markpatton left a comment

Choose a reason for hiding this comment

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

This is a really good update and cleanup. The update logic is a lot easier to understand now.

Tests pass for me locally.

@rpoet-jh rpoet-jh merged commit 62cd598 into main Mar 13, 2024
2 checks passed
@rpoet-jh rpoet-jh deleted the russ-813-grant-update-logic branch August 1, 2024 18:03
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.

Analyze grant award start and end date update logic
2 participants