CCF icon indicating copy to clipboard operation
CCF copied to clipboard

Provide votes/finalVotes information in GET proposals/proposalId response

Open gaurav137 opened this issue 1 year ago • 1 comments

For building a user experience around proposals we needed the following ability:

  1. For open proposals show the yes/no vote status for each member that has voted till now.
  2. For closed proposals show the yes/no vote status for how each member had voted
  3. For open proposals show which members are yet to vote.

Based on a discussion with @eddyashton it looks like that 1. and 2. might require some changes from CCF's end to expose the "votes" or "finalVotes" property in the GET proposals/proposalId response. And 3. is something we'd have to deduce by say enumerating all current members and picking members that are not present in the votes/finalVotes object.

gaurav137 avatar Apr 05 '24 09:04 gaurav137

Update after further discussion:

  1. It's tricky to show votes for open proposals, since the votes (boolean result) might change at any time. But we can show the IDs of the members who have voted (and separately, we retain the separate endpoint that returns the maybe-large ballot script they submitted).
  2. We can and should do this - looks like a bug that it's occasionally omitted, which we'll fix.
  3. This is out-of-scope at the framework level, as the set of appropriate members depends on the resolve logic. Simpler for the client logic to construct this from its list of all (appropriate) members, and a hasVoted list we should include in part 1.

eddyashton avatar Apr 08 '24 13:04 eddyashton