fix: courseCode and sectionCode are inconsistent #1087
Labels
codefix
Refactoring or improving the codebase
good first task
Good task for someone new to the project
high
High priority issue
Context
WebSOC declares the five digit string which represents a section in a given quarter as a "course code" (e.g. 35560 -> ICS 31 Lec in Winter 25). However, the Anteater API describes "course code" as "section code", which is a more accurate name for the value. AntAlmanac's codebase generally agrees with this renaming, using
sectionCode
~250 times.Issue
Across AntAlmanac's codebase, there are also roughly ~30 instances where we refer to the five digit numeric string which represents a section in a given quarter, as a "Course Code" (e.g.
courseCode
).This inconsistency is most prominent when we encode course/section codes as
courseCode
, and decode the value as such. This is problematic because we would then query Anteater API withcourseCode
as a field, which returns nothing as the Anteater API does not accept such a field.Example: This link, https://antalmanac.com/?courseCode=35510, which we provide from the actions cell dropdown in the search pane, doesn't work.
Solution
In every case where
courseCode
is referenced in business logic, we should correctly rename and rewrite to usesectionCode
instead. For user-facing content (such as the manual search input), we could continue to match WebSOC, but I'm of the opinion that we should agree with Anteater API and use section code there as well.The text was updated successfully, but these errors were encountered: