T13: fit.today + fit.deadlines aggregates #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "t13-aggregates"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
T13: Aggregates (
fit.today,fit.deadlines)Stacked on #11 (
t12-marast) → … → #1. Merge those first.What
fit.today({ date? }): that day's classes and exams (Sirius), slimmed down to type, course, course name, time, room, teacher names andmoved. PlusdueSoon: Marast quizzes closing that day or within the 2 days after.datedefaults to today in Europe/Prague.fit.deadlines({ from?, to? }): a merged, time-sorted list of exams and assessments (Sirius, the terms the user is registered for) and Marast quizzes (by closing time). Defaults to today + 14 days, with a maximum of 120 days. Items havekind,title,course,at, a Praguedate,source,roomandopensAt.warningsentry built from the safetoErrorPayloadcodes (reauth_required,upstream_error, …), de-duplicated per source and code. Upstream bodies never appear.truncatedwarning. Quizzes that already closed inside the range are included, because we fetch all quizzes and filter by date.fit.status, sosearchanddescribeshow them early, as SPEC §6 intends for one-call answers.Verified
bun run lint && bun run typecheck && bun run test: 171 tests, 11 of them for the aggregates. They cover today's classes plus due-soon, a failing source returning a safe warning, an explicit date, the merge and sort of exams, assessments and quizzes, range filtering with de-duplicated warnings, range validation, closed quizzes in past ranges and earlier today, truncation warnings, and Czech and English search ("co mám dnes", "what's on tomorrow", "upcoming deadlines").bun run dev+curl /api/functionslists 11 functions.Astra review (gpt-6-astra)
Fixed (both):
truncatedwas dropped, so capped results looked complete →truncatedwarning. Test added.🤖 Generated with Claude Code