Skip to content

Conversation

@ae2079
Copy link
Collaborator

@ae2079 ae2079 commented Aug 11, 2025

Summary by CodeRabbit

  • New Features

    • Projects can now be sorted by rank; rank is available on project data.
    • Added Reel Video social media type and preloaded short video links for select projects.
    • Added vesting schedules API (list and by ID).
    • Added token holders API (list, by ID, by project, by address).
  • Data Migrations

    • Added and populated project rank.
    • Created vesting schedules table with initial entries.
    • Created token holders table and seeded records.
  • Tests

    • Added comprehensive tests for vesting schedules and token holders.
  • Chores

    • Added new test scripts.

@coderabbitai
Copy link

coderabbitai bot commented Aug 11, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Adds project ranking support and data, extends social media enum with REEL_VIDEO and seeds related entries, introduces VestingSchedule and TokenHolder entities with repositories, resolvers, migrations, and tests, registers new entities/resolvers, creates and seeds vesting/token holder tables, and adds test scripts. Also updates project sorting to include rank.

Changes

Cohort / File(s) Summary of change
Project Rank Column & Data
migration/1746613421847-addRankToProject.ts, migration/1746613421848-populateProjectRanks.ts, src/entities/project.ts, src/repositories/projectRepository.ts
Adds rank column to project table/entity, supports sorting by rank, and populates ranks based on abc->>'tokenTicker'.
Social Media Enum & Reels Seeding
src/types/projectSocialMediaType.ts, migration/1746613421849-addReelVideoToProjectSocialMediaType.ts, migration/1746613421850-populateProjectReelVideos.ts
Extends enum with REEL_VIDEO, alters PostgreSQL enum, and seeds project_social_media with reel video URLs for selected tickers.
VestingSchedule Entity, Table & Seed
src/entities/vestingSchedule.ts, migration/1746613421852-createVestingScheduleTable.ts, migration/1746613421853-populateVestingSchedules.ts
Introduces VestingSchedule entity, creates vesting_schedule table, and seeds predefined schedules.
TokenHolder Entity, Table & Seed
src/entities/tokenHolder.ts, migration/1746613421854-createTokenHolderTable.ts, migration/1746613421855-populateTokenHolders.ts
Adds TokenHolder entity, creates token_holder table with index, and seeds holders for multiple projects.
Entity/Resolver Registration
src/entities/entities.ts, src/resolvers/resolvers.ts
Registers VestingSchedule and TokenHolder entities and resolvers in application bootstrapping.
VestingSchedule Repository & Tests
src/repositories/vestingScheduleRepository.ts, src/repositories/vestingScheduleRepository.test.ts
Adds read queries for all/by-id vesting schedules with ordering; comprehensive tests.
TokenHolder Repository & Tests
src/repositories/tokenHolderRepository.ts, src/repositories/tokenHolderRepository.test.ts
Adds read queries for all/by-id/by-project/by-address token holders with ordering; tests validate behavior.
GraphQL Resolvers & Tests
src/resolvers/vestingScheduleResolver.ts, src/resolvers/vestingScheduleResolver.test.ts, src/resolvers/tokenHolderResolver.ts, src/resolvers/tokenHolderResolver.test.ts
Adds GraphQL queries for VestingSchedule and TokenHolder and corresponding test suites.
Test Scripts
package.json
Adds four test scripts for vestingSchedule and tokenHolder repositories/resolvers.

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant GraphQL
  participant VestingScheduleResolver
  participant VestingScheduleRepo
  participant DB

  Client->>GraphQL: Query vestingSchedules()
  GraphQL->>VestingScheduleResolver: vestingSchedules
  VestingScheduleResolver->>VestingScheduleRepo: findAllVestingSchedules()
  VestingScheduleRepo->>DB: SELECT * FROM vesting_schedule ORDER BY start ASC
  DB-->>VestingScheduleRepo: rows
  VestingScheduleRepo-->>VestingScheduleResolver: schedules
  VestingScheduleResolver-->>GraphQL: schedules
  GraphQL-->>Client: data
Loading
sequenceDiagram
  participant Client
  participant GraphQL
  participant TokenHolderResolver
  participant TokenHolderRepo
  participant DB

  Client->>GraphQL: Query tokenHoldersByAddress(address)
  GraphQL->>TokenHolderResolver: tokenHoldersByAddress(address)
  TokenHolderResolver->>TokenHolderRepo: findTokenHoldersByAddress(address)
  TokenHolderRepo->>DB: SELECT * FROM token_holder WHERE address=$1 ORDER BY projectName ASC
  DB-->>TokenHolderRepo: rows
  TokenHolderRepo-->>TokenHolderResolver: holders
  TokenHolderResolver-->>GraphQL: holders
  GraphQL-->>Client: data
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • aminlatifi
  • lovelgeorge99

Poem

I thump my paw—new tables bloom,
Ranks arranged, reels go vroom!
Vesting clocks tick soft and slow,
Holders hop where ledgers show.
Queries nibble fields with cheer—
Data gardens, crystal clear.
Carrot-commit, shipped this year! 🥕🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d3dcdd4 and 6313ad4.

📒 Files selected for processing (24)
  • migration/1746613421847-addRankToProject.ts (1 hunks)
  • migration/1746613421848-populateProjectRanks.ts (1 hunks)
  • migration/1746613421849-addReelVideoToProjectSocialMediaType.ts (1 hunks)
  • migration/1746613421850-populateProjectReelVideos.ts (1 hunks)
  • migration/1746613421852-createVestingScheduleTable.ts (1 hunks)
  • migration/1746613421853-populateVestingSchedules.ts (1 hunks)
  • migration/1746613421854-createTokenHolderTable.ts (1 hunks)
  • migration/1746613421855-populateTokenHolders.ts (1 hunks)
  • package.json (1 hunks)
  • src/entities/entities.ts (2 hunks)
  • src/entities/project.ts (3 hunks)
  • src/entities/tokenHolder.ts (1 hunks)
  • src/entities/vestingSchedule.ts (1 hunks)
  • src/repositories/projectRepository.ts (1 hunks)
  • src/repositories/tokenHolderRepository.test.ts (1 hunks)
  • src/repositories/tokenHolderRepository.ts (1 hunks)
  • src/repositories/vestingScheduleRepository.test.ts (1 hunks)
  • src/repositories/vestingScheduleRepository.ts (1 hunks)
  • src/resolvers/resolvers.ts (2 hunks)
  • src/resolvers/tokenHolderResolver.test.ts (1 hunks)
  • src/resolvers/tokenHolderResolver.ts (1 hunks)
  • src/resolvers/vestingScheduleResolver.test.ts (1 hunks)
  • src/resolvers/vestingScheduleResolver.ts (1 hunks)
  • src/types/projectSocialMediaType.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch addNewTablesAndFields

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ae2079 ae2079 merged commit a1521f8 into staging Aug 11, 2025
0 of 2 checks passed
@ae2079 ae2079 deleted the addNewTablesAndFields branch August 11, 2025 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants