Skip to content

feat(point): 포인트 적립, 결제 취소 시 적립금 취소 로직 구현, 결제 취소 5분 제한 로직 추가#64

Merged
dnjsals45 merged 10 commits intodevfrom
feat/point/aop
Oct 20, 2025
Merged

feat(point): 포인트 적립, 결제 취소 시 적립금 취소 로직 구현, 결제 취소 5분 제한 로직 추가#64
dnjsals45 merged 10 commits intodevfrom
feat/point/aop

Conversation

@bbangjae
Copy link
Collaborator

@bbangjae bbangjae commented Oct 17, 2025

feat(point): 포인트 적립, 결제 취소 시 적립금 취소 로직 구현

  • 결제 및 리뷰 작성 시 자동으로 포인트가 적립·차감되도록 AOP 기반 포인트 처리 로직을 추가

주요 동작

  • 결제 완료 → 포인트 적립
  • 결제 취소 → 포인트 차감
  • 리뷰 작성 → 포인트 적립

설계 의도 및 고민

초기에는 주문 생성 혹은 결제 서비스 내부에서 직접 포인트 적립 코드를 호출하는 방법을 고려했습니다.
하지만 향후 포인트 충전, 이벤트 참여 보상, 관리자 수동 적립 등 다양한 케이스가 생길 것을 예상했습니다.

이러한 확장성을 고려했을 때,
AOP를 통해 핵심 비즈니스 로직과 부가 기능(포인트 적립)을 분리하는 것이 더 적합하다고 판단했습니다.

선택 이유

  • 관심사 분리(Separation of Concerns) 실현
  • 서비스 계층의 복잡도 감소

Copy link
Collaborator

@dnjsals45 dnjsals45 left a comment

Choose a reason for hiding this comment

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

혹시 현재 기능에서 포인트 사용은 없고, 적립 및 취소 시 기존으로 복구 기능만 있는 것 같은데 맞을까요? 제가 조금 이해를 못한 것 같아서 여쭤봅니다!

@Param("deletedBy") Long deletedBy
);

@SuppressWarnings("NullableProblems")
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 경고 무시 어노테이션은 어떤 문제떄문에 작성해주신걸까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

order,user가 null 이 발생할 수 있다고 경고가 떠서 제외 시켰습니다!

결제 완료 된 경우는 order, user이 null 발생 할 수 없다고 생각하여 제외 시켰습니다.

@dnjsals45 dnjsals45 merged commit 3b2fd64 into dev Oct 20, 2025
1 check passed
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.

2 participants