fix: 유저 행동 데이터 기록시 포인트 지급과 로그 기록 순서 변경

- 기존: 포인트 지급 후 로그 기록
- 변경: 로그 기록 후 포인트 지급
This commit is contained in:
Klaus 2025-05-16 17:57:37 +09:00
parent affc0cc235
commit eb8c8c14e8
1 changed files with 9 additions and 9 deletions

View File

@ -54,15 +54,6 @@ class UserActionService(
) )
if (grantedCount >= policy.availableCount) return@launch if (grantedCount >= policy.availableCount) return@launch
memberPointRepository.save(
MemberPoint(
memberId = memberId,
point = policy.pointAmount,
actionType = actionType,
expiresAt = now.plusDays(3)
)
)
grantLogRepository.save( grantLogRepository.save(
PointGrantLog( PointGrantLog(
memberId = memberId, memberId = memberId,
@ -73,6 +64,15 @@ class UserActionService(
) )
) )
memberPointRepository.save(
MemberPoint(
memberId = memberId,
point = policy.pointAmount,
actionType = actionType,
expiresAt = now.plusDays(3)
)
)
if (pushToken != null) { if (pushToken != null) {
fcmService.sendPointGranted(pushToken, policy.pointAmount) fcmService.sendPointGranted(pushToken, policy.pointAmount)
} }