diff --git a/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/CalendarEvent.kt b/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/CalendarEvent.kt new file mode 100644 index 00000000..17731f40 --- /dev/null +++ b/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/CalendarEvent.kt @@ -0,0 +1,14 @@ +package com.intelligentbackpack.schooldomain.entities.calendar + +import java.time.LocalTime + +/** + * An event in the calendar. + * + * @property startTime the time the event starts + * @property endTime the time the event ends + */ +interface CalendarEvent { + val startTime: LocalTime + val endTime: LocalTime +} diff --git a/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/DateEvent.kt b/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/DateEvent.kt new file mode 100644 index 00000000..f0ca87e5 --- /dev/null +++ b/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/DateEvent.kt @@ -0,0 +1,12 @@ +package com.intelligentbackpack.schooldomain.entities.calendar + +import java.time.LocalDate + +/** + * An event that happens on a specific date. + * + * @property date the date of the event + */ +interface DateEvent : CalendarEvent { + val date: LocalDate +} diff --git a/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/DateLesson.kt b/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/DateLesson.kt new file mode 100644 index 00000000..3c4ba1a5 --- /dev/null +++ b/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/DateLesson.kt @@ -0,0 +1,8 @@ +package com.intelligentbackpack.schooldomain.entities.calendar + +/** + * Represents a lesson that occurs on a specific date. + * + * @property date the date of the lesson + */ +interface DateLesson : Lesson, DateEvent diff --git a/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/Lesson.kt b/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/Lesson.kt new file mode 100644 index 00000000..5300b9a6 --- /dev/null +++ b/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/Lesson.kt @@ -0,0 +1,20 @@ +package com.intelligentbackpack.schooldomain.entities.calendar + +import com.intelligentbackpack.schooldomain.entities.Class +import com.intelligentbackpack.schooldomain.entities.Subject +import com.intelligentbackpack.schooldomain.entities.person.Professor + +/** + * A lesson. + * + * @property subject the subject of the lesson + * @property module the module of the lesson + * @property professor the professor of the lesson + * @property studentsClass the class of the lesson + */ +interface Lesson : CalendarEvent { + val subject: Subject + val module: String? + val professor: Professor + val studentsClass: Class +} diff --git a/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/WeekEvent.kt b/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/WeekEvent.kt new file mode 100644 index 00000000..84a33c1d --- /dev/null +++ b/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/WeekEvent.kt @@ -0,0 +1,17 @@ +package com.intelligentbackpack.schooldomain.entities.calendar + +import java.time.DayOfWeek +import java.time.LocalDate + +/** + * An event that happens every week at the same time on the same day of the week for a certain period of time. + * + * @property day the day of the week the event happens + * @property fromDate the date from which the event happens + * @property toDate the date until which the event happens + */ +interface WeekEvent : CalendarEvent { + val day: DayOfWeek + val fromDate: LocalDate + val toDate: LocalDate +} diff --git a/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/WeekLesson.kt b/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/WeekLesson.kt new file mode 100644 index 00000000..0a9bd596 --- /dev/null +++ b/schoolDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/WeekLesson.kt @@ -0,0 +1,6 @@ +package com.intelligentbackpack.schooldomain.entities.calendar + +/** + * A lesson that happens every week at the same time on the same day. + */ +interface WeekLesson : Lesson, WeekEvent