test #316
|
@ -102,42 +102,38 @@ class UserActionService(
|
|||
)
|
||||
if (grantedCount >= policy.availableCount) return@execute
|
||||
|
||||
grantLogRepository.save(
|
||||
PointGrantLog(
|
||||
memberId = memberId,
|
||||
point = if (actionType == ActionType.ORDER_CONTENT_COMMENT && order != null) {
|
||||
order.can
|
||||
} else {
|
||||
policy.pointAmount
|
||||
},
|
||||
actionType = actionType,
|
||||
policyId = policy.id!!,
|
||||
orderId = order?.id
|
||||
)
|
||||
)
|
||||
val point = if (actionType == ActionType.ORDER_CONTENT_COMMENT && order != null) {
|
||||
order.can
|
||||
} else {
|
||||
policy.pointAmount
|
||||
}
|
||||
|
||||
memberPointRepository.save(
|
||||
MemberPoint(
|
||||
memberId = memberId,
|
||||
point = if (actionType == ActionType.ORDER_CONTENT_COMMENT && order != null) {
|
||||
order.can
|
||||
} else {
|
||||
policy.pointAmount
|
||||
},
|
||||
actionType = actionType,
|
||||
expiresAt = now.plusDays(3)
|
||||
if (point > 0) {
|
||||
grantLogRepository.save(
|
||||
PointGrantLog(
|
||||
memberId = memberId,
|
||||
point = point,
|
||||
actionType = actionType,
|
||||
policyId = policy.id!!,
|
||||
orderId = order?.id
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if (pushTokenList.isNotEmpty()) {
|
||||
fcmService.sendPointGranted(
|
||||
pushTokenList,
|
||||
if (actionType == ActionType.ORDER_CONTENT_COMMENT && order != null) {
|
||||
order.can
|
||||
} else {
|
||||
policy.pointAmount
|
||||
}
|
||||
memberPointRepository.save(
|
||||
MemberPoint(
|
||||
memberId = memberId,
|
||||
point = point,
|
||||
actionType = actionType,
|
||||
expiresAt = now.plusDays(3)
|
||||
)
|
||||
)
|
||||
|
||||
if (pushTokenList.isNotEmpty()) {
|
||||
fcmService.sendPointGranted(
|
||||
pushTokenList,
|
||||
point
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue