module Handler.Utils.Schedule.Types.ScheduleEntry
  ( ScheduleEntry(..)
  ) where

import Import


data ScheduleEntry = ScheduleCourseEvent
                     { sceCourse     :: Entity Course  -- TODO: just course?
                     , sceType       :: CourseEventType
                     , sceRoom       :: CourseEventRoom
                     , sceOccurrence :: Either OccurrenceException OccurrenceSchedule
                     }
                   | ScheduleTutorial
                     { stCourse      :: Entity Course
                     , stName        :: TutorialName
                     , stType        :: TutorialType
                     , stRoom        :: Maybe Text  -- TODO: introduce TutorialRoom type synonym
                     , stOccurrence  :: Either OccurrenceException OccurrenceSchedule
                     }
                   | ScheduleExamOccurrence
                     { seoCourse     :: Entity Course
                     , seoExamName   :: ExamName
                     , seoRooms      :: NonEmpty ExamOccurrenceRoom
                     , seoStart      :: UTCTime
                     , seoEnd        :: Maybe UTCTime
                     }
  deriving (Generic, Typeable)
