liquidvotingio / api

Enable liquid democracy in your decision making platform
GNU Affero General Public License v3.0
17 stars 3 forks source link

Get weights of direct & indirect delegations #252

Open jinjagit opened 3 years ago

jinjagit commented 3 years ago

We wish to show a user (of Decidim, in #56) the user's voting weight, which may increase (from a base of 1) due to delegations 'received'.

We also wish to show the user how much of this voting weight is due to direct delegations (delegations where the user has been chosen as a delegate), and how much is due to indirect delegations (voting weight delegated to someone earlier in a delegation chains that have been passed on to the user though subsequent delegation(s)).

Thus, we need absinthe queries / a query that will return these values for a given user.

This will also involve developing separate core functions to perform the needed db queries & calculations. Note that currently, update_vote_weight(vote) in lib/liquid_voting/voting_weight.ex does not differentiate between direct and indirect delegations.

oliverbarnes commented 3 years ago

(Edited issue title to remove implementation detail and just leave concise intent. Makes it easier to parse issues lists)