generated from pricelees/issue-pr-template
<!-- 제목 양식 --> <!-- [이슈번호] 작업 요약 (예시: [#10] Gitea 템플릿 생성) --> ## 📝 관련 이슈 및 PR **PR과 관련된 이슈 번호** - #41 ## ✨ 작업 내용 <!-- 어떤 작업을 했는지 알려주세요! --> - 예약 스키마 & API 재정의 - 새로운 기능에 맞춘 프론트엔드 페이지 추가 - Controller 이후 응답(성공, 실패) 로그에 Endpoint 추가 - 전환으로 인해 미사용되는 코드 및 테스트 전체 제거 ## 🧪 테스트 <!-- 어떤 테스트를 생각했고 진행했는지 알려주세요! --> <img width="528" alt="테스트 커버리지" src="attachments/a4899c0a-2919-4993-bd3b-a71bc601137d"> - 예약 & 결제 통합 테스트 작성 완료 - 결제 테스트는 통합 테스트에서는 Client를 mocking하는 방식 + 별도의 Client 슬라이스 테스트로 진행 ## 📚 참고 자료 및 기타 <!-- 참고한 자료, 또는 논의할 사항이 있다면 알려주세요! --> Reviewed-on: #42 Co-authored-by: pricelees <priceelees@gmail.com> Co-committed-by: pricelees <priceelees@gmail.com>
63 lines
1.7 KiB
Kotlin
63 lines
1.7 KiB
Kotlin
package roomescape.theme.infrastructure.persistence
|
|
|
|
import jakarta.persistence.*
|
|
import roomescape.common.entity.AuditingBaseEntity
|
|
|
|
@Entity
|
|
@Table(name = "theme")
|
|
class ThemeEntity(
|
|
id: Long,
|
|
|
|
var name: String,
|
|
var description: String,
|
|
var thumbnailUrl: String,
|
|
|
|
@Enumerated(value = EnumType.STRING)
|
|
var difficulty: Difficulty,
|
|
|
|
var price: Int,
|
|
var minParticipants: Short,
|
|
var maxParticipants: Short,
|
|
var availableMinutes: Short,
|
|
var expectedMinutesFrom: Short,
|
|
var expectedMinutesTo: Short,
|
|
|
|
@Column(columnDefinition = "TINYINT", length = 1)
|
|
var isOpen: Boolean
|
|
) : AuditingBaseEntity(id) {
|
|
|
|
fun modifyIfNotNull(
|
|
name: String?,
|
|
description: String?,
|
|
thumbnailUrl: String?,
|
|
difficulty: Difficulty?,
|
|
price: Int?,
|
|
minParticipants: Short?,
|
|
maxParticipants: Short?,
|
|
availableMinutes: Short?,
|
|
expectedMinutesFrom: Short?,
|
|
expectedMinutesTo: Short?,
|
|
isOpen: Boolean?
|
|
) {
|
|
name?.let { this.name = it }
|
|
description?.let { this.description = it }
|
|
thumbnailUrl?.let { this.thumbnailUrl = it }
|
|
difficulty?.let { this.difficulty = it }
|
|
price?.let { this.price = it }
|
|
minParticipants?.let { this.minParticipants = it }
|
|
maxParticipants?.let { this.maxParticipants = it }
|
|
availableMinutes?.let { this.availableMinutes = it }
|
|
expectedMinutesFrom?.let { this.expectedMinutesFrom = it }
|
|
expectedMinutesTo?.let { this.expectedMinutesTo = it }
|
|
isOpen?.let { this.isOpen = it }
|
|
}
|
|
}
|
|
|
|
enum class Difficulty {
|
|
VERY_EASY,
|
|
EASY,
|
|
NORMAL,
|
|
HARD,
|
|
VERY_HARD
|
|
}
|