generated from pricelees/issue-pr-template
[#44] 매장 기능 도입 #45
@ -0,0 +1,28 @@
|
|||||||
|
package roomescape.schedule.business.domain
|
||||||
|
|
||||||
|
import roomescape.schedule.infrastructure.persistence.ScheduleStatus
|
||||||
|
import roomescape.theme.infrastructure.persistence.Difficulty
|
||||||
|
import java.time.LocalDate
|
||||||
|
import java.time.LocalTime
|
||||||
|
|
||||||
|
class ScheduleWithThemeSummary(
|
||||||
|
val id: Long,
|
||||||
|
val date: LocalDate,
|
||||||
|
val time: LocalTime,
|
||||||
|
val themeId: Long,
|
||||||
|
val themeName: String,
|
||||||
|
val themeDifficulty: Difficulty,
|
||||||
|
val themeAvailableMinutes: Short,
|
||||||
|
val status: ScheduleStatus
|
||||||
|
) {
|
||||||
|
fun getEndAt(): LocalTime {
|
||||||
|
return time.plusMinutes(themeAvailableMinutes.toLong())
|
||||||
|
}
|
||||||
|
|
||||||
|
fun containsTime(targetTime: LocalTime): Boolean {
|
||||||
|
val startFrom = this.time
|
||||||
|
val endAt = getEndAt()
|
||||||
|
|
||||||
|
return targetTime >= startFrom && targetTime < endAt
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user