feat(routes-f): creator dashboard, viewer retention, notification read, email digest#1080
Closed
Jaydbrown wants to merge 10 commits into
Closed
Conversation
👷 Deploy request for streamfi pending review.Visit the deploys page to approve it
|
|
Hi @Jaydbrown — thanks for the contribution! This repo uses Please re-open this PR against
Or open a fresh PR from the GitHub UI with |
|
@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! 🚀 |
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 #1015
Closes #1021
Closes #1020
Closes #1017
Summary
GET /api/routes-f/creator-dashboardendpoint that accepts acreator_idquery parameter and returnsfollower_count,monthly_recurring_revenue_usdc,last_stream_at,total_tips_lifetime_usdc, andactive_subs, with currency values rounded to 2 decimal places.GET /api/routes-f/viewer-retentionendpoint that accepts astream_idquery parameter and returns apointsarray of{ minute, viewer_count, percent_of_peak }entries normalised against the stream's peak viewer count.POST /api/routes-f/notifications-readendpoint that acceptsviewer_id, an optionalidsarray, and an optionalallboolean to bulk-mark notifications as read, returningupdated_count.GETandPUT /api/routes-f/email-digestendpoints to read and update a viewer's weekly digest preference, withsectionsvalidated against thelive_alerts | new_clips | tip_summary | recommendationsenum.Tests added
app/api/routes-f/creator-dashboard/__tests__/route.test.tscovers missingcreator_idvalidation, 404 for unknown creators, correct stat aggregation, currency rounding to 2 decimal places, andnulllast_stream_atfor creators with no streams.app/api/routes-f/viewer-retention/__tests__/route.test.tscovers missingstream_idvalidation, 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.tscovers missingviewer_idvalidation, marking a single notification read, marking multiple notifications read, marking all unread notifications withall: true, skipping already-read entries, and viewer isolation.app/api/routes-f/email-digest/__tests__/route.test.tscovers missingviewer_idvalidation, 404 for unknown viewers, reading enabled and disabled preferences, togglingenabled, updatingday_of_week, updatingsections, rejecting invalid section values, and persistence across GET after PUT.Testing