Skip to content

feat(routes-f): creator dashboard, viewer retention, notification read, email digest#1080

Closed
Jaydbrown wants to merge 10 commits into
StreamFi-x:mainfrom
Jaydbrown:feat/creator-dashboard-retention-notifications-digest
Closed

feat(routes-f): creator dashboard, viewer retention, notification read, email digest#1080
Jaydbrown wants to merge 10 commits into
StreamFi-x:mainfrom
Jaydbrown:feat/creator-dashboard-retention-notifications-digest

Conversation

@Jaydbrown

@Jaydbrown Jaydbrown commented Jun 26, 2026

Copy link
Copy Markdown

Closes #1015


Closes #1021


Closes #1020


Closes #1017


Summary

  • feat(routes-f): creator dashboard overview #1020 by adding a GET /api/routes-f/creator-dashboard endpoint that accepts a creator_id query parameter and returns follower_count, monthly_recurring_revenue_usdc, last_stream_at, total_tips_lifetime_usdc, and active_subs, with currency values rounded to 2 decimal places.
  • feat(routes-f): viewer retention curve #1021 by adding a GET /api/routes-f/viewer-retention endpoint that accepts a stream_id query parameter and returns a points array of { minute, viewer_count, percent_of_peak } entries normalised against the stream's peak viewer count.
  • feat(routes-f): mark notifications read #1015 by adding a POST /api/routes-f/notifications-read endpoint that accepts viewer_id, an optional ids array, and an optional all boolean to bulk-mark notifications as read, returning updated_count.
  • feat(routes-f): email digest opt-in #1017 by adding GET and PUT /api/routes-f/email-digest endpoints to read and update a viewer's weekly digest preference, with sections validated against the live_alerts | new_clips | tip_summary | recommendations enum.

Tests added

  • app/api/routes-f/creator-dashboard/__tests__/route.test.ts covers missing creator_id validation, 404 for unknown creators, correct stat aggregation, currency rounding to 2 decimal places, and null last_stream_at for creators with no streams.
  • app/api/routes-f/viewer-retention/__tests__/route.test.ts covers missing stream_id validation, 404 for unknown streams, correct points array shape, peak normalisation to 100%, strong drop-off, and steady audience shapes.
  • app/api/routes-f/notifications-read/__tests__/route.test.ts covers missing viewer_id validation, marking a single notification read, marking multiple notifications read, marking all unread notifications with all: true, skipping already-read entries, and viewer isolation.
  • app/api/routes-f/email-digest/__tests__/route.test.ts covers missing viewer_id validation, 404 for unknown viewers, reading enabled and disabled preferences, toggling enabled, updating day_of_week, updating sections, rejecting invalid section values, and persistence across GET after PUT.

Testing

  • Not run locally in this environment. Changes were applied through the GitHub connector.

@netlify

netlify Bot commented Jun 26, 2026

Copy link
Copy Markdown

👷 Deploy request for streamfi pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit fd74f3d

@github-actions

Copy link
Copy Markdown

Hi @Jaydbrown — thanks for the contribution!

This repo uses dev as the integration branch. PRs targeting main are not accepted.

Please re-open this PR against dev instead. From your branch:

  1. Click Edit on this PR title area
  2. Change the base branch from main to dev

Or open a fresh PR from the GitHub UI with dev selected as the base.

@github-actions github-actions Bot closed this Jun 26, 2026
@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@Jaydbrown 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

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.

1 participant