# EasyRetroFunding Impact Metrics
#### What are the required steps to implement Impact Voting in EzRF?
OnChain Summer might have different scope and dependencies than EzRF. For example:
- Impact Metric API via Agora
- Charmverse Project Registration
Ideally we want to build something that we can use in future rounds. Most critical for this is the Metrics API.
## API requirements
- Impact Metrics API
- [EzRF x OpenSourceObserver API](/lh3zfsvnS3O-f7xXnLvkSw)
- If Agora provides API - will they support future EzRF rounds?
- Project Registration (Charmverse?)
- Link EzRF Project with OSO project
- OSO has their own project IDs and a new Project might not even have an OSO profile yet?
- We could store this in Application Metadata in the ApplicationForm
## Updates on EzRF codebase
### Round Admin
- Admins can select Project Voting or Impact Voting
- Choose Metrics to vote on
- Search Impact Metric API for Metrics
- Add Metrics to a list (similar to how categories are defined for ProjectVoting)
- Save config to Prisma DB
### Discover Metrics
- Render DiscoverMetrics instead of DiscoverProjects for Rounds configured as Impact Voting

*OP RF4 UI for DiscoverMetrics*
- List of Metrics (+search, sort, filter)
- Add to ballot button
- OP Allocation of Ballot (also shown on ImpactBallot page)
### Metric Details
- New component (similar to ProjectDetails)
- Get Impact Metric by ID from API
- Shows information about Metric
- Distribution
- Query Impact Metric API (provide a list of OSO IDs to only return relevant projects)
- Voters/Badgeholders can comment

*OP RF4 UI for MetricDetails*
### MetricBallot
- Render MetricsBallot instead of ProjectsBallot for Rounds configured as Impact Voting
- This work will include some refactoring such as create the ProjectsBallot and generalize components
- Do we want to support the OpenSource multipler?

### Application Form
- Are there differences in ApplicationForm for Metric Voting? Ideally we want to use the same form for all applications and just add a field for OpenSourceObserver.
---
### TODOs
We could move these over to Github issues on this milestone:
https://github.com/gitcoinco/easy-retro-pgf/milestone/1
#### EzRF
- [ ] Create Postgres database for dev/staging environment (and update .env files)
- [ ] Update Prisma Schema with `Round.type String @default("project")` and `Round.metrics Json[]`
- [ ] Create Round(s) for OnChainSummer in the Admin UI
- [ ] Update RoundAdmin page to select Round type (Project or Impact voting)
- [ ] Update RoundAdmin page to configure metrics if `round.type === impact` (instead of categories for `type === project`)
- [ ] Create API route to fetch Metrics
- [ ] Create metrics router (`src/api/routers/metrics`)
- [ ] Call OpenSourceObserver
- [EzRF x OpenSourceObserver API](https://hackmd.io/lh3zfsvnS3O-f7xXnLvkSw)
- [ ] Update Ballot page (`/[domain]/ballot`) (this is where Base will weight the metrics for Reward Distribution)
- [ ] If `round.type === impact` render MetricsBallot component (See OP RF4)
- [ ] Else render current ballot (and rename to ProjectsBallot)
- [ ] Create MetricsBallot component
- [ ] Query and list the Metrics configured in the Round
- [ ] Update DB with ballot data
- [ ] Create Impact Ballot api
- [ ] Should work similar to OP RF4
- [ ] Autobalance
- [ ] Lock metric state
- [ ] (this functionality is useful for ProjectBallot also)
- [ ] Ballot votes are currently `{ projectId, amount }` - can we refactor to use `{ id, amount }`?
#### OnChainSummer Frontend
- [ ] Figma for Designs
- [ ] Create repo on github.com/gitcoinco
- [ ] Query EzRF api for Applications / Projects for onchain summer round(s)
- [ ] Viewing Rewards (not sure yet what this contain, results after round?)
- [ ] (what else will the public frontend include?)
#### These might not be necessary for OnChain Summer
- [ ] Create DiscoverMetricsPage (route: `/metrics`)
- [ ] Create DiscoverMetrics component
- [ ] Fetch Metrics for `round.metrics` (the configured metrics for the round)
- [ ] Create MetricDetailsPage (route: `/metrics/:id`)
- [ ] Create MetricsDetails component
- [ ] Fetch Metric for `metricId` and approved projects
- [ ] Update DiscoverProjects Page to redirect to `/metrics` if Round is ImpactVoting (and `/projects => /metrics`)