generated from pricelees/issue-pr-template
[#44] 매장 기능 도입 #45
@ -45,12 +45,29 @@ class ScheduleEntity(
|
|||||||
) {
|
) {
|
||||||
time?.let { this.time = it }
|
time?.let { this.time = it }
|
||||||
status?.let { this.status = it }
|
status?.let { this.status = it }
|
||||||
MdcPrincipalId.extractAsLongOrNull()?.also { this.updatedBy = it }
|
updateLastModifiedBy()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hold() {
|
fun hold() {
|
||||||
this.status = ScheduleStatus.HOLD
|
this.status = ScheduleStatus.HOLD
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun updateLastModifiedBy() {
|
||||||
|
MdcPrincipalId.extractAsLongOrNull()?.also { this.updatedBy = it }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
object ScheduleEntityFactory {
|
||||||
|
fun create(id: Long, date: LocalDate, time: LocalTime, storeId: Long, themeId: Long): ScheduleEntity {
|
||||||
|
return ScheduleEntity(
|
||||||
|
id = id,
|
||||||
|
date = date,
|
||||||
|
time = time,
|
||||||
|
storeId = storeId,
|
||||||
|
themeId = themeId,
|
||||||
|
status = ScheduleStatus.AVAILABLE
|
||||||
|
).apply { this.updateLastModifiedBy() }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class ScheduleStatus {
|
enum class ScheduleStatus {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user