-- | This module defined the types used to interface to the -- database access functions from the different user interface modules module StudentPortalCommon where -- | Database access functions for the Student Portal user interfaces data StudentPortalFunctions = SP { getInformation :: Idnr -> IO StudentInformation, registerStudent :: Idnr -> CourseCode -> IO StatusMessage, unregisterStudent :: Idnr -> CourseCode -> IO StatusMessage } type Idnr = String -- or Int? type CourseCode = String type StatusMessage = String -- e.g. "You are now registered to ..." type StudentInformation = (BasicInformation, [ReadCourse], [RegisteredCourse], [UnreadCourse], PathToGraduation) type BasicInformation = (Idnr,Name,Login,Program,Maybe Branch) type ReadCourse = (CourseCode,CourseName,Credits,Grade) type RegisteredCourse = (CourseCode,CourseName,Status) type UnreadCourse = (CourseCode,CourseName) data PathToGraduation = PtG { totalCredits, mathCredits, researchCredits::Credits, seminarCourses,mandatoryLeft::Int, qualified::Bool } type Name = String type Login = String type Program = String type Branch = String type CourseName = String type Department = String type Credits = Double type Grade = String -- "U", "3", "4", "5" data Status = Registered | Waiting Int