Spelling, separate Course struct from SearchResults

Separating the course struct will be useful for storing classes by CRN later on
This commit is contained in:
2024-01-29 14:13:36 -06:00
parent 56aad066f5
commit 10634c1210
4 changed files with 64 additions and 61 deletions

View File

@@ -53,6 +53,7 @@ The follow features, JSON, and more require validation & analysis:
- AFF vs AIN vs AHB etc. - AFF vs AIN vs AHB etc.
- Do CRNs repeat between years? - Do CRNs repeat between years?
- Check whether partOfTerm is always filled in, and it's meaning for various class results. - Check whether partOfTerm is always filled in, and it's meaning for various class results.
- Check which API calls are affected by change in term/sessionID term select
## Real-time Suggestions ## Real-time Suggestions

2
api.go
View File

@@ -10,7 +10,7 @@ import (
"strconv" "strconv"
"strings" "strings"
log "github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
) )
var sessionID string = RandomString(5) + Nonce() var sessionID string = RandomString(5) + Nonce()

View File

@@ -41,7 +41,7 @@ type YearDayRange struct {
} }
// GetYearDayRange returns the start and end day of each term for the given year. // GetYearDayRange returns the start and end day of each term for the given year.
// This could technichally introduce race conditions, but it's more likely confusion from UTC will be a greater issue. // This could technically introduce race conditions, but it's more likely confusion from UTC will be a greater issue.
// Spring: January 14th to May // Spring: January 14th to May
// Summer: May 25th - August 15th // Summer: May 25th - August 15th
// Fall: August 18th - December 10th // Fall: August 18th - December 10th

120
types.go
View File

