fly2189: Fix financial API bug on /reports/transactions#944
fly2189: Fix financial API bug on /reports/transactions#944AndresQuijano wants to merge 1 commit intov2.5.1from
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. OpenSSF Scorecard
Scanned Files |
There was a problem hiding this comment.
ListQuotesByDateRange, countQuotesWithRetainedInDateRange, listQuotesByDateRangeDateMatch, listQuotesByDateRangeLookupStage, listQuotesByDateRangeHasRetainedMatch , and listQuotesByDateRangePipelinePrefix functions are the same both inside Pegin and Pegout
and
peginListQuotesByDateRangeAggRow and pegoutListQuotesByDateRangeAggRow have the same body inside Pegin_test and Pegout_test respectively.
Unless there is an explicit restriction to keep pegin and pegout flows separate, we could allow ourselves to have a general adapter for those(at least for pegin and pegout not for the tests).
This can be a little out of the scope of this PR, so we can resolve it in a separate one.
Other this, and this comment , I have run the tests, they pass. After your response for these comments we can approve the pr. LGTM
| result := make([]quote.PeginQuoteWithRetained, 0) | ||
| logDbInteraction(Read, result) | ||
| return result, 0, nil | ||
| dataPipeline := append(repo.listQuotesByDateRangePipelinePrefix(dateMatch), |
There was a problem hiding this comment.
Couldn't we do the appending here and on line 403 together? I might be missing something, so just asking
| result := make([]quote.PegoutQuoteWithRetained, 0) | ||
| logDbInteraction(Read, result) | ||
| return result, 0, nil | ||
| dataPipeline := append(repo.listQuotesByDateRangePipelinePrefix(dateMatch), |
What
The endpoint /reports/transactions was returning a completely broken response. This PR fixes that endpoint.
Why
Improve app quality
Type of Change
Affected part of the project
Related Issues
Jira ticket
How to test
Since this probably won't be deployed in dev at the moment of testing I recommend this:
-Go to /management and authenticate using the dev credentials
-Run the test. Examples:
http://localhost:8080/reports/transactions?type=pegout&startDate=2025-01-01&endDate=2026-01-29&page=4&perPage=5
http://localhost:8080/reports/transactions?type=pegout&startDate=2025-01-01&endDate=2026-01-29&page=1&perPage=50
http://localhost:8080/reports/transactions?type=pegin&startDate=2025-01-01&endDate=2026-01-29&page=4&perPage=5
Pay special attention to pagination metadata
Reviewer Guidelines
The issue here was related with the way the repo object for pegin and pegout were managing the query. Most of the changes where made in the repo layer. Remember that this endpoint is supposed to take into account only the accepted quotes, so if a quote does not have a corresponding object in retainedQuote, in the DB, the endpoint must ignore it.