fix: Fixed Asset and retirement update query #332
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request includes significant changes to the
get_users
function inClientAdvisor/App/app.py
to improve the calculation and update of dates in theClientMeetings
,Assets
, andRetirement
tables. Additionally, the test for this function has been updated to reflect these changes.Changes to date calculations and updates:
ClientAdvisor/App/app.py
: Replaced the individual queries and updates forClientMeetings
,Assets
, andRetirement
tables with a combined SQL statement that calculates the date differences for all three tables at once. This includes creating common table expressions (CTEs) for maximum dates and today's date, and calculating the days and months differences.ClientAdvisor/App/app.py
: Updated the logic to fetch the calculated differences and apply them conditionally to update theClientMeetings
,Assets
, andRetirement
tables only if the differences are greater than zero.Test updates:
ClientAdvisor/App/tests/test_app.py
: Added new fields (ClientMeetingDaysDifference
,AssetMonthsDifference
,StatusMonthsDifference
,DaysDifference
) to the test data intest_get_users_success
to reflect the changes in the date calculations and updates.Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information