add summary of reimbursement values in reimbursements list api - #480
add summary of reimbursement values in reimbursements list api#480artur-deluca wants to merge 1 commit into
Conversation
|
Would you mind better explaining the purpose of this pull request, @artur-deluca? Do we have a great use case in mind for showing that information? My point is that until further discussion, I'm personally against making the Django Admin list view for reimbursements more complex. It is already one of the most expensive cycles of request/response — in spite of optimizations and cache (for example, #360 and #387) it is Jarba's bottleneck. |
|
@cuducos this came as a user request to easily summarize expenditures within a query. Maybe @sergiomario can further explain this request, since he was the one that suggested to me. I agree on the drawbacks, but are we talking about the same list view? If so, I would be glad to discuss any other alternatives! |
|
Oh sorry @artur-deluca :/ I definitely didn't know the endpoint reimbursementsummary. |
|
Easy way out: changing Alternatively I think a proper roadmap would be:
|


What is the purpose of this Pull Request?
This summary can help users to easily regard the total value spent with the filtered reimbursements.
What was done to achieve this purpose?
I modified the ReimbursementsListAPI paginator to include the summary of values.
In this case, however, I was unsure on how to deal with the negative reimbursement values that are on the database, since those can affect the total amount. To solve this, I simply generated two additional fields with the sum of positive and negative values.