-
Notifications
You must be signed in to change notification settings - Fork 2
feat : 쿠폰조회, 상세조회, 수정, 삭제 관리자 기능 구현 #89
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
Conversation
taeho4523
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다! 병합되면 풀 받아서 공통적인부분 리팩토링 추가해보겠습니당
| @RequestParam(defaultValue = "1") @Min(value = 1, message = "페이지는 1 이상이어야 합니다.") | ||
| @Max(value = 1000, message = "페이지는 1000 이하여야 합니다.") int page, | ||
| @RequestParam(defaultValue = "5") @Min(value = 1, message = "limit는 1 이상이어야 합니다.") | ||
| @Max(value = 100, message = "limit는 100 이하여야 합니다.") int limit, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분 공통사용되는 부분이 많아서 제가 global dto로 빼서 리팩토링하겠습니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵!!!
|
|
||
| @NotNull(message = "쿠폰 상태는 필수입니다") | ||
| CouponStatus status, | ||
| CouponStatus status, //TODO : 일단은 내가 상태설정하게 두고, 리팩토링때 스케줄러로 처리하도록 변경 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스케줄러는 어떤 로직을 처리하기 위해 도입되는건가용 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inactive상태일때, 쿠폰시작시간이 되면 자동으로 active상태로 변환시켜주기위해서 사용할 것 같습니다.
| String status, | ||
| Integer quantity, | ||
| String couponCategory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enum으로 반환안되나욥??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반환했습니당~
| String status, | ||
| Integer quantity, | ||
| String category, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위에 코멘트와 마찬가지로 안되는지 확인 부탁드립니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반환했습니당~
| String status, | ||
| Integer quantity, | ||
| String category, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인 부탁드려요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반환했습니당~
| userService.validateAdminRole(userId); | ||
|
|
||
| // 쿠폰 조회 | ||
| Coupon coupon = couponRepository.findById(couponId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이것도 공통메서드로 분리될 여지가 있는 것 같네용
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 그렇네용😅 노션에도 정리해서 수정해두었습니다~
Ji-minhyeok
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
태호님이 잘 짚어주신 것 같습니다! 고생많으셨어요👍🏻
| } | ||
| } | ||
|
|
||
| private void validateCouponUpdate(Coupon coupon, CouponUpdateRequestDto request, Long issuedCount) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고려할 사항이 많았을텐데 고생 많으셨습니다!
🛠️ 작업 내용
쿠폰조회, 상세조회, 수정, 삭제 관리자 기능 구현
수정시에 검증 조건
이렇게 해두었고, 결제가 붙어도 결제에 영향을 미치는거는 없어서 결제가 붙더라도 상관없을 것 같다. (단, 결제 취소시에 사용수 롤백되는거는 한번 고민을 해봐야 할 것 같음)
문제는 삭제인데 일단은 지금은 어떤경우에도 삭제가 되게 만들어 놨고, 결제가 붙은뒤에 삭제 조건에 따른 검증이 추가 될 것 같습니다.
쿠폰 조회랑 상세조회는 원래 api명세서에서는 없었는데 구현을 하다보니까 필요할 것 같아서 구현 완료 하고 + 명세서에 추가도 완료했습니다!
✅ PR 유형
✅ Check List
🔗 관련 이슈
💬 기타 참고 사항