yacs
yacs copied to clipboard
Standardize period types
We currently do not have a standard for period types. This could be a problem down the road, as it could prevent us from using that information meaningfully and consistently. So, we should add this to the API / schema doc. We should also add some validation to the periods jsonb column.
At RPI, the possible types are test
, lecture
, lab
and recitation
. These are listed as TES
, LEC
, LAB
, and REC
, though, so we should update adapter-banner-rpi
to transform those appropriately.
@A1Liu , do you know what all of the possible class types are at NYU?
cc @bmcutler
Related: #354
NYU has lecture
, lab
, seminar
, and recitation
as far as I can tell. Depending on the source they're formatted differently - the course catalog has them capitalized, and Gallatin doesn't have them at all.
Ok cool, thanks. So we can start off our official list of types as lecture
, lab
, test
, recitation
, and seminar
. If needed we can add to this at any point. Can you have your adapters transform them all to lower case to be consistent?
ok sounds good, will do.
Do you think it would be better to store them in the database with code numbers and have them be translated afterwards, or just store them as strings?
Good question... right now periods
are stored as a binary json column anyway so it would be a little tedious and not have much benefit, but if we ever normalize periods
into its own table it would make sense to use an enum like you suggest. I don't plan on normalizing periods
though unless a very good reason comes up. I think for now we can probably just add some validation to ensure only permitted values are saved.