feat: add GET /governance/proposals with status filter and vote percentages#448
Merged
Devsol-01 merged 2 commits intoDevsol-01:mainfrom Mar 27, 2026
Merged
Conversation
- Install nestjs-pino, pino-http, and pino-pretty (dev) - Configure LoggerModule globally in AppModule with async factory that reads NODE_ENV: pretty-printed in development, raw JSON in production - Replace default NestJS logger in main.ts with Pino logger using bufferLogs and app.useLogger(app.get(Logger)) pattern - Replace console.log startup messages with structured logger calls Closes Devsol-01#123
…ntages
- Add ProposalListItemDto with forPercent, againstPercent (computed from
vote counts) and timeline { startTime, endTime } UNIX block boundaries
- Add GovernanceService.getProposals(status?) using a single aggregate
query to compute FOR/AGAINST vote counts across all proposals efficiently
- Add GET /governance/proposals endpoint on GovernanceProposalsController
with optional ?status query param (accepts enum keys ACTIVE/PASSED/FAILED/
CANCELLED and enum values); returns 400 on invalid status
Closes Devsol-01#304
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@daveades Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /governance/proposalsendpoint toGovernanceProposalsControllerwith optional?statusquery parameter (e.g.?status=ACTIVE)ACTIVE,PASSED,FAILED,CANCELLED) and enum values (Active,Passed, etc.); returns400on invalid inputProposalListItemDtowith:forPercent/againstPercent— computed from vote counts (not weights) as percentages rounded to 2 decimal placestimeline: { startTime, endTime }— UNIX block boundaries fromstartBlock/endBlockcolumns (nullable)Closes #304
Test plan
GET /api/governance/proposalsreturns all proposals with forPercent, againstPercent, and timeline fieldsGET /api/governance/proposals?status=ACTIVEreturns only proposals with statusActiveGET /api/governance/proposals?status=Activealso works (enum value form)GET /api/governance/proposals?status=INVALIDreturns400 Bad RequestforPercent: 0,againstPercent: 0/api/docsshow the new endpoint under thegovernancetag