-
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
Changes from 7 commits
be90282
7672daf
8138426
85c2d1b
f50fd8c
75c8d19
5bf92d8
515f00e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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, | ||
|
|
||
| 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 | ||
| ) { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| package com.threestar.trainus.domain.coupon.admin.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| /** | ||
| * 쿠폰 상세 조회 응답 DTO | ||
| */ | ||
| public record CouponDetailResponseDto( | ||
| Long id, | ||
| String couponName, | ||
| LocalDateTime expirationDate, | ||
| String discountPrice, | ||
| Integer minOrderPrice, | ||
| String status, | ||
| Integer quantity, | ||
| String couponCategory, | ||
|
||
| LocalDateTime couponOpenAt, | ||
| LocalDateTime couponDeadlineAt, | ||
| LocalDateTime createdAt, | ||
| LocalDateTime updatedAt, | ||
| Integer issuedCount | ||
| ) { | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package com.threestar.trainus.domain.coupon.admin.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| /** | ||
| * 개별의 쿠폰 정보 | ||
| */ | ||
| public record CouponListItemDto( | ||
| Long couponId, | ||
| String couponName, | ||
| LocalDateTime expirationDate, | ||
| String discountPrice, | ||
| Integer minOrderPrice, | ||
| LocalDateTime createdAt, | ||
| LocalDateTime updatedAt, | ||
| String status, | ||
| Integer quantity, | ||
| String category, | ||
|
||
| LocalDateTime couponOpenAt, | ||
| LocalDateTime couponDeadlineAt | ||
| ) { | ||
| } | ||
| 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 | ||
| ) { | ||
| } |
| 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 | ||
| ) { | ||
| } |
| 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 | ||
| ) { | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| package com.threestar.trainus.domain.coupon.admin.dto; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| /** | ||
| * 쿠폰 수정 응답 DTO | ||
| */ | ||
| public record CouponUpdateResponseDto( | ||
| String couponName, | ||
| String status, | ||
| Integer quantity, | ||
| String category, | ||
|
||
| LocalDateTime couponOpenAt, | ||
| LocalDateTime couponDeadlineAt, | ||
| LocalDateTime updatedAt | ||
| ) { | ||
| } | ||
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.
넵!!!