-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
be90282
feat:쿠폰목록조회(관리자)
iamjieunkim 7672daf
feat:관리자계정추가
iamjieunkim 8138426
feat:검증조건추가
iamjieunkim 85c2d1b
feat:쿠폰수정
iamjieunkim f50fd8c
feat:쿠폰삭제
iamjieunkim 75c8d19
refactor:페이지응답통일
iamjieunkim 5bf92d8
fix:checkstyle통일
iamjieunkim 515f00e
refactor:enum,공통메서드수정
iamjieunkim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,7 +26,7 @@ public record CouponCreateRequestDto( | |
| Integer minOrderPrice, | ||
|
|
||
| @NotNull(message = "쿠폰 상태는 필수입니다") | ||
| CouponStatus status, | ||
| CouponStatus status, //TODO : 일단은 내가 상태설정하게 두고, 리팩토링때 스케줄러로 처리하도록 변경 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 스케줄러는 어떤 로직을 처리하기 위해 도입되는건가용 ?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. inactive상태일때, 쿠폰시작시간이 되면 자동으로 active상태로 변환시켜주기위해서 사용할 것 같습니다. |
||
|
|
||
| @Min(value = 1, message = "수량은 1개 이상이어야 합니다") | ||
| Integer quantity, | ||
|
|
||
13 changes: 13 additions & 0 deletions
13
src/main/java/com/threestar/trainus/domain/coupon/admin/dto/CouponDeleteResponseDto.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| package com.threestar.trainus.domain.coupon.admin.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| /** | ||
| * 쿠폰 삭제 응답 DTO | ||
| */ | ||
| public record CouponDeleteResponseDto( | ||
| Long couponId, | ||
| String couponName, | ||
| LocalDateTime deletedAt | ||
| ) { | ||
| } |
26 changes: 26 additions & 0 deletions
26
src/main/java/com/threestar/trainus/domain/coupon/admin/dto/CouponDetailResponseDto.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| package com.threestar.trainus.domain.coupon.admin.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| import com.threestar.trainus.domain.coupon.user.entity.CouponCategory; | ||
| import com.threestar.trainus.domain.coupon.user.entity.CouponStatus; | ||
|
|
||
| /** | ||
| * 쿠폰 상세 조회 응답 DTO | ||
| */ | ||
| public record CouponDetailResponseDto( | ||
| Long id, | ||
| String couponName, | ||
| LocalDateTime expirationDate, | ||
| String discountPrice, | ||
| Integer minOrderPrice, | ||
| CouponStatus status, | ||
| Integer quantity, | ||
| CouponCategory couponCategory, | ||
| LocalDateTime couponOpenAt, | ||
| LocalDateTime couponDeadlineAt, | ||
| LocalDateTime createdAt, | ||
| LocalDateTime updatedAt, | ||
| Integer issuedCount | ||
| ) { | ||
| } |
25 changes: 25 additions & 0 deletions
25
src/main/java/com/threestar/trainus/domain/coupon/admin/dto/CouponListItemDto.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package com.threestar.trainus.domain.coupon.admin.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| import com.threestar.trainus.domain.coupon.user.entity.CouponCategory; | ||
| import com.threestar.trainus.domain.coupon.user.entity.CouponStatus; | ||
|
|
||
| /** | ||
| * 개별의 쿠폰 정보 | ||
| */ | ||
| public record CouponListItemDto( | ||
| Long couponId, | ||
| String couponName, | ||
| LocalDateTime expirationDate, | ||
| String discountPrice, | ||
| Integer minOrderPrice, | ||
| LocalDateTime createdAt, | ||
| LocalDateTime updatedAt, | ||
| CouponStatus status, | ||
| Integer quantity, | ||
| CouponCategory category, | ||
| LocalDateTime couponOpenAt, | ||
| LocalDateTime couponDeadlineAt | ||
| ) { | ||
| } |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/threestar/trainus/domain/coupon/admin/dto/CouponListResponseDto.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.threestar.trainus.domain.coupon.admin.dto; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public record CouponListResponseDto( | ||
| Integer totalCount, | ||
| List<CouponListItemDto> couponList | ||
| ) { | ||
| } |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/threestar/trainus/domain/coupon/admin/dto/CouponListWrapperDto.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| package com.threestar.trainus.domain.coupon.admin.dto; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public record CouponListWrapperDto( | ||
| List<CouponListItemDto> coupons | ||
| ) { | ||
| } |
32 changes: 32 additions & 0 deletions
32
src/main/java/com/threestar/trainus/domain/coupon/admin/dto/CouponUpdateRequestDto.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| package com.threestar.trainus.domain.coupon.admin.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| import com.threestar.trainus.domain.coupon.user.entity.CouponCategory; | ||
| import com.threestar.trainus.domain.coupon.user.entity.CouponStatus; | ||
|
|
||
| import jakarta.validation.constraints.Min; | ||
| import jakarta.validation.constraints.Size; | ||
|
|
||
| /** | ||
| * 쿠폰 수정 요청 DTO | ||
| * 일반쿠폰(NORMAL): 수량은 프론트에서 비활성화, 백엔드에서 자동으로 null 처리 | ||
| * 선착순쿠폰(OPEN_RUN): 수량 필수 입력 | ||
| */ | ||
| public record CouponUpdateRequestDto( | ||
|
|
||
| @Size(max = 45, message = "쿠폰명은 45자 이하여야 합니다") | ||
| String couponName, | ||
|
|
||
| CouponStatus status, | ||
|
|
||
| @Min(value = 1, message = "수량은 1개 이상이어야 합니다") | ||
| Integer quantity, | ||
|
|
||
| CouponCategory category, | ||
|
|
||
| LocalDateTime couponOpenAt, | ||
|
|
||
| LocalDateTime couponDeadlineAt | ||
| ) { | ||
| } |
20 changes: 20 additions & 0 deletions
20
src/main/java/com/threestar/trainus/domain/coupon/admin/dto/CouponUpdateResponseDto.java
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| package com.threestar.trainus.domain.coupon.admin.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| import com.threestar.trainus.domain.coupon.user.entity.CouponCategory; | ||
| import com.threestar.trainus.domain.coupon.user.entity.CouponStatus; | ||
|
|
||
| /** | ||
| * 쿠폰 수정 응답 DTO | ||
| */ | ||
| public record CouponUpdateResponseDto( | ||
| String couponName, | ||
| CouponStatus status, | ||
| Integer quantity, | ||
| CouponCategory category, | ||
| LocalDateTime couponOpenAt, | ||
| LocalDateTime couponDeadlineAt, | ||
| LocalDateTime updatedAt | ||
| ) { | ||
| } |
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
Oops, something went wrong.
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.
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.
넵!!!