Skip to content

[HCR-406] 웰컴쿠폰 지급 및 쿠폰 패키지 분리#263

Merged
rettooo merged 8 commits into
devfrom
feat/HSC-406
Mar 23, 2026
Merged

[HCR-406] 웰컴쿠폰 지급 및 쿠폰 패키지 분리#263
rettooo merged 8 commits into
devfrom
feat/HSC-406

Conversation

@bon0512
Copy link
Copy Markdown
Contributor

@bon0512 bon0512 commented Mar 22, 2026

📝작업 내용

웰컴 쿠폰 지금 및 쿠폰 패키지 분리


👀변경 사항

구분 변경 내용 상태
회원가입 쿠폰 발급 FORM 회원가입 성공 후 웰컴 쿠폰 발급 호출 추가 완료
소셜 온보딩 쿠폰 발급 completeOnboarding() 성공 후 웰컴 쿠폰 발급 호출 추가 완료
공통 발급 서비스 CouponGrantService 추가, 쿠폰 조회/만료일 계산/member_coupon 저장 분리 완료
회원가입 정책 서비스 SignupCouponService 추가, 웰컴 쿠폰(coupon_id = 3) 중복 발급 방지 처리 완료
발급 이력 조회 MemberCouponGrantRepository에 existsByMember_IdAndCoupon_Id(...) 추가 완료
패키지 구조 정리 공통 쿠폰 레포지토리를 customer에서 coupon 패키지로 이동 완료
이탈 쿠폰 연동 ChurnCouponIssueProcessor가 공통 CouponGrantService를 사용하도록 변경 완료
테스트 보강 AuthUseCaseTest에 회원가입/온보딩 후 웰컴 쿠폰 호출 검증 추가 완료
공통 발급 테스트 CouponGrantServiceTest로 만료일 계산/저장 검증 완료
DB 확인 회원 101040에 coupon_id = 3 발급 확인 완료

## 테스트 결과
image image

🎫 Jira Ticket

  • Jira Ticket: HCR-406

#️⃣관련 이슈


@github-actions github-actions Bot added Customer Team ✨ feat 새로운 기능 추가, 기존 기능을 요구 사항에 맞추어 수정 🔥 priority: P0 즉시 처리 필요(서비스/데모 블로커) 🗂️ area: BE 백엔드 영역 labels Mar 22, 2026
@github-actions github-actions Bot changed the title 웰컴쿠폰 지급 및 쿠폰 패키지 분리 [HCR-406] 웰컴쿠폰 지급 및 쿠폰 패키지 분리 Mar 22, 2026
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

이 PR은 웰컴 쿠폰 지급 기능을 구현하고 쿠폰 관련 로직의 모듈화를 개선합니다. 기존에 분산되어 있던 쿠폰 발급 로직을 CouponGrantService로 통합하여 재사용성을 높이고, 회원가입 시 웰컴 쿠폰이 자동으로 지급되도록 AuthUseCase를 업데이트했습니다. 또한, 웰컴 쿠폰의 중복 발급을 방지하는 SignupCouponService를 도입하여 쿠폰 정책 관리를 강화했습니다. 이러한 변경을 통해 쿠폰 시스템의 유지보수성과 확장성이 향상되었습니다.

Highlights

  • 웰컴 쿠폰 지급 기능 추가: 회원가입 및 온보딩 완료 시 자동으로 웰컴 쿠폰이 지급되도록 로직이 추가되었습니다.
  • 쿠폰 패키지 분리 및 공통 서비스 도입: 쿠폰 관련 로직을 coupon 패키지로 분리하고, 쿠폰 조회, 만료일 계산, member_coupon 저장을 담당하는 CouponGrantService를 도입하여 공통 발급 로직을 중앙화했습니다.
  • 회원가입 쿠폰 정책 서비스 추가: 웰컴 쿠폰의 중복 발급을 방지하고 회원가입 쿠폰 정책을 관리하는 SignupCouponService가 새로 추가되었습니다.
  • 기존 쿠폰 발급 로직 통합: ChurnCouponIssueProcessor가 기존의 개별 발급 로직 대신 새로 도입된 CouponGrantService를 사용하도록 변경되었습니다.
  • 쿠폰 발급 이력 조회 기능 강화: MemberCouponGrantRepository에 특정 회원에게 특정 쿠폰이 이미 발급되었는지 확인하는 existsByMember_IdAndCoupon_Id 메서드가 추가되었습니다.
  • 테스트 코드 보강: AuthUseCaseTest에 회원가입/온보딩 후 웰컴 쿠폰 호출 검증 로직이 추가되었으며, CouponGrantService의 발급 및 만료일 계산 로직을 검증하는 CouponGrantServiceTest가 신규 추가되었습니다.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 22, 2026

🧪 Test Coverage Report (JaCoCo)

overall__line overall__branch changed__line changed__branch

기준(soft, workflow는 실패 안 함): Overall line 70% / branch 50%, Changed line 80% / branch 60% · Generated: 2026-03-22 15:30 UTC

