This repository has been archived by the owner on Oct 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(school): create Interface CalendarEvent and different variant fo…
…r date, interval and lesson
- Loading branch information
1 parent
adc2081
commit 8110ebe
Showing
6 changed files
with
77 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
...n/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/CalendarEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
12 changes: 12 additions & 0 deletions
12
...omain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/DateEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
8 changes: 8 additions & 0 deletions
8
...main/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/DateLesson.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
20 changes: 20 additions & 0 deletions
20
...olDomain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/Lesson.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
17 changes: 17 additions & 0 deletions
17
...omain/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/WeekEvent.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
6 changes: 6 additions & 0 deletions
6
...main/src/main/kotlin/com/intelligentbackpack/schooldomain/entities/calendar/WeekLesson.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |