라이브 - 시작, 취소, 입장, 수정, 예약 API 추가
This commit is contained in:
@@ -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
|
||||
)
|
@@ -30,6 +30,8 @@ data class UseCanCalculate(
|
||||
value?.useCanCalculates?.add(this)
|
||||
field = value
|
||||
}
|
||||
|
||||
var recipientCreatorId: Long? = null
|
||||
}
|
||||
|
||||
enum class UseCanCalculateStatus {
|
||||
|
@@ -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>
|
||||
}
|
@@ -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>
|
Reference in New Issue
Block a user