Scope Line Branch Line Graph Branch Graph Verdict
Overall 43.2% 30.8% █████████░░░░░░░░░░░ ██████░░░░░░░░░░░░░░ ⚠️⚠️
Changed 83.8% 57.7% █████████████████░░░ ████████████░░░░░░░░ ⚠️

Package line spark (sample): ▃▂▁▂▂▄▄·▇█▆▆▆·▆▁▁▆█▇▄▁▁▁██▁▁▃·
Package branch spark (sample): ▃▁·▁▁·▁·▇·▅▆▅·▅▁▁▅▇▇▃▁·▁·█▁▁▁·

📦 Package coverage (worst 10)

Rank Package Line Branch Lines Line Graph Branch Graph
1 site.holliverse.customer.application.usecase.log 0.0% 0.0% 63 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
2 site.holliverse.customer.coupon.application 0.0% 0.0% 61 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
3 site.holliverse.infra.kafka.consumer 0.0% 0.0% 51 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
4 site.holliverse.customer.integration.external 0.0% 0.0% 22 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
5 site.holliverse.customer.integration.fastapi 0.0% 0.0% 19 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
6 site.holliverse.customer.application.usecase.counsel 0.0% 0.0% 14 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
7 site.holliverse.customer.coupon.web 0.0% 0.0% 12 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
8 site.holliverse.shared.config.runtime 0.0% N/A 11 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
9 site.holliverse.customer.web.util 0.0% 0.0% 8 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
10 site.holliverse.admin.domain.model.churn.feature 0.0% N/A 8 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░

🧨 Lowest coverage classes (worst 10)

Rank Class Line Branch Lines Line Graph Branch Graph
1 site.holliverse.infra.kafka.consumer.RecommendationKafkaConsumer 0.0% 0.0% 51 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
2 site.holliverse.customer.application.usecase.log.UserLogService 0.0% 0.0% 46 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
3 site.holliverse.admin.application.usecase.CalculateLogChurnScoreService 0.0% 0.0% 38 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
4 site.holliverse.admin.application.usecase.CalculateChurnScoreService 0.0% 0.0% 37 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
5 site.holliverse.customer.coupon.application.UseMemberCouponUseCase 0.0% 0.0% 34 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
6 site.holliverse.admin.application.usecase.ChurnRiskReason$ReasonCode 0.0% 0.0% 31 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
7 site.holliverse.customer.coupon.application.GetMemberCouponsUseCase 0.0% 0.0% 27 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
8 site.holliverse.admin.application.usecase.MemberDissatisfactionFeatureSnapshotService 0.0% 0.0% 27 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
9 site.holliverse.admin.web.controller.InternalAnalysisWebhookController 0.0% 0.0% 27 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
10 site.holliverse.admin.application.usecase.RetrieveChurnRealtimeUseCase 0.0% 0.0% 24 ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
🧩 Changed files coverage breakdown (6 files)
File Line Branch Lines Verdict Line Graph Branch Graph
src/main/java/site/holliverse/admin/application/usecase/ChurnCouponIssueProcessor.java 0.0% 0.0% 11 ⚠️⚠️ ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
src/main/java/site/holliverse/coupon/application/SignupCouponService.java 14.3% 0.0% 7 ⚠️⚠️ ███░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
src/main/java/site/holliverse/coupon/application/CouponGrantService.java 94.1% 75.0% 17 ✅✅ ███████████████████░ ███████████████░░░░░
src/main/java/site/holliverse/auth/application/usecase/AuthUseCase.java 98.8% 85.7% 82 ✅✅ ████████████████████ █████████████████░░░
src/main/java/site/holliverse/coupon/repository/CouponRepository.java N/A N/A 0 ✅✅ ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░
src/main/java/site/holliverse/coupon/repository/MemberCouponGrantRepository.java N/A N/A 0 ✅✅ ░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░

🔎 HTML 리포트: Actions → Artifacts → jacoco-html · XML: jacoco-xml

Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Code Review

웰컴 쿠폰 지급 기능 추가와 쿠폰 발급 로직을 공통 모듈로 분리하는 리팩토링이 진행되었습니다. 쿠폰 발급 책임을 중앙 집중화하여 코드 중복을 줄이고 유지보수성을 향상시킨 점은 매우 긍정적입니다. 하지만, 새로 생성된 coupon 공통 모듈이 customer 모듈의 퍼시스턴스 엔티티에 직접 의존하는 심각한 아키텍처 규칙 위반이 발견되었습니다. 또한, 웰컴 쿠폰 발급 로직에 Race Condition을 유발할 수 있는 잠재적 위험이 존재하여 반드시 수정이 필요합니다.

Copy link
Copy Markdown
Contributor

@YeongHyeonHeo YeongHyeonHeo left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~

@rettooo rettooo merged commit 1476271 into dev Mar 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗂️ area: BE 백엔드 영역 Customer Team ✨ feat 새로운 기능 추가, 기존 기능을 요구 사항에 맞추어 수정 🔥 priority: P0 즉시 처리 필요(서비스/데모 블로커)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[HSC-406] 회원가입시 쿠폰 제공 기능 추가

3 participants