Skip to content

feat: rewards tx verification, course reporting, course analytics, and session management - #456

Merged
DeFiVC merged 6 commits into
ChainLearnOfficial:mainfrom
codebestia:feat/drips-wave
Sep 1, 2026
Merged

feat: rewards tx verification, course reporting, course analytics, and session management#456
DeFiVC merged 6 commits into
ChainLearnOfficial:mainfrom
codebestia:feat/drips-wave

Conversation

@codebestia

Copy link
Copy Markdown
Contributor

Summary

  • Add GET /api/v1/rewards/transactions — lists a user's reward-related
    blockchain transactions, each verified against Stellar Horizon
    (confirmed/pending/failed), with block height and confirmation count.
    Cached 30s.
  • Add 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.
  • Add GET /api/v1/admin/courses/:id/analytics — daily/weekly enrollment
    trends, 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.
  • Add session management under /api/v1/auth/sessions:
    GET lists the caller's active sessions (device info, last activity),
    DELETE /:sessionId revokes one — the token is blacklisted immediately
    via the existing JWT denylist. Sessions are tracked on every
    authGuard-protected request.

Database changes

  • course_reports table (migration 0021_course_reports.sql)
  • sessions table (migration 0022_sessions.sql)

Related Issues

Closes #336
Closes #337
Closes #338
Closes #339

…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.
@drips-wave

drips-wave Bot commented Sep 1, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@DeFiVC
DeFiVC merged commit 85c62e4 into ChainLearnOfficial:main Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants