Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat(school): create Interface CalendarEvent and different variant fo…
Browse files Browse the repository at this point in the history
…r date, interval and lesson
  • Loading branch information
AndreaBrighi committed May 27, 2023
1 parent adc2081 commit 8110ebe
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 0 deletions.
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
}
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
}
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
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
}
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
}
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

0 comments on commit 8110ebe

Please sign in to comment.