From 7cfea5a3a0f97faa03b7b144699595ee49754065 Mon Sep 17 00:00:00 2001 From: devxb Date: Sun, 20 Oct 2024 13:10:43 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=BF=A0=ED=8F=B0=20=ED=8E=AB=20?= =?UTF-8?q?=EC=A7=80=EA=B8=89=20=EB=A1=9C=EC=A7=81=EC=9D=84=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/org/gitanimals/render/domain/UserService.kt | 4 ++-- .../org/gitanimals/render/saga/UsedCouponSagaHandlers.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/org/gitanimals/render/domain/UserService.kt b/src/main/kotlin/org/gitanimals/render/domain/UserService.kt index 444f3a97..1da91149 100644 --- a/src/main/kotlin/org/gitanimals/render/domain/UserService.kt +++ b/src/main/kotlin/org/gitanimals/render/domain/UserService.kt @@ -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) diff --git a/src/main/kotlin/org/gitanimals/render/saga/UsedCouponSagaHandlers.kt b/src/main/kotlin/org/gitanimals/render/saga/UsedCouponSagaHandlers.kt index c62027e7..4b240850 100644 --- a/src/main/kotlin/org/gitanimals/render/saga/UsedCouponSagaHandlers.kt +++ b/src/main/kotlin/org/gitanimals/render/saga/UsedCouponSagaHandlers.kt @@ -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 {