generated from pricelees/issue-pr-template
[#44] 매장 기능 도입 #45
@ -10,10 +10,13 @@ import roomescape.payment.infrastructure.common.*
|
||||
import roomescape.payment.web.PaymentCancelRequest
|
||||
import roomescape.payment.web.PaymentConfirmRequest
|
||||
import roomescape.reservation.web.PendingReservationCreateRequest
|
||||
import roomescape.schedule.infrastructure.persistence.ScheduleEntity
|
||||
import roomescape.schedule.infrastructure.persistence.ScheduleEntityFactory
|
||||
import roomescape.schedule.web.ScheduleCreateRequest
|
||||
import roomescape.store.infrastructure.persistence.StoreEntity
|
||||
import roomescape.store.infrastructure.persistence.StoreStatus
|
||||
import roomescape.theme.infrastructure.persistence.Difficulty
|
||||
import roomescape.theme.infrastructure.persistence.ThemeEntity
|
||||
import roomescape.theme.web.ThemeCreateRequest
|
||||
import roomescape.user.infrastructure.persistence.UserEntity
|
||||
import roomescape.user.infrastructure.persistence.UserStatus
|
||||
@ -26,11 +29,10 @@ import java.time.OffsetDateTime
|
||||
const val INVALID_PK: Long = 9999L
|
||||
val tsidFactory = TsidFactory(0)
|
||||
|
||||
|
||||
object StoreFixture {
|
||||
fun create(
|
||||
id: Long = tsidFactory.next(),
|
||||
name: String = "테스트-${randomString()}점",
|
||||
name: String = "행복${randomPhoneNumber()}호점",
|
||||
address: String = "서울특별시 강북구 행복길 123",
|
||||
contact: String = randomPhoneNumber(),
|
||||
businessRegNum: String = randomBusinessRegNum(),
|
||||
@ -110,16 +112,20 @@ object AdminFixture {
|
||||
type: AdminType = AdminType.STORE,
|
||||
storeId: Long? = tsidFactory.next(),
|
||||
permissionLevel: AdminPermissionLevel = AdminPermissionLevel.FULL_ACCESS
|
||||
): AdminEntity = AdminEntity(
|
||||
id = id,
|
||||
account = account,
|
||||
password = password,
|
||||
name = name,
|
||||
phone = phone,
|
||||
type = type,
|
||||
storeId = storeId,
|
||||
permissionLevel = permissionLevel,
|
||||
)
|
||||
): AdminEntity {
|
||||
val storeId = if (type == AdminType.HQ) null else storeId
|
||||
|
||||
return AdminEntity(
|
||||
id = id,
|
||||
account = account,
|
||||
password = password,
|
||||
name = name,
|
||||
phone = phone,
|
||||
type = type,
|
||||
storeId = storeId,
|
||||
permissionLevel = permissionLevel,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
object UserFixture {
|
||||
@ -169,6 +175,34 @@ object ThemeFixture {
|
||||
expectedMinutesTo = 70,
|
||||
isActive = true
|
||||
)
|
||||
|
||||
fun create(
|
||||
id: Long = tsidFactory.next(),
|
||||
name: String = randomString(),
|
||||
description: String = randomString(),
|
||||
thumbnailUrl: String = "http://www.bing.com/search?q=fugit",
|
||||
difficulty: Difficulty = Difficulty.VERY_EASY,
|
||||
price: Int = 10_000,
|
||||
minParticipants: Short = 3,
|
||||
maxParticipants: Short = 5,
|
||||
availableMinutes: Short = 60,
|
||||
expectedMinutesFrom: Short = 40,
|
||||
expectedMinutesTo: Short = 50,
|
||||
isActive: Boolean = true
|
||||
) = ThemeEntity(
|
||||
id = id,
|
||||
name = name,
|
||||
description = description,
|
||||
thumbnailUrl = thumbnailUrl,
|
||||
difficulty = difficulty,
|
||||
price = price,
|
||||
minParticipants = minParticipants,
|
||||
maxParticipants = maxParticipants,
|
||||
availableMinutes = availableMinutes,
|
||||
expectedMinutesFrom = expectedMinutesFrom,
|
||||
expectedMinutesTo = expectedMinutesTo,
|
||||
isActive = isActive
|
||||
)
|
||||
}
|
||||
|
||||
object ScheduleFixture {
|
||||
@ -177,6 +211,20 @@ object ScheduleFixture {
|
||||
time = LocalTime.now(),
|
||||
themeId = tsidFactory.next()
|
||||
)
|
||||
|
||||
fun create(
|
||||
id: Long = tsidFactory.next(),
|
||||
date: LocalDate = LocalDate.now().plusDays(1),
|
||||
time: LocalTime = LocalTime.now(),
|
||||
storeId: Long = tsidFactory.next(),
|
||||
themeId: Long = tsidFactory.next()
|
||||
): ScheduleEntity = ScheduleEntityFactory.create(
|
||||
id = id,
|
||||
date = date,
|
||||
time = time,
|
||||
storeId = storeId,
|
||||
themeId = themeId
|
||||
)
|
||||
}
|
||||
|
||||
object PaymentFixture {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user