Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat : 쿠폰 적용 가능한 주문 생성 #194

Merged
merged 8 commits into from
Jan 25, 2023
Merged

Conversation

ImNM
Copy link
Member

@ImNM ImNM commented Jan 24, 2023

개요

작업사항

  • 주문 도메인에 쿠폰 엔티티를 빼고 orderCouponVo 로 변경했습니다.
  • 쿠폰 적용해서 계산이 가능합니다.
  • 쿠폰 적용시에 분산락 적용했습니다
  • 민준이쪽 티켓 로직과 같이
    주문 생성 이벤트 소싱후
    비동기가아닌 동기적 이벤트 수신으로 쿠폰 적용상태를 변경시킵니다.
    before_commit role 이므로 실패한다면
    주문 생성까지도 롤백됩니다.
    또한 쿠폰 적용도 실패된다면 주문 생성 또한 롤백됩니다.

추후 채린이가 withdraworderevent 주문 철회 이벤트에 쿠폰 복구 작업예정입니다ㅏ
@cofls6581 혹시 지금 createOrderEvent 처럼 필요한 필드
가령 couponId , isUseCoupon 등 필드 필요하면 withdraworderevent에 추가하셔유!

변경로직

  • 내용을 적어주세요.

@ImNM ImNM self-assigned this Jan 24, 2023
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 214 Code Smells

13.1% 13.1% Coverage
1.1% 1.1% Duplication

private final IssuedCouponAdaptor issuedCouponAdaptor;

@Transactional
public Order WithOutCoupon(Long cartId, Long userId) {
Copy link
Member

Choose a reason for hiding this comment

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

통일성있게 함수명 소문자로 시작하면 좋을 것 같아요!

Copy link
Member Author

Choose a reason for hiding this comment

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

오타네요 ㅎㅎ,, 내일 고칠게우~!~!

Copy link
Member

@cofls6581 cofls6581 left a comment

Choose a reason for hiding this comment

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

쿠폰 적용 주문 흐름 확인했습니다. 고생했음둥 👍
이어받아서 주문 철회 쿠폰 복구쪽 작업할게요!

Copy link
Member

@gengminy gengminy left a comment

Choose a reason for hiding this comment

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

고생하셨습니다 👍

private final String name;
private String name;
Copy link
Member

Choose a reason for hiding this comment

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

final 키워드 없앤 이유가 있을까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

그 요청받을때 final 되어있으면
못받더라고요.. 어느순간부터 그렇게 변경된것같음
기본생성자 없다고 요청 못받음!!

@ImNM ImNM merged commit 5ebf909 into dev Jan 25, 2023
@ImNM ImNM deleted the feature/115-order-with-coupon branch January 26, 2023 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🚀 [feature] 주문 완료 진행시 쿠폰 적용
3 participants