@@ -240,63 +240,65 @@ type SearchResult struct {
Config string `json:"config"` Config string `json:"config"`
Display string `json:"display"` Display string `json:"display"`
} `json:"searchResultsConfig"` } `json:"searchResultsConfig"`
Data []struct { Data []Course `json:"data"`
// A internal identifier not used outside of the Banner system }
Id int `json:"id"`
// The internal identifier for the term this class is in (e.g. 202420) type Course struct {
Term string `json:"term"` // A internal identifier not used outside of the Banner system
// The human-readable name of the term this class is in (e.g. Fall 2021) Id int `json:"id"`
TermDesc string `json:"termDesc"` // The internal identifier for the term this class is in (e.g. 202420)
// The specific identifier that describes this individual course. CRNs are unique to a term. (TODO: Verify this is true) Term string `json:"term"`
CourseReferenceNumber string `json:"courseReferenceNumber"` // The human-readable name of the term this class is in (e.g. Fall 2021)
PartOfTerm string `json:"partOfTerm"` TermDesc string `json:"termDesc"`
CourseNumber string `json:"courseNumber"` // The specific identifier that describes this individual course. CRNs are unique to a term. (TODO: Verify this is true)
// The short acronym of the course subject (e.g. CS, AEPI) CourseReferenceNumber string `json:"courseReferenceNumber"`
Subject string `json:"subject"` PartOfTerm string `json:"partOfTerm"`
// The full name of the course subject (e.g. Computer Science, Academic English Program-Intl.) CourseNumber string `json:"courseNumber"`
SubjectDescription string `json:"subjectDescription"` // The short acronym of the course subject (e.g. CS, AEPI)
// The specific section of the course (e.g. 001, 002) Subject string `json:"subject"`
SequenceNumber string `json:"sequenceNumber"` // The full name of the course subject (e.g. Computer Science, Academic English Program-Intl.)
// The long name of the campus this course takes place at (e.g. Main Campus, Downtown Campus) SubjectDescription string `json:"subjectDescription"`
CampusDescription string `json:"campusDescription"` // The specific section of the course (e.g. 001, 002)
ScheduleTypeDescription string `json:"scheduleTypeDescription"` SequenceNumber string `json:"sequenceNumber"`
// The long name of the course (generally) // The long name of the campus this course takes place at (e.g. Main Campus, Downtown Campus)
CourseTitle string `json:"courseTitle"` CampusDescription string `json:"campusDescription"`
CreditHours int `json:"creditHours"` ScheduleTypeDescription string `json:"scheduleTypeDescription"`
// The maximum number of students that can enroll in this course // The long name of the course (generally)
MaximumEnrollment int `json:"maximumEnrollment"` CourseTitle string `json:"courseTitle"`
// The number of students currently enrolled in this course CreditHours int `json:"creditHours"`
Enrollment int `json:"enrollment"` // The maximum number of students that can enroll in this course
// The number of seats available in this course (MaximumEnrollment - Enrollment) MaximumEnrollment int `json:"maximumEnrollment"`
SeatsAvailable int `json:"seatsAvailable"` // The number of students currently enrolled in this course
// The number of students that could waitlist for this course Enrollment int `json:"enrollment"`
WaitCapacity int `json:"waitCapacity"` // The number of seats available in this course (MaximumEnrollment - Enrollment)
// The number of students currently on the waitlist for this course SeatsAvailable int `json:"seatsAvailable"`
WaitCount int `json:"waitCount"` // The number of students that could waitlist for this course
CrossList *string `json:"crossList"` WaitCapacity int `json:"waitCapacity"`
CrossListCapacity *int `json:"crossListCapacity"` // The number of students currently on the waitlist for this course
CrossListCount *int `json:"crossListCount"` WaitCount int `json:"waitCount"`
CrossListAvailable *int `json:"crossListAvailable"` CrossList *string `json:"crossList"`
CreditHourHigh *int `json:"creditHourHigh"` CrossListCapacity *int `json:"crossListCapacity"`
CreditHourLow *int `json:"creditHourLow"` CrossListCount *int `json:"crossListCount"`
CreditHourIndicator *string `json:"creditHourIndicator"` CrossListAvailable *int `json:"crossListAvailable"`
OpenSection bool `json:"openSection"` CreditHourHigh *int `json:"creditHourHigh"`
LinkIdentifier *string `json:"linkIdentifier"` CreditHourLow *int `json:"creditHourLow"`
IsSectionLinked bool `json:"isSectionLinked"` CreditHourIndicator *string `json:"creditHourIndicator"`
// A combination of the subject and course number (e.g. subject=CS, courseNumber=3443 => "CS3443") OpenSection bool `json:"openSection"`
SubjectCourse string `json:"subjectCourse"` LinkIdentifier *string `json:"linkIdentifier"`
ReservedSeatSummary *string `json:"reservedSeatSummary"` IsSectionLinked bool `json:"isSectionLinked"`
InstructionalMethod string `json:"instructionalMethod"` // A combination of the subject and course number (e.g. subject=CS, courseNumber=3443 => "CS3443")
InstructionalMethodDescription string `json:"instructionalMethodDescription"` SubjectCourse string `json:"subjectCourse"`
SectionAttributes []struct { ReservedSeatSummary *string `json:"reservedSeatSummary"`
Class string `json:"class"` InstructionalMethod string `json:"instructionalMethod"`
Code string `json:"code"` InstructionalMethodDescription string `json:"instructionalMethodDescription"`
CourseReferenceNumber string `json:"courseReferenceNumber"` SectionAttributes []struct {
Description string `json:"description"` Class string `json:"class"`
IsZtcAttribute bool `json:"isZTCAttribute"` Code string `json:"code"`
TermCode string `json:"termCode"` CourseReferenceNumber string `json:"courseReferenceNumber"`
} `json:"sectionAttributes"` Description string `json:"description"`
Faculty []FacultyItem `json:"faculty"` IsZtcAttribute bool `json:"isZTCAttribute"`
MeetingsFaculty []MeetingTimeResponse `json:"meetingsFaculty"` TermCode string `json:"termCode"`
} `json:"data"` } `json:"sectionAttributes"`
Faculty []FacultyItem `json:"faculty"`
MeetingsFaculty []MeetingTimeResponse `json:"meetingsFaculty"`
} }