Conversation
- 유효한 정보로 회원 생성 성공 테스트 - 각 필드 null/blank 검증 테스트 - loginId, password, name, birthDate, email 필수값 검증
- 필수 필드 5개 (loginId, encryptedPassword, name, birthDate, email) - 생성자에서 각 필드 null/blank 검증 - BaseEntity 상속으로 id, 생성/수정 시간 자동 관리 - 비밀번호 암호화는 추후 구현 예정
Test코드 구현
- Coupon 도메인 신규 구현 (CouponTemplate, IssuedCoupon, 정액/정률 할인) - 쿠폰 사용자 API (발급, 내 쿠폰 조회) 및 Admin CRUD API 구현 - 주문 흐름에 쿠폰 할인 통합 (originalAmount, discountAmount, totalAmount 스냅샷) - Product 재고 차감에 비관적 락(PESSIMISTIC_WRITE) 적용 - IssuedCoupon 사용 처리에 비관적 락 적용으로 동시 사용 방지 - 데드락 방지를 위해 상품 락 획득 시 productId 오름차순 정렬 - 동시성 통합 테스트 (재고 동시 차감, 쿠폰 동시 사용, 좋아요 동시 요청) - 쿠폰 도메인 단위 테스트 및 주문-쿠폰 통합 서비스 테스트 - ErrorType 확장 (쿠폰 관련 에러 타입 추가) - analyze-query SKILL.md 개선 (Lock/동시성 분석 섹션 추가) - .cursor/rules/domain-coupon.mdc 규칙 추가 Made-with: Cursor
- OrderService: 트랜잭션 범위 설계 근거, 락 획득 순서, dirty checking 활용 주석 보강 - OrderDomainService: 비관적 락 선택 이유, 데드락 시나리오 및 정렬 전략 주석 추가 - ProductJpaRepository: 낙관적/비관적 락 trade-off 비교 주석 추가 - IssuedCouponJpaRepository: Lost Update 시나리오, 비관적 락 방지 흐름 주석 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment Tip CodeRabbit can approve the review once all CodeRabbit's comments are resolved.Enable the |
- @Index(brand_id): 브랜드 필터링 조회 성능 개선 - @Index(likes_count DESC): 좋아요 순 정렬 인덱스 추가 - likesCount 필드 비정규화: Like 테이블 COUNT+GROUP BY 집계 연산 제거 - AS-IS: 매 요청마다 Like 테이블 JOIN + 집계 → 대용량 시 Full Scan - TO-BE: 비정규화 컬럼 기반 정렬 → 인덱스 활용, 집계 연산 없음 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- LikeService.like(): 좋아요 등록 시 product.increaseLikeCount() 동기화 - LikeService.unlike(): 좋아요 취소 시 product.decreaseLikeCount() 동기화 - dirty checking으로 별도 save() 없이 자동 UPDATE - ProductFacade: LikeRepository 의존성 제거, product.getLikesCount() 직접 사용 - N+1 방지: brandId 일괄 조회 후 Map으로 매핑 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…signup [VOLUME-1] 회원가입, 내 정보조회, 비밀번호 수정 구현
[VOLUME-3] 도메인 & 객체 설계 및 아키텍처, 패키지 구성
[Volume 4] 쿠폰 추가, 동시성 제어 적용
- CacheConfig: RedisCacheManager 설정, Negative Cache 방지 (disableCachingNullValues) - product:detail TTL 10분, product:list TTL 5분 - ProductFacade: @Cacheable 적용 (상품 상세/목록) - LikeService: @CacheEvict 적용 (좋아요 등록/취소 시 캐시 무효화) - SOT = DB, 캐시는 성능 레이어. 일시적 불일치 허용. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ApiResponse.success() 제네릭 타입 수정 - LikeServiceTest Nested class 이름 충돌 수정 (Like -> LikeTest) - OrderServiceTest Nested import 누락 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
Context & Decision