Summary
catalog course list / catalog section list (and their TUIs) print an ID column containing the internal id, but catalog course view <jw-id> / catalog section view <jw-id> look up by the registrar-assigned jwId. The copy-paste workflow the CLI invites — list something, copy its ID, view it — fails.
Evidence
internal/cmd/course/course.go:124-131: courseListColumns() = {Code, Name, Level, ID: "id"}
internal/cmd/course/course.go:157-172: view <jw-id> → GetCourse(ctx, jwId) → GET /api/courses/{jwId}
internal/cmd/section/section.go:159 shows ID: "id"; section.go:192-205 view <jw-id> → GetSection(ctx, jwId)
api/openapi.json: courseDetailSchema carries both id and jwId (distinct key spaces); GET /api/courses/{jwId} is parameterized on jwId.
So a user who runs life-ustc catalog course, sees e.g. ID = 4521, and runs life-ustc catalog course view 4521 gets a 404 (or the wrong record if the spaces collide), because 4521 was the internal id, not the jwId. (catalog teacher is consistent — list shows id and teacher view takes the internal id — so this affects course and section only.)
Suggested fix
Show jwId (as JW ID or replacing ID) in course/section list columns and in the TUI result tables, and/or accept both identifier kinds in view (e.g. try jwId then fall back to internal id). The TUI drill-down proposed in #14 would also need the jwId to be carried in the row.
Summary
catalog course list/catalog section list(and their TUIs) print anIDcolumn containing the internalid, butcatalog course view <jw-id>/catalog section view <jw-id>look up by the registrar-assignedjwId. The copy-paste workflow the CLI invites — list something, copy its ID, view it — fails.Evidence
internal/cmd/course/course.go:124-131:courseListColumns()={Code, Name, Level, ID: "id"}internal/cmd/course/course.go:157-172:view <jw-id>→GetCourse(ctx, jwId)→GET /api/courses/{jwId}internal/cmd/section/section.go:159showsID: "id";section.go:192-205view <jw-id>→GetSection(ctx, jwId)api/openapi.json:courseDetailSchemacarries bothidandjwId(distinct key spaces);GET /api/courses/{jwId}is parameterized onjwId.So a user who runs
life-ustc catalog course, sees e.g.ID = 4521, and runslife-ustc catalog course view 4521gets a 404 (or the wrong record if the spaces collide), because 4521 was the internalid, not thejwId. (catalog teacheris consistent — list showsidandteacher viewtakes the internal id — so this affects course and section only.)Suggested fix
Show
jwId(asJW IDor replacingID) in course/section list columns and in the TUI result tables, and/or accept both identifier kinds inview(e.g. try jwId then fall back to internal id). The TUI drill-down proposed in #14 would also need the jwId to be carried in the row.