feat: add community contribution ranks
This commit is contained in:
45
apps/gamification/api/schemas.py
Normal file
45
apps/gamification/api/schemas.py
Normal file
@@ -0,0 +1,45 @@
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
from ninja import Schema
|
||||
|
||||
|
||||
class GamificationLevelSchema(Schema):
|
||||
id: str
|
||||
label: str
|
||||
minimum_points: int
|
||||
|
||||
|
||||
class GamificationBadgeSchema(Schema):
|
||||
id: str
|
||||
category: str
|
||||
label: str
|
||||
description: Optional[str] = None
|
||||
threshold: Optional[int] = None
|
||||
|
||||
|
||||
class GamificationActivityCountsSchema(Schema):
|
||||
attendance: int
|
||||
posts: int
|
||||
comments: int
|
||||
likes: int
|
||||
|
||||
|
||||
class GamificationSummarySchema(Schema):
|
||||
points_total: int
|
||||
points_event: int
|
||||
points_blog: int
|
||||
activity_counts: GamificationActivityCountsSchema
|
||||
levels: List[GamificationLevelSchema]
|
||||
points_per_activity: Dict[str, int]
|
||||
badge_thresholds: Dict[str, List[int]]
|
||||
current_level: GamificationLevelSchema
|
||||
next_level: Optional[GamificationLevelSchema] = None
|
||||
points_to_next: int
|
||||
progress_percent: int
|
||||
badges: List[GamificationBadgeSchema]
|
||||
|
||||
|
||||
class PublicGamificationBadgeSchema(Schema):
|
||||
id: str
|
||||
category: str
|
||||
label: str
|
||||
Reference in New Issue
Block a user