Skip to content

add summary of reimbursement values in reimbursements list api #480

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

Closed
wants to merge 1 commit into from
Closed

Conversation

artur-deluca
Copy link

@artur-deluca artur-deluca commented May 26, 2019

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.

@cuducos
Copy link
Collaborator

cuducos commented May 27, 2019

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.

@artur-deluca
Copy link
Author

artur-deluca commented May 27, 2019

@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!

@cuducos
Copy link
Collaborator

cuducos commented May 27, 2019

@cuducos this came as a user request to easily summarize expenditures within a query.

Maybe #456 is a better alternative for summaries…

@sergiomario
Copy link
Collaborator

sergiomario commented May 28, 2019

Oh sorry @artur-deluca :/

I definitely didn't know the endpoint reimbursementsummary.
I think it's a usability issue. When accessing Jarbas, I believe that the user should have a way to navigate to this information, from a simple m filter.
Based on my experience, people may not know the availability of this function in Jarbas.

@cuducos
Copy link
Collaborator

cuducos commented May 29, 2019

Easy way out: changing HOMES_REDIRECTS_TO in settings.py will to '/dashboard/' (instead of current '/dashboard/chamber_of_deputies/reimbursement/') will make users land at:

image

Alternatively I think a proper roadmap would be:

  • implement text search in reimbursementsummary
  • add a link to any query/search/filter in reimbursement to see its summarized version

@artur-deluca
Copy link
Author

What do you guys think of creating a tab structure connecting summary and table?

image

I don't know if it is totally feasible but in this case, we could simply create a template that renders both table and summary and hide the corresponding components according to the tab selected using css.

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