feat: 주문 성공, 취소 시 email 보내는 기능#27
Merged
Merged
Conversation
f-lab-key
suggested changes
Oct 1, 2025
f-lab-key
left a comment
There was a problem hiding this comment.
수고하셨습니다! 이메일 보내는 부분 잘 작성해주셨네요 ㅎㅎ
별개로 '출석 포인트 미지급 현상'과 같은 부분은 버그를 수정했으면 테스트 코드로도 확실하게 테스트해보면 좋을 것 같아요. Integration test로 사용자가 출석했을 때 사용자에게 포인트가 지급되었는지 최소한의 모킹만 하면서 확인해보는건 어떨까요?
Comment on lines
+17
to
+23
| emailService.sendPurchaseSuccessMail( | ||
| event.userEmail(), | ||
| event.quantity(), | ||
| event.totalPrice(), | ||
| event.productName(), | ||
| event.codeList() | ||
| ); |
There was a problem hiding this comment.
이벤트를 그대로 넘기는 것과 파라미터를 펼쳐서 넘기는 것의 장단점이 뭘까요?
Collaborator
Author
There was a problem hiding this comment.
장점은 :
- email Service는 이벤트 객체에 의존하지 않고 필요한 값만 받기 때문에 결합도가 낮아집니다
- 메서드 시그니처만 봐도 이 메서드가 어떤 값에 의존하는지 한번에 파악 할수 있습니다
단점
- 필드가 하나만 추가되어도 메서드 시그니처와 호출하는 곳에서 모두 수정해야 합니다
- 파라미터가 많아질수록 가독성이 떨어집니다
|
|
||
| @Component | ||
| @RequiredArgsConstructor | ||
| public class PurchaseEmailHandler { |
There was a problem hiding this comment.
제 생각에 Handler는 다소 포괄적인 용어라 이 클래스가 어떤 역할을 하는지 확 알기가 어려운 면이 있는 것 같아요. XXXListener, XXXNotifier 등으로 이벤트를 듣고 있다는 것을 알려주면 어떨까요?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
PR 유형
어떤 변경 사항이 있나요?