feat(routes-f): add tip refund, heatmap, playback source, and resume …#1085
Merged
davedumto merged 1 commit intoJun 27, 2026
Conversation
|
@JoyLight00 is attempting to deploy a commit to the david's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@JoyLight00 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.
feat(routes-f): add 4 new route handlers — tip refund, tip heatmap, playback source selection, and resume position
Resolves #1048,
Closes : #1023,
Closes : #1030,
Closes : #1031
All files are scoped to
app/api/routes-f/per the task constraints. No modifications tolib/,utils/,types/,components/, or any other shared directories.Changes
1. Tip Refund Request (#1048)
POST /api/routes-f/tip-refund— Submits a refund request. Validates tip age (rejects >24h with 400), verifies tipper ownership (403 mismatch), returns{ request_id, status: "pending" }on success.POST /api/routes-f/tip-refund/resolve— Creator approves or denies a pending request. Returns 409 if already resolved.2. Tip Heatmap by Hour (#1023)
GET /api/routes-f/tip-heatmap?creator_id=...— Returns a 7x24 matrix of USDC totals bucketed by day-of-week and hour-of-day.America/New_York,Europe/London) viaIntl.DateTimeFormat.3. Viewer Playback Source Selection (#1030)
POST /api/routes-f/playback-source— Records a viewer's manual quality selection (viewer_id,playback_id,quality_label), maps to known resolutions.GET /api/routes-f/playback-source?viewer_id=...— Returns{ last_quality: { label, resolution } }.4. Resume from Last Position (#1031)
POST /api/routes-f/resume-position— Saves viewer VOD position (viewer_id,vod_id,position_seconds,duration_seconds). Automatically flagscompleted: truewhen position >= 95% of duration.GET /api/routes-f/resume-position?viewer_id=...&vod_id=...— Returns{ position_seconds, completed }.Tests
app/api/routes-f/__tests__/tip-refund.test.ts— 10 tests covering request creation, 24h expiry, tipper mismatch, approval, denial, and duplicate resolution.app/api/routes-f/__tests__/tip-heatmap.test.ts— 8 tests covering matrix shape, timezone lookup, and bucket math against known UTC timestamps.app/api/routes-f/__tests__/playback-source.test.ts— 7 tests covering store, overwrite, and retrieval.app/api/routes-f/__tests__/resume-position.test.ts— 10 tests covering save, resume, completion threshold, and overwrite.All tests pass.