Skip to content

Conversation

@iamjieunkim
Copy link
Collaborator

🛠️ 작업 내용

쿠폰조회, 상세조회, 수정, 삭제 관리자 기능 구현
수정시에 검증 조건

  • 선착순 쿠폰인데 수량 없으면 에러
  • 발급된 수량보다 적게 설정하면 에러
  • 이미 발급된 쿠폰 있으면 카테고리 변경 불가
  • 오픈된 쿠폰의 오픈시각 수정 불가
  • 마감된 쿠폰의 마감시각 수정 불가
  • 진행 중인 쿠폰은 연장만 가능
  • 시간 역전 방지
    이렇게 해두었고, 결제가 붙어도 결제에 영향을 미치는거는 없어서 결제가 붙더라도 상관없을 것 같다. (단, 결제 취소시에 사용수 롤백되는거는 한번 고민을 해봐야 할 것 같음)

문제는 삭제인데 일단은 지금은 어떤경우에도 삭제가 되게 만들어 놨고, 결제가 붙은뒤에 삭제 조건에 따른 검증이 추가 될 것 같습니다.

쿠폰 조회랑 상세조회는 원래 api명세서에서는 없었는데 구현을 하다보니까 필요할 것 같아서 구현 완료 하고 + 명세서에 추가도 완료했습니다!

✅ PR 유형

  • 새로운 기능 추가
  • CSS 등 사용자 UI 디자인 변경
  • 코드 리팩토링
  • 파일 혹은 폴더명 수정

✅ Check List

  • 코드가 정상적으로 컴파일되나요?
  • 테스트 코드를 통과했나요?
  • merge할 브랜치의 위치를 확인했나요?
  • Label을 지정했나요?

🔗 관련 이슈

💬 기타 참고 사항

@iamjieunkim iamjieunkim linked an issue Jul 16, 2025 that may be closed by this pull request
4 tasks
Copy link
Collaborator

@taeho4523 taeho4523 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다! 병합되면 풀 받아서 공통적인부분 리팩토링 추가해보겠습니당

Comment on lines +59 to +62
@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,
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 부분 공통사용되는 부분이 많아서 제가 global dto로 빼서 리팩토링하겠습니다

Copy link
Collaborator Author

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 : 일단은 내가 상태설정하게 두고, 리팩토링때 스케줄러로 처리하도록 변경
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.

inactive상태일때, 쿠폰시작시간이 되면 자동으로 active상태로 변환시켜주기위해서 사용할 것 같습니다.

Comment on lines 14 to 16
String status,
Integer quantity,
String couponCategory,
Copy link
Collaborator

Choose a reason for hiding this comment

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

enum으로 반환안되나욥??

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

반환했습니당~

Comment on lines 16 to 18
String status,
Integer quantity,
String category,
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.

반환했습니당~

Comment on lines 10 to 12
String status,
Integer quantity,
String category,
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.

반환했습니당~

userService.validateAdminRole(userId);

// 쿠폰 조회
Coupon coupon = couponRepository.findById(couponId)
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.

아 그렇네용😅 노션에도 정리해서 수정해두었습니다~

@iamjieunkim iamjieunkim self-assigned this Jul 16, 2025
Copy link
Collaborator

@Ji-minhyeok Ji-minhyeok left a 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) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

고려할 사항이 많았을텐데 고생 많으셨습니다!

@iamjieunkim iamjieunkim merged commit 4ffa593 into develop Jul 16, 2025
2 checks passed
@iamjieunkim iamjieunkim deleted the feat/#75/couponForAdmin branch July 16, 2025 08:20
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.

[Feat] 쿠폰 조회, 상세조회, 수정, 삭제 구현(관리자)

4 participants