- id: String
- adminId: String
- name: String
- description: String
- createdAt: Timestamp
- state: number (approved: 1/ unseen(default): 0/ rejected: -1)
- isUserSubmitted: boolean
- text: String
- numAgrees: number
- numDisagrees: number
- stateChangeTime: timestamp
- submittedAt: timestamp
- id: String (cookie?)
- votes: Subcollection
- jamId: String
- statementId: String
- vote: number (agree: 1/ pass: 0/ disagree: -1)
(Add a participant, set a cookie) Get next statement for participantId, jamId loop { Record vote Get next statement for participantId, jamId }
- Get all the statement for jamId where state = 1
- Get all the statements answered by participantId + jamId
- Get the 1s that are not in 2
- Return random entry from array
? How to get all answers for a jam: Get all votes for jamId from Votes subcollection Group (SUM) by statementId