Skip to content

Fix dayTime merge logic to always use Comcigan's values - #16

Merged
injoon5 merged 1 commit into
mainfrom
claude/comcigan-neis-day-time-mh7zjs
Aug 29, 2026
Merged

injoon5 merged 1 commit into
mainfrom
claude/comcigan-neis-day-time-mh7zjs

Conversation

@injoon5

@injoon5 injoon5 commented Aug 29, 2026

Copy link
Copy Markdown
Owner

Summary

Changed the timetable merge logic to always use Comcigan's dayTime (bell times) instead of falling back to NEIS when Comcigan's is empty. This reflects the fact that NEIS doesn't provide period start times, making its dayTime data unusable as a fallback.

Key Changes

  • Modified merge logic (packages/client/src/timetable/merge.ts): Changed dayTime merging from conditional fallback (comcigan.dayTime.length > 0 ? comcigan.dayTime : neis.dayTime) to always using Comcigan's values ([...comcigan.dayTime])
  • Added test case (src/test/timetable-merge.ts): New test verifies that Comcigan's empty dayTime is preserved and never filled from NEIS
  • Updated documentation across multiple files:
    • API description in src/app.ts and openapi.json
    • Client documentation in apps/docs/content/docs/api/timetable.mdx and apps/docs/content/docs/client/timetable.mdx
    • Package README in packages/client/README.md

Implementation Details

  • The change clarifies that dayTime is a Comcigan-only field with no NEIS equivalent, unlike teacher which can fall back to NEIS
  • Added explanatory comments in the merge function documenting this behavior
  • All documentation now consistently states that day_time always comes from Comcigan and is blank when Comcigan has no data

https://claude.ai/code/session_01H4z4vv7pn6R3DbuNNKqQwe

The auto merge fell back to NEIS `dayTime` whenever Comcigan's was empty.
NEIS never publishes period start times (its `dayTime` is always `[]`), so
that fallback could only ever propagate a wrong or invented value. Take
Comcigan's bell times unconditionally, even when empty.

Adds a regression test and updates the API description and docs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H4z4vv7pn6R3DbuNNKqQwe
@vercel

vercel Bot commented Aug 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
school-api Ready Ready Preview Aug 29, 2026 12:00pm
school-api-docs Ready Ready Preview Aug 29, 2026 12:00pm

@injoon5
injoon5 merged commit 3186f2a into main Aug 29, 2026
4 checks passed

This branch was successfully deployed

2 active deployments
Preview – school-api-docs — 5e3c9d36 Deployed Aug 29, 2026 by vercel[bot]
Preview – school-api — 5e3c9d36 Deployed Aug 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants