Skip to content

Commit

Permalink
feat: 쿠폰 펫 지급 로직을 수정한다
Browse files Browse the repository at this point in the history
  • Loading branch information
devxb committed Oct 20, 2024
1 parent 64b2020 commit 7cfea5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/kotlin/org/gitanimals/render/domain/UserService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class UserService(

@Retryable(retryFor = [ObjectOptimisticLockingFailureException::class], maxAttempts = 100)
@Transactional
fun givePersonaByCoupon(name: String, persona: String) {
requireIdempotency("$name:bonus")
fun givePersonaByCoupon(name: String, persona: String, code: String) {
requireIdempotency("$name:$code")

val user = getUserByName(name)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class UsedCouponSagaHandlers(
}
sagaCommitEvent.setNextEvent(couponUsed)

userService.givePersonaByCoupon(couponUsed.username, couponUsed.dynamic)
userService.givePersonaByCoupon(couponUsed.username, couponUsed.dynamic, couponUsed.code)
}

private companion object {
Expand Down

0 comments on commit 7cfea5a

Please sign in to comment.