generated from pricelees/issue-pr-template
feat: 일정과 테마 정보를 담고 있는 도메인 객체 생성
This commit is contained in:
parent
b82c975cd0
commit
9c279e1ec2
@ -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