Files
MathApp/progress/urls.py
Zareian 37a1741e0e add gamification characters (Duolingo-style mascot catalog)
New progress.Character model: an admin-managed catalog (same pattern as
subscription.Plan) of selectable mascots, each unlocked once the user's
XP crosses unlock_xp. No separate ownership table yet — unlocking is a
pure function of UserStats.xp, kept intentionally minimal since this is
the first of an incremental rollout the senior asked for.

- GET /api/characters — catalog with per-user unlocked/selected flags
- POST /api/characters/select — picks an active character, rejecting
  ones the user hasn't unlocked yet
- UserStats.selected_character_id tracks the pick
- seed_test_data now seeds 4 sample characters (owl/fox/turtle/lion)
  for local/staging testing

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-06 13:53:17 +03:30

20 lines
674 B
Python

from django.urls import path
from .views import (
CharacterListView,
LeaderboardView,
SelectCharacterView,
StreakCalendarView,
UserHeartsView,
UserSummaryView,
)
urlpatterns = [
path('user/summary', UserSummaryView.as_view(), name='user-summary'),
path('user/streak/calendar', StreakCalendarView.as_view(), name='streak-calendar'),
path('leaderboard', LeaderboardView.as_view(), name='leaderboard'),
path('user/hearts', UserHeartsView.as_view(), name='user-hearts'),
path('characters', CharacterListView.as_view(), name='character-list'),
path('characters/select', SelectCharacterView.as_view(), name='character-select'),
]