git ssb

0+

Piet / ssb-loomio



Tree: a12ac40b656901d5dcfd3cf302343421e77045b0

Files: a12ac40b656901d5dcfd3cf302343421e77045b0 / types.js

1377 bytesRaw
1module.exports = {
2 CHOOSE_ONE: 'chooseOne',
3 ERROR_POSITION_TYPE: 'ERROR_POSITION_TYPE',
4 ERROR_POSITION_LATE: 'ERROR_POSITION_LATE',
5 ERROR_POSITION_CHOICE: 'ERROR_POSITION_CHOICE'
6}
7
8// Question: do these need to be different, could we just have 'chooseOne',
9// because we already have:
10// { type: 'poll', pollDetails: { type: 'chooseOne' } }
11// { type: 'position', positionDetails: { type: 'chooseOne' } }
12//
13//
14// to that end, perhaps we could prune these down to
15// { type: 'poll', details: { type: 'chooseOne', choices } }
16// { type: 'position', details: { type: 'chooseOne', choice } }
17
18/// positions need to point at a poll right?
19// I wonder if a position could just be ... but this would mean we would have to have the parent poll, and then based o nthe type there, run a isOneChoicePostion validator... which I wthink could be good? Maybe I don't understandthe complexity of the other types of positions.
20// { type: 'position', poll, choice }
21//
22//
23// I not that there's also a validation thing where
24// { type: 'position', poll, choice: 9000 }
25//
26// is probably invalid, and that the choice should be an integer bound by the parent poll choices. Can probably think about that case later, but making out reducer we're gonna have to put some filtering logic somewhere. Could programatically generate a position schema based on a poll.... _WOAH there EASY MIX_
27

Built with git-ssb-web