From 9c279e1ec24a7da28fd117c564b360964d802d7e Mon Sep 17 00:00:00 2001 From: pricelees Date: Wed, 17 Sep 2025 10:33:11 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9D=BC=EC=A0=95=EA=B3=BC=20=ED=85=8C?= =?UTF-8?q?=EB=A7=88=20=EC=A0=95=EB=B3=B4=EB=A5=BC=20=EB=8B=B4=EA=B3=A0=20?= =?UTF-8?q?=EC=9E=88=EB=8A=94=20=EB=8F=84=EB=A9=94=EC=9D=B8=20=EA=B0=9D?= =?UTF-8?q?=EC=B2=B4=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/ScheduleWithThemeSummary.kt | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/main/kotlin/roomescape/schedule/business/domain/ScheduleWithThemeSummary.kt diff --git a/src/main/kotlin/roomescape/schedule/business/domain/ScheduleWithThemeSummary.kt b/src/main/kotlin/roomescape/schedule/business/domain/ScheduleWithThemeSummary.kt new file mode 100644 index 00000000..5259b1e8 --- /dev/null +++ b/src/main/kotlin/roomescape/schedule/business/domain/ScheduleWithThemeSummary.kt @@ -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 + } +}