feat: review and rebalance Week Ahead (Closes #1188)
CI / lint (pull_request) Successful in 3m31s
CI / build-release (pull_request) Successful in 7s
CI / browser-journey (pull_request) Successful in 4m48s
CI / release-candidate (pull_request) Has been skipped

This commit is contained in:
timmy committed 2026-08-20 17:36:02 +00:00
1 parent 69532bdc1f
commit d5f13c4afb
21 files changed
+351 -53

No files matched your search

+5
View File
@@ -495,6 +495,7 @@ class TodayStore:
raise ValueError("timezone must be a valid IANA timezone") from None
normalized = []
seen_dates = set()
seen_ids = set()
for day in days:
if not isinstance(day, dict):
raise ValueError("each Week Ahead date must be an object")
@@ -511,6 +512,10 @@ class TodayStore:
ids=day.get("ids", []), capacity_minutes=day.get("capacity_minutes"),
estimates=day.get("estimates", {}), plan_date=plan_date, timezone=timezone,
)
duplicate_ids = seen_ids.intersection(plan["ids"])
if duplicate_ids:
raise ValueError("work must be assigned to only one Week Ahead date")
seen_ids.update(plan["ids"])
plan.pop("timezone")
normalized.append(plan)
normalized.sort(key=lambda item: item["plan_date"])