Skip to content

feat(routes-f): add weighted featured channel rotation endpoint and t…#1081

Merged
davedumto merged 1 commit into
StreamFi-x:devfrom
Francis6-git:feat/routes-f/featured-channel-rotation-issue-1011
Jun 26, 2026
Merged

feat(routes-f): add weighted featured channel rotation endpoint and t…#1081
davedumto merged 1 commit into
StreamFi-x:devfrom
Francis6-git:feat/routes-f/featured-channel-rotation-issue-1011

Conversation

@Francis6-git

Copy link
Copy Markdown
Contributor

Description:
This PR addresses issue #1011 by adding a completely self-contained deterministic, weighted featured channel slot selector under app/api/routes-f/featured-channel/.

The system leverages an in-memory rotation manager driven by a seeded PRNG (mulberry32) to achieve perfect determinism against any arbitrary string-based rotation_id, while respecting candidate selection weights.

Changes Covered:

  • GET Endpoint: Returns the currently active featured_creator, rotation_id, and a future rotates_at ISO date string.
  • Candidate Array: Bundles exactly 20 rich, platform-specific mock creator profiles (wallet_address, category, followers, is_live, and selection weight).
  • Deterministic-by-ID: Employs string hashing mapped directly into an integer PRNG fallback chain, guaranteeing the exact same candidate returns for identical rotation_id strings.
  • POST Override: Exposes a manual transition path at /api/routes-f/featured-channel (via Next.js dynamic routing setups on single file multi-methods) advancing the sequential global rotation index state.
  • Test Verification: Tests validation, distributions, field schema constraints, and determinism.

Closes #1011

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Francis6-git is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Francis6-git 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! 🚀

Learn more about application limits

@davedumto davedumto merged commit af253b2 into StreamFi-x:dev Jun 26, 2026
1 check failed
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.

feat(routes-f): featured channel rotation

2 participants