feat(streaks): add StreakData model

This commit is contained in:
shay
2026-04-20 11:36:45 -04:00
parent 5a2bc11840
commit dd4a3d50d8
2 changed files with 12 additions and 0 deletions
+2
View File
@@ -8,6 +8,7 @@ from .types import (
FocusCategory, FocusCategory,
LanguageData, LanguageData,
AchievementData, AchievementData,
StreakData,
) )
__all__ = [ __all__ = [
@@ -18,4 +19,5 @@ __all__ = [
"FocusCategory", "FocusCategory",
"LanguageData", "LanguageData",
"AchievementData", "AchievementData",
"StreakData",
] ]
+10
View File
@@ -56,3 +56,13 @@ class AchievementData:
subtitle: str = "" subtitle: str = ""
event_date: str = "" event_date: str = ""
icon: str = "trophy" # trophy, medal, star, hackathon icon: str = "trophy" # trophy, medal, star, hackathon
@dataclass
class StreakData:
current: int = 0 # consecutive days ending today (or yesterday under grace)
max: int = 0 # all-time longest observed streak
current_start: str = "" # ISO date the current streak started, "" if current == 0
last_active_date: str = "" # most recent date with contributions in the window
max_start: str = "" # ISO date the max streak started (best-effort)
max_end: str = "" # ISO date the max streak ended (best-effort)