Skip to content

add summary of reimbursement values in reimbursements list api - #480

Closed
artur-deluca wants to merge 1 commit into
okfn-brasil:masterfrom
artur-deluca:master
Closed

add summary of reimbursement values in reimbursements list api#480
artur-deluca wants to merge 1 commit into
okfn-brasil:masterfrom
artur-deluca:master

Conversation

@artur-deluca

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

Copy link
Copy Markdown

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

cuducos commented May 27, 2019

Copy link
Copy Markdown
Collaborator

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

artur-deluca commented May 27, 2019

Copy link
Copy Markdown
Author

@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

cuducos commented May 27, 2019

Copy link
Copy Markdown
Collaborator

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

Maybe #456 is a better alternative for summaries…

@sergiomario

sergiomario commented May 28, 2019

Copy link
Copy Markdown
Collaborator

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

cuducos commented May 29, 2019

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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