From dd4a3d50d880062f4465432d8a0afc844b842439 Mon Sep 17 00:00:00 2001 From: shay Date: Mon, 20 Apr 2026 11:36:45 -0400 Subject: [PATCH] feat(streaks): add StreakData model --- generator/src/models/__init__.py | 2 ++ generator/src/models/types.py | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/generator/src/models/__init__.py b/generator/src/models/__init__.py index bfd864b..463f1a1 100644 --- a/generator/src/models/__init__.py +++ b/generator/src/models/__init__.py @@ -8,6 +8,7 @@ from .types import ( FocusCategory, LanguageData, AchievementData, + StreakData, ) __all__ = [ @@ -18,4 +19,5 @@ __all__ = [ "FocusCategory", "LanguageData", "AchievementData", + "StreakData", ] diff --git a/generator/src/models/types.py b/generator/src/models/types.py index f8bf7c8..9db4fb4 100644 --- a/generator/src/models/types.py +++ b/generator/src/models/types.py @@ -56,3 +56,13 @@ class AchievementData: subtitle: str = "" event_date: str = "" 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)