라이브 - 시작, 취소, 입장, 수정, 예약 API 추가

This commit is contained in:
2023-07-31 17:09:45 +09:00
parent 197cca1f1b
commit f393c7630e
29 changed files with 1044 additions and 19 deletions

View File

@@ -0,0 +1,18 @@
package kr.co.vividnext.sodalive.can.use
import kr.co.vividnext.sodalive.can.payment.PaymentGateway
data class TotalSpentCan(
val spentCans: MutableList<SpentCan> = mutableListOf(),
val total: Int
) {
fun verify(): Boolean {
val sumSpentCans = spentCans.fold(0) { sum, spentCan -> sum + spentCan.can }
return total == sumSpentCans
}
}
data class SpentCan(
val paymentGateway: PaymentGateway,
val can: Int
)

View File

@@ -30,6 +30,8 @@ data class UseCanCalculate(
value?.useCanCalculates?.add(this)
field = value
}
var recipientCreatorId: Long? = null
}
enum class UseCanCalculateStatus {

View File

@@ -0,0 +1,12 @@
package kr.co.vividnext.sodalive.can.use
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.stereotype.Repository
@Repository
interface UseCanCalculateRepository : JpaRepository<UseCanCalculate, Long> {
fun findByUseCanIdAndStatus(
useCanId: Long,
status: UseCanCalculateStatus = UseCanCalculateStatus.RECEIVED
): List<UseCanCalculate>
}

View File

@@ -0,0 +1,7 @@
package kr.co.vividnext.sodalive.can.use
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.stereotype.Repository
@Repository
interface UseCanRepository : JpaRepository<UseCan, Long>