feat: rewards tx verification, course reporting, course analytics, and session management - #456
Merged
Merged
Conversation
…hainLearnOfficial#1) Lists a user's reward-related blockchain transactions with on-chain verification status (confirmed/pending/failed), block height, and confirmation count, verified against Stellar Horizon and cached 30s.
…hainLearnOfficial#2) Users can report a course as inappropriate, outdated, erroneous, or other, one report per user per course. Admins are notified in-app via the notifications table when a new report comes in.
…oses ChainLearnOfficial#3) Aggregates daily/weekly enrollment trends, completion rate, average time-to-complete, average quiz score, and per-module quiz performance so course creators can spot modules learners struggle with most. Cached for 1 hour.
…nLearnOfficial#4) Adds GET /api/v1/auth/sessions to list the caller's active sessions with device info and last-activity time, and DELETE /api/v1/auth/sessions/:sessionId to revoke one — the revoked session's token is blacklisted immediately via the existing JWT denylist. Sessions are tracked (upserted) on every authGuard-protected request.
|
@codebestia 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.
Summary
GET /api/v1/rewards/transactions— lists a user's reward-relatedblockchain transactions, each verified against Stellar Horizon
(confirmed/pending/failed), with block height and confirmation count.
Cached 30s.
POST /api/v1/courses/:id/report— lets users report a course(inappropriate/outdated/error/other), one report per user per course.
Admins are notified in-app when a new report comes in.
GET /api/v1/admin/courses/:id/analytics— daily/weekly enrollmenttrends, completion rate, average time-to-complete, average quiz score,
and per-module quiz performance (flags modules learners struggle with
most). Admin-only, cached 1 hour.
/api/v1/auth/sessions:GETlists the caller's active sessions (device info, last activity),DELETE /:sessionIdrevokes one — the token is blacklisted immediatelyvia the existing JWT denylist. Sessions are tracked on every
authGuard-protected request.Database changes
course_reportstable (migration0021_course_reports.sql)sessionstable (migration0022_sessions.sql)Related Issues
Closes #336
Closes #337
Closes #338
Closes #339