Skip to content

Merge Comcigan + NEIS timetables; TimeforSchool naming - #14

Merged
injoon5 merged 6 commits into
mainfrom
cursor/neis-timetable-source-cbca
Aug 20, 2026
Merged

injoon5 merged 6 commits into
mainfrom
cursor/neis-timetable-source-cbca

Conversation

@injoon5

@injoon5 injoon5 commented Aug 20, 2026 •

Copy link
Copy Markdown
Owner

Default GET /timetable is source=auto: Comcigan + NEIS in parallel, then merge.

Merge rules

  • Shorter subject wins (Comcigan on a tie)
  • Missing weekdays/periods fill from the other source
  • Cancelled Comcigan periods stay cancelled
  • NEIS Saturday is dropped (stale 토요휴업일)
  • Pin source=comcigan or source=neis for one upstream
  • source=auto still 409s if Comcigan’s search is ambiguous, even when NEIS succeeded

School identity

NEIS name lookup uses the first row NEIS returns. 양정고등학교 → Seoul (7010208), not 409. Pass schoolcode if you want Busan. Comcigan still 409s when its own search is ambiguous.

API changes vs main

New

  • GET /timetable?source= — auto (default) | comcigan | neis
  • fetchTimeTable({ source }) — same default
  • NEIS_UPSTREAM_ERROR (502) for NeisException / unknown SCHUL_KND_SC_NM (was 500)

Fields that can now be empty

Same JSON keys. Empty when Comcigan has nothing to overlay:

Field When empty
teacher "" — NEIS does not publish teachers
day_time [] — NEIS does not publish bell times
update_date "" — NEIS omitted LOAD_DTM
original null on NEIS-only periods
replaced always false on NEIS-only periods

Behavior that changed

  • Subjects can be shorter (Comcigan nicknames win over official NEIS names)
  • More periods than Comcigan-only: auto fills missing days/periods from NEIS (양정고 1-3 this week: 32 → 34)
  • Saturday: not filled from NEIS. Week is Mon–Fri unless Comcigan published Saturday
  • Cancelled Comcigan periods stay empty — not overwritten with NEIS 여름방학
  • Schools with no Comcigan (외대부고): auto falls through to NEIS. Empty week after the school resolved is NEIS_DATA_NOT_FOUND, not “school not found”. Official name 용인한국외국어대학교부설고등학교 / 7531146. schoolname=외대부고 still 404s
  • GET / name: "TimeForSchool" → "TimeforSchool"
  • TIMETABLE_SCHOOL_NOT_FOUND message no longer says “Comcigan could not find…”
  • TIMETABLE_INVALID_GRADE_CLASS details now include source

Client (@timeforschool/client)

  • Removed: Neispy, NeispyOptions
  • Added: fetchNeisTimeTable, pickSchoolRow, timetableKindFromSchool, isLegacyTimetable, timetable/major/classroom types
  • Default fetchTimeTable now hits NEIS as well (pass source: "comcigan" for old behavior)

Quality

TimeforSchool branding. Neispy and render.yaml gone. API on icn1. HTTP reuses one NeisClient.

Open in Web Open in Cursor 

Port remaining neispy endpoints onto NeisClient and let GET /timetable
switch with source=neis. NEIS leaves teacher names, bell times, and
substitution originals blank because the Open API does not publish them.

Co-authored-by: Injoon Oh <injoon5@icloud.com>
@vercel

vercel Bot commented Aug 20, 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 20, 2026 3:36pm
school-api-docs Ready Ready Preview Aug 20, 2026 3:36pm

Comcigan stays the default source of truth (fresher updates, teachers,
bell times, substitutions). NEIS fills that same response shape and
leaves unpublished fields blank — Comcigan output is not stripped to
match NEIS.

Co-authored-by: Injoon Oh <injoon5@icloud.com>
@cursor cursor Bot changed the title Add NEIS official timetable source Add NEIS timetable fallback; keep Comcigan as the preferred source Aug 20, 2026
source=auto (now the default) fetches both in parallel: shorter subject
wins, weekday gaps fill from the other, cancelled Comcigan periods stay.
NEIS Saturday is dropped — leftover 토요휴업일 is stale.

Co-authored-by: Injoon Oh <injoon5@icloud.com>
@cursor cursor Bot changed the title Add NEIS timetable fallback; keep Comcigan as the preferred source Merge Comcigan + NEIS timetables by default Aug 20, 2026
TimeforSchool branding. Partial NEIS names 409 instead of rows[0].
Comcigan scrape lives in comcigan.ts; merge is comcigan/neis overlay.
API deploys to icn1. No Effect — this is still a thin HTTP wrapper.

Co-authored-by: Injoon Oh <injoon5@icloud.com>
@cursor cursor Bot changed the title Merge Comcigan + NEIS timetables by default Merge Comcigan + NEIS timetables; TimeforSchool naming Aug 20, 2026
양정고등학교 is Seoul and Busan. Name-only requests use NEIS order
(서울 first) instead of SCHOOL_AMBIGUOUS.

Co-authored-by: Injoon Oh <injoon5@icloud.com>
Ambiguous Comcigan school search was falling through to a NEIS-only
timetable (blank teachers). Pin that to TIMETABLE_AMBIGUOUS_SCHOOL.

Co-authored-by: Injoon Oh <injoon5@icloud.com>
@injoon5
injoon5 marked this pull request as ready for review August 20, 2026 22:06
@injoon5
injoon5 merged commit ed816c0 into main Aug 20, 2026
5 checks passed

This branch was successfully deployed

2 active deployments
Preview – school-api — a635db3c Deployed Aug 20, 2026 by vercel[bot]
Preview – school-api-docs — a635db3c Deployed Aug 20, 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