chore(lms): revise db model after discussion
This commit is contained in:
parent
944ef46d84
commit
aa73359893
@ -1,17 +1,28 @@
|
||||
Qualification
|
||||
school SchoolId
|
||||
name (CI Text)
|
||||
school SchoolId --TODO: Ansprechpartner der Schule in Briefe erwähnen
|
||||
shorthand (CI Text)
|
||||
name (CI Text)
|
||||
description StoredMarkup Maybe -- user-defined large Html, ought to contain full description
|
||||
validDuration CalendarDiffDays Maybe -- qualification is valid for this time
|
||||
refreshWithin CalendarDiffDays Maybe -- refresher is scheduled within this duration before expiry
|
||||
refreshInvitation StoredMarkup Maybe -- email/letter to send
|
||||
expiryNotification StoredMarkup Maybe
|
||||
UniqueSchoolName name shorthand -- must be unique per school and name
|
||||
validDuration Word Maybe -- qualification is valid for this number of months
|
||||
auditDuration Word Maybe -- number of month to keep audit log
|
||||
refreshWithin CalendarDiffDays Maybe -- refresher is scheduled within this number of month before expiry
|
||||
-- refreshInvitation StoredMarkup -- fest verdrahtet I18N-MSGs, nur Anzeige auf Webseite
|
||||
-- expiryNotification StoredMarkup Maybe
|
||||
elearningOnly Bool -- successful E-learing automatically increases validity
|
||||
UniqueSchoolShort school shorthand -- must be unique per school and shorthand
|
||||
-- to be expanded later
|
||||
UniqueSchoolName school name -- must be unique per school and name
|
||||
deriving Generic
|
||||
|
||||
-- Verknüpfung mit Exams fehlt only
|
||||
|
||||
QualificationUser
|
||||
user User
|
||||
qualification QualficationId
|
||||
validUntil UTCTime
|
||||
firstHeld UTCTime -- timestamp qualification earned
|
||||
lastRefresh UTCTIme -- lastRefresh > validUntil possible, indicates E-Learning success, but needs more (e.g. an exam)
|
||||
UniqueQualificationUser qualification user
|
||||
|
||||
QualificationEdit
|
||||
user User
|
||||
time UTCTime
|
||||
@ -19,22 +30,30 @@ QualificationEdit
|
||||
deriving Generic
|
||||
|
||||
-- LMS Interface Tables, need regular processing by background jobs
|
||||
|
||||
-- Logging?
|
||||
LmsUser
|
||||
qualification QualificationId
|
||||
user UserId
|
||||
ident LmsIdent
|
||||
pin Text
|
||||
resetPin Bool
|
||||
delete Bool
|
||||
started UTCTime
|
||||
deleted Bool
|
||||
started UTCTime Maybe
|
||||
ended UTCTime Maybe
|
||||
UniqueLmsUser qualification ident
|
||||
deriving Generic
|
||||
|
||||
LmsAudit
|
||||
qualifaction QualifactionId
|
||||
ident LmsIdent
|
||||
lastSeen UTCTime
|
||||
notificationType LmsNotification
|
||||
|
||||
LmsUserlist
|
||||
qualification QualificationId
|
||||
ident LmsIdent
|
||||
failed Bool
|
||||
timestamp UTCTime default=now()
|
||||
UniqueLmsUserlist qualification ident
|
||||
deriving Generic
|
||||
|
||||
@ -42,6 +61,7 @@ LmsUserlist
|
||||
LmsResult
|
||||
qualification QualificationId
|
||||
ident LmsIdent
|
||||
success UTCTime
|
||||
success Day
|
||||
timestamp UTCTime default=now()
|
||||
UniqueLmsResult qualification ident
|
||||
deriving Generic
|
||||
|
||||
@ -11,3 +11,8 @@ import Import.NoModel
|
||||
|
||||
|
||||
type LmsIdent = Text
|
||||
|
||||
data LmsNotfication = Blocked | Successs | Alive
|
||||
deriving (Eq, Ord, Read, Show, Enum, Bounded, Generic, Typeable)
|
||||
deriving (Universe, Finite, NFData)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user