46 lines
1007 B
Python
46 lines
1007 B
Python
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
|