diff --git a/src/main/kotlin/kr/co/vividnext/sodalive/content/order/OrderService.kt b/src/main/kotlin/kr/co/vividnext/sodalive/content/order/OrderService.kt index e16f567..2e42cdc 100644 --- a/src/main/kotlin/kr/co/vividnext/sodalive/content/order/OrderService.kt +++ b/src/main/kotlin/kr/co/vividnext/sodalive/content/order/OrderService.kt @@ -27,10 +27,15 @@ class OrderService( ) { @Transactional fun order(contentId: Long, orderType: OrderType, container: String, member: Member) { - val order = Order(type = orderType) val content = audioContentRepository.findByIdAndActive(contentId) ?: throw SodaException("잘못된 콘텐츠 입니다\n다시 시도해 주세요.") + val order = if (content.isOnlyRental) { + Order(type = OrderType.RENTAL) + } else { + Order(type = orderType) + } + if (member.id!! == content.member!!.id!!) throw SodaException("자신이 올린 콘텐츠는 구매할 수 없습니다.") if (repository.isExistOrdered(memberId = member.id!!, contentId = contentId)) { throw SodaException("이미 구매한 콘텐츠 입니다.")