Course planner backend: transcript grades in parse response, plan + checklist tables - #197
Draft
jerryzhou196 wants to merge 2 commits into
Draft
Course planner backend: transcript grades in parse response, plan + checklist tables#197jerryzhou196 wants to merge 2 commits into
jerryzhou196 wants to merge 2 commits into
Conversation
…cklist tables - Transcript parser now extracts per-course units and numeric grades and returns a per-term breakdown in the /parse/transcript response. Grades are returned for the client's local GPA calculator only and are never written to the database (per privacy policy). - New migration: user_course_plan (courses planned into future terms, modeled on user_shortlist) and checklist (maintainer-seeded degree requirement checklists as JSONB, each requirement a list of "one of" alternatives), with Hasura metadata and user permissions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
user_course_taken has a per-statement trigger in prod that refreshes
materialized.course_recommendation. Inserting one course at a time turned
a transcript upload into ~40 sequential matview refreshes, easily
exceeding the 10s request deadline ("deleting old courses: timeout").
One unnest-join INSERT brings the whole save down to two statements.
courses_imported now reports rows actually inserted (unknown course
codes no longer count).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backend half of the new course planner (
/plan) feature — frontend PR: UWFlow/uwflow_frontend#281.Changes
flow/api/parse/transcript): extracts per-course units (attempted credits) and numeric grades from each course line, and/parse/transcriptnow returns a per-term breakdown (terms: [{term_id, level, courses: [{code, units, grade}]}]). Grades are returned for the client's local GPA calculator only and are never written to the database, consistent with the privacy policy ("We do not store your grades"). CR/NG/current-term courses havegrade: null.1782938317000_add_course_planner:user_course_plan (user_id, course_id, term_id)— courses planned into future terms, modeled onuser_shortlist, user-editable through Hasura.checklist (id, name, requirements jsonb)— maintainer-seeded degree requirement checklists; each requirement is a list of "one of" alternative course codes. Seeded with Honours CS, Honours Math, and Software Engineering core checklists.user_course_takenhas a per-statement trigger in prod refreshingmaterialized.course_recommendation, so per-course INSERTs turned one upload into ~40 sequential matview refreshes and blew the 10s request deadline.courses_importednow counts rows actually inserted.X-Hasura-User-Id).Testing
go test ./api/parse/...passes; transcript test expectations extended with units/grades derived independently from the test PDFs viapdftotext -layout.go build ./...andgo vet ./api/...clean.hasura migrate apply+metadata applyon nextmake start.🤖 Generated with Claude Code