fix: store M2 program entitlement per project (#26)#87
Merged
Conversation
The projects table held M2 metadata but no amounts, so the admin Winners table could only sum bounty_prizes and had no schema-backed way to show the M1 + M2 program grant. A "+ M2 grant" badge was a stopgap. - Migration 20260520100000: adds m2_milestone_1_amount, m2_milestone_2_amount (NUMERIC), m2_currency (TEXT) to projects, each with a DEFAULT (2500 / 2500 / USDC) that backfills existing rows. - project.repository: transformProject exposes a nested m2Entitlement (only for M2 projects — gated on m2_status, like m2Agreement); toSupabaseProject maps it back. - WinnersTable: the column is renamed "Bounty amount" -> "Amount" and now renders bounty sum + M2 entitlement, with a per-line breakdown. The temporary "+ M2 grant" badge/tooltip is removed. Server: 161 tests pass. Client build + lint green.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced May 19, 2026
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.
Closes #26.
Summary
The
projectstable had M2 metadata (status, mentor, features) but no amounts, so the admin Winners table could only sumbounty_prizes— it had no schema-backed way to show the M1 + M2 program grant. A temporary+ M2 grantbadge papered over it.This stores the entitlement as schema truth.
Changes
20260520100000_m2_entitlement.sql— addsm2_milestone_1_amount,m2_milestone_2_amount(NUMERIC) andm2_currency(TEXT) toprojects, each with a columnDEFAULT(2500 / 2500 /USDC). The default backfills every existing row and applies to new rows automatically.project.repository.js—transformProjectexposes a nestedm2Entitlement: { milestone1Amount, milestone2Amount, currency }, gated onm2_status(same pattern asm2Agreement) so a bounty-only project carrying the default values never surfaces them.toSupabaseProjectmaps it back.WinnersTable.tsx— column renamed"Bounty amount"→"Amount"; the cell now rendersbounty sum + M2 entitlementwith a per-line breakdown (Bounty: …/M2 grant: …). The temporary+ M2 grantbadge/tooltip and its now-unusedTooltipimports are removed.Decisions
DEFAULTsets all existing M2 projects to the standard $5,000.Test plan
cd server && npm test— 161 tests pass.cd client && npm run build(tsc) — green.cd client && npm run lint— green.20260520100000_m2_entitlement.sqlmust be applied to Supabase (perdocs/PRODUCTION_DEPLOYMENT.md) — additive, low-risk (ADD COLUMN … DEFAULT).🤖 Generated with Claude Code