diff options
| author | Christian Cleberg <[email protected]> | 2026-04-11 13:58:01 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-11 13:58:01 -0500 |
| commit | 6149ca9c394df7d316f80db05ad0fc2aea6c550d (patch) | |
| tree | 11f6cebc445e14b4a79adae648eb46d4be710071 /src/srht_contrib/schemas.py | |
| parent | b6d1348abf907b8b9c16ab87487eb9384dc4cc89 (diff) | |
| download | hutch-stats-6149ca9c394df7d316f80db05ad0fc2aea6c550d.tar.gz hutch-stats-6149ca9c394df7d316f80db05ad0fc2aea6c550d.tar.bz2 hutch-stats-6149ca9c394df7d316f80db05ad0fc2aea6c550d.zip | |
feat: add lazy actor indexing for contribution lookups
Diffstat (limited to 'src/srht_contrib/schemas.py')
| -rw-r--r-- | src/srht_contrib/schemas.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/srht_contrib/schemas.py b/src/srht_contrib/schemas.py index 2a00996..bebf93d 100644 --- a/src/srht_contrib/schemas.py +++ b/src/srht_contrib/schemas.py @@ -1,6 +1,7 @@ from __future__ import annotations from datetime import date, datetime +from typing import Literal from pydantic import BaseModel, Field, model_validator @@ -23,7 +24,13 @@ class ContributionDay(BaseModel): score: float -class ContributionCalendarResponse(BaseModel): +class ContributionIndexMetadata(BaseModel): + is_indexed: bool + last_polled_at: datetime | None = None + indexing_state: Literal["pending", "indexed", "error"] + + +class ContributionCalendarResponse(ContributionIndexMetadata): actor: str from_date: date = Field(alias="from") to_date: date = Field(alias="to") @@ -32,7 +39,7 @@ class ContributionCalendarResponse(BaseModel): model_config = {"populate_by_name": True} -class ContributionStatsResponse(BaseModel): +class ContributionStatsResponse(ContributionIndexMetadata): actor: str from_date: date = Field(alias="from") to_date: date = Field(alias="to") |
