feat(allocations): create model for allocations

This commit is contained in:
Steffen Jost 2019-07-25 20:06:24 +02:00
parent 823b367d5a
commit 82e3bf95c4

74
models/allocations Normal file
View File

@ -0,0 +1,74 @@
-- Reconsider all attributes commented out with "--?". Those might be added later, but are not important for now
Allocation -- attributes with prefix staff- affect lecturers only, but are invisble to students
name (CI Text)
shorthand (CI Text) -- practical shorthand
term TermId
school SchoolId -- school that manages this central allocation, not necessarily school of courses
description Html Maybe -- description for prospective students
staffDescription Html Maybe -- description seen by prospective lecturers only
linkExternal Text Maybe -- arbitrary user-defined url for external course page
capacity Int Maybe -- number of allowed enrolements, if restricte
staffRegisterFrom UTCTime Maybe -- lectureres may register courses
staffRegisterTo UTCTime Maybe -- course registration stops
-- staffDeregisterUntil not needed: staff may make arbitrary changes until staffRegisterTo, always frozen afterwards
staffAllocationFrom UTCTime Maybe -- lecturers may accept applicants from this day onwwards or prohibited
staffAllocationTo UTCTime Maybe --
--? staffMaterial Bool -- courses may provide files for prospective students. ?Why would we ever disallow this? Can be easily circumvented anyway.
--? staffUpload Bool -- or UploadModeDescr -- ?Why would want to prevent staff from asking for application-files? Can be circumvented anyway.
-- Student register for this allocation
-- canRegisterNow = maybe False (<= currentTime) registerFrom && maybe True (>= currentTime) registerTo
registerFrom UTCTime Maybe -- student applications allowed from a given day onwwards or prohibited
registerTo UTCTime Maybe -- student applications may be prohibited from a given date onwards
-- deregisterUntil not needed: students may withdraw applicants until registerTo, but never after. Also see overrideDeregister
registerSecret Text Maybe -- enrolement maybe protected by a simple common passphrase
-- overrides
registerByStaffFrom UTCTime Maybe -- lecturers may directly enrol/disenrol students after a given date or prohibited
registerByStaffTo UTCTime Maybe
registerByCourse UTCTime Maybe -- course registration dates are ignored until this day has passed or always prohibited
overrideDeregister UTCTime Maybe -- course deregistration enforced to be this date, i.e. students may disenrol from course before or never
-- overrideVisible not needed, since courses are always visible
TermSchoolAllocationShort term school shorthand -- shorthand must be unique within school and semester
TermSchoolAllocationName term school name -- name must be unique within school and semester
AllocationCourse
allocation AllocationId
course CourseId
applicationText Bool -- lecturer will read application texts supplied by users
applicationFiles UploadMode -- lecturer wants to receive course specific application files?
UniqueAllocationCourse allocation course
AllocationCourseFile
allocation AllocationId
course CourseId
file FileId
--? AllocationUser --? not needed requestCourses::Int bette encoded per course: student wants only 1 course, except if allocation in course y is possible
--? user UserId
--? allocation AllocationId
--? requestCourses Int -- >0, number of requested courses
--? UniqueAllocationUser allocation user
AllocationUserCourse
allocation AllocationId
user UserId
course CourseId
text Html Maybe -- free text entered by user
priority Int -- positive positive priority, higher number means higher priority
totalCourses Int -- positive, number of total allocated courses for this user must be <= than this number
ratingVeto Bool
ratingPoints Points Maybe -- "Just" does not mean done; not yet visible to participant
ratingComment Text Maybe -- "Just" does not mean done; not yet visible to participant
UniqueAllocationUserCourse allocation user course
AllocationUserFile -- supplemental file for application by a user for a certain course, not unique
allocation AllocationId
user UserId
course CourseId
file FileId
--? not sure we really want to track this, might be problematic; also CourseParticipant would need to track if it was created by allocation or through other means!
AllocationDeregister -- user deregistered from an allocated course
user UserId
allocation AllocationId
course CourseId
time UTCTime