@@ -42,6 +42,7 @@ type Proposal struct {
4242 Voucher * shared.Voucher `json:"voucher,omitempty"`
4343 Achievements_done bool `json:"achievementsDone"`
4444 TallyMethod string `json:"voteType" validate:"required"`
45+ Quorum * float64 `json:"quorum,omitempty"`
4546}
4647
4748type UpdateProposalRequestPayload struct {
@@ -146,9 +147,10 @@ func (p *Proposal) CreateProposal(db *s.Database) error {
146147 cid,
147148 composite_signatures,
148149 voucher,
149- tally_method
150+ tally_method,
151+ quorum
150152 )
151- VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16)
153+ VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17 )
152154 RETURNING id, created_at
153155 ` ,
154156 p .Community_id ,
@@ -167,6 +169,7 @@ func (p *Proposal) CreateProposal(db *s.Database) error {
167169 p .Composite_signatures ,
168170 p .Voucher ,
169171 p .TallyMethod ,
172+ p .Quorum ,
170173 ).Scan (& p .ID , & p .Created_at )
171174
172175 return err
@@ -210,17 +213,19 @@ func (p *Proposal) UpdateDraftProposal(db *s.Database) error {
210213 strategy = COALESCE($3, strategy),
211214 min_balance = COALESCE($4, min_balance),
212215 max_weight = COALESCE($5, max_weight),
213- start_time = COALESCE($6, start_time),
214- end_time = COALESCE($7, end_time),
215- body = COALESCE($8, body),
216- block_height = COALESCE($9, block_height),
217- cid = COALESCE($10, cid)
218- WHERE id = $11
216+ quorum = COALESCE($6, quorum),
217+ start_time = COALESCE($7, start_time),
218+ end_time = COALESCE($8, end_time),
219+ body = COALESCE($9, body),
220+ block_height = COALESCE($10, block_height),
221+ cid = COALESCE($11, cid)
222+ WHERE id = $12
219223 ` , p .Name ,
220224 p .Choices ,
221225 p .Strategy ,
222226 p .Min_balance ,
223227 p .Max_weight ,
228+ p .Quorum ,
224229 p .Start_time ,
225230 p .End_time ,
226231 p .Body ,
0 commit comments