Skip to content
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

Show total of votes by membership type and weight in a consultation #2

Closed
sauloperez opened this issue Jul 22, 2020 · 3 comments · Fixed by coopdevs/decidim-module-action_delegator#29
Assignees

Comments

@sauloperez
Copy link
Contributor

sauloperez commented Jul 22, 2020

Description

- As an: admin
- On page: /admin/consultations/<consultation_name>/results
- I want to be able to do:

  • See the number of votes by membership type and for each question
  • See the number of votes by membership type and weight for each response

Acceptance Criteria & Tests

The admin needs to be able to see how many votes of each membership type each of the possible responses received, along with their particular weights. For example, in a coop with consumers and producer members, each response should show the count of votes from consumers and the count from producers and display which weight within the coop they have.

@sauloperez sauloperez changed the title Show total of votes by membership type Show total of votes by membership type in a consultation Jul 22, 2020
@sauloperez sauloperez changed the title Show total of votes by membership type in a consultation Show total of votes by membership type and weight in a consultation Jul 27, 2020
@sauloperez
Copy link
Contributor Author

sauloperez commented Jul 28, 2020

The easiest approach to prototype this would be to add subitem in the sidebar to leads the admin to our separate results page so we don't deal with the core's calculations.

@sauloperez
Copy link
Contributor Author

sauloperez commented Sep 17, 2020

This is a sample of the results table we want

Membership type Weight Answer Number of votes
Consumer 2 Si 3
Consumer 2 No 1
Producer 1 Si 1
Producer 1 No 1
Producer 2 Si 2
Producer 2 No 0

@sauloperez
Copy link
Contributor Author

Platoniq/decidim-verifications-direct_verifications#2 enables us to query like:

SELECT metadata->>'type' AS type, count(*)
FROM decidim_authorizations
GROUP BY metadata->>'type'

    type    | count 
------------+-------
 consumidor |     1
 productora |     1
(2 rows)

so we should be all set 👌

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 a pull request may close this issue.

1 participant