유료라이브 - 10캔 이상 부터 설정 가능하도록 수정

This commit is contained in:
Klaus 2023-09-19 12:21:29 +09:00
parent d5cc28e50b
commit ff10a9935b
1 changed files with 11 additions and 3 deletions

View File

@ -190,13 +190,21 @@ class LiveRoomService(
throw SodaException("방 입장 비밀번호 6자리를 입력해 주세요.")
}
if (request.price in 1..9) {
throw SodaException("유료라이브는 10캔부터 설정 가능 합니다.")
}
val room = LiveRoom(
title = request.title,
notice = request.content,
beginDateTime = beginDateTime,
numberOfPeople = request.numberOfPeople,
isAdult = request.isAdult,
price = request.price,
price = if (request.price < 0) {
0
} else {
request.price
},
type = request.type,
password = request.password
)
@ -456,9 +464,9 @@ class LiveRoomService(
charge.useCan = useCan
when (it.paymentGateway) {
PaymentGateway.PG -> booker.pgRewardCan += charge.rewardCan
PaymentGateway.GOOGLE_IAP -> booker.googleRewardCan += charge.rewardCan
PaymentGateway.APPLE_IAP -> booker.appleRewardCan += charge.rewardCan
else -> booker.pgRewardCan += charge.rewardCan
}
charge.member = booker
@ -922,9 +930,9 @@ class LiveRoomService(
charge.useCan = useCan
when (it.paymentGateway) {
PaymentGateway.PG -> donator.pgRewardCan += charge.rewardCan
PaymentGateway.GOOGLE_IAP -> donator.googleRewardCan += charge.rewardCan
PaymentGateway.APPLE_IAP -> donator.appleRewardCan += charge.rewardCan
else -> donator.pgRewardCan += charge.rewardCan
}
charge.member = donator