Feat/token vesting UI generator#852
Open
akinboyewaSamson wants to merge 2 commits into
Open
Conversation
…ntegration test suite and snapshots
…es, and dashboard component
|
@TobyKing007 is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@akinboyewaSamson 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.
closes #797
PR: Implement Token Vesting UI and Claim Simulator
Description
This PR introduces the Token Vesting Gateway and simulation dashboard to the Hackathon Project Idea Generator module. It enables students/users to define vesting schedules (cliff, duration, amount, and beneficiary address), visualize the vesting progression curve interactively using a dynamic SVG graph, and simulate time progression to claim unlocked tokens in a secure sandboxed environment.
Key Changes
Added VestingSchedule model to the Prisma schema (schema.prisma).
Configured multi-tenant workspace isolation for VestingSchedule in the DB router.
Created request validation schemas using Zod (vesting.validation.ts) including a simulated elapsed time parameter for testing.
Implemented /api/v1/generator/vesting endpoints:
POST / - Create a vesting schedule.
GET / - List all vesting schedules.
GET /:projectId - Retrieve vesting details for a specific idea.
POST /:projectId/claim - Claim unlocked tokens.
Fixed a named import mismatch for startWebhookWorker in backend/src/index.ts.
Added vestingAPI definitions to frontend/src/lib/api.ts.
Integrated a localStorage fallback wrapper on all API calls, ensuring the simulator works fully in local-only / offline environments without needing active PostgreSQL/Redis setups.
Created VestingDashboard component under components/idea-generator/:
Configuration form with quick-presets (Standard, Founder, Advisor).
Clean card deck showing stats: Allocation, Cliff, Duration, and Claimed.
Interactive SVG graphing the linear vesting curve and cliff line.
Timeline Simulation Scrubber to scrub time and dynamically calculate vested vs remaining locked vs claimable tokens.
Simulation Claim form updating state on execution.
Integrated the dashboard toggler button directly into IdeaGeneratorPanel.tsx.
Verification & Testing
Automated Test Coverage
Backend Endpoints: All database models, multi-tenant workspace queries, route parameters, validation edge-cases, and mock claims are verified via 12 tests in backend/tests/vesting.test.ts (12/12 passing).
Frontend Components: Rendering, presets, interactive timeline scrubber, math calculations, and claim handlers are covered by 6 unit tests in frontend/src/components/idea-generator/tests/VestingDashboard.test.tsx (6/6 passing).
Manual QA
Verified the entire flow in the browser:
Generated a mock project.
Configured and deployed a vesting schedule.
Scrubbed time forward and successfully simulated claims.