Skip to content

feat: battle reward/#688#689

Merged
Finefinee merged 3 commits into
developfrom
feat/battle-reward/#688
Apr 15, 2026
Merged

feat: battle reward/#688#689
Finefinee merged 3 commits into
developfrom
feat/battle-reward/#688

Conversation

@hjbin-25

Copy link
Copy Markdown
Member

변경사항

  • 배틀 종료 시 승패/무승부에 따라 쿠키 보상 지급
    • 3일 배틀: 승자 300 / 패자 150 / 무승부 225
    • 5일 배틀: 승자 500 / 패자 250 / 무승부 375
    • 7일 배틀: 승자 700 / 패자 350 / 무승부 525
  • 배틀/출석 쿠키 지급 시 UserGoodsHistory 기록 저장
  • GoodsActingCategoryBATTLE_WIN_REWARD, BATTLE_LOSE_REWARD, BATTLE_DRAW_REWARD, ATTENDANCE_DAILY_REWARD, ATTENDANCE_WEEKLY_REWARD 추가

관련 이슈

Closes #688

추가 컨텍스트

  • 배틀 보상은 스케줄러 배치(finishExpiredBattles)와 lazy 단건 처리(finishSingleIfExpired) 양쪽 모두에 적용됨
  • 출석 보상 기록은 기존 브랜치 범위를 약간 벗어나지만, 쿠키 지급 추적 일관성을 위해 함께 반영

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request implements a reward system for battle completion and attendance marking, including the addition of reward history tracking. Key changes include updating BattleFinishService to grant cookies based on battle duration and result, and modifying MarkAttendanceService to record attendance rewards. The review feedback identifies critical race conditions in the reward granting logic where user balances are updated without database locks, which could lead to lost updates in concurrent environments. Additionally, there is a suggestion to improve the readability and consistency of the draw reward calculation.

@hjbin-25 hjbin-25 self-assigned this Apr 15, 2026
@hjbin-25 hjbin-25 added the enhancement 새로운 기능 추가 label Apr 15, 2026
@Finefinee Finefinee merged commit b4b2f66 into develop Apr 15, 2026
1 check passed
@hjbin-25 hjbin-25 deleted the feat/battle-reward/#688 branch April 15, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement 새로운 기능 추가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants