Skip to content

Conversation

@DarinHajou
Copy link
Member

@DarinHajou DarinHajou commented Oct 9, 2025

This update finishes the backend side of the Watch Ads feature (subtask 2).
It adds the /watch-ads/session/:id/segment-complete endpoint so users can earn ad credits as they complete rewarded ad segments.

Each time a segment is completed, we now:

  • Increment completedSegments and earnedSecs in the session.

  • Mark the session as completed once all segments are done.

  • Increment or create a WatchAdsBalance record (both availableSecs and lifetimeEarnedSecs).

Session TTL is fixed to 24 hours.

Notes

We decided to keep this implementation simple for the MVP, per Philip’s direction:

  • No audit or ledger system yet.

  • No deduplication or idempotency checks.

  • No per-segment history.

A straightforward session + balance increment flow for now.

@vercel
Copy link

vercel bot commented Oct 9, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
map-of-pi-backend Ready Ready Preview Comment Oct 9, 2025 8:03am

@DarinHajou DarinHajou self-assigned this Oct 9, 2025
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