-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from CoolPeace-yanolza/develop
쿠폰 조회(검색) 관련 및 swagger ui URL 관련 수정사항 반영 release
- Loading branch information
Showing
14 changed files
with
97 additions
and
89 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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
45 changes: 24 additions & 21 deletions
45
src/main/java/com/coolpeace/domain/coupon/dto/response/CouponResponse.java
This file contains 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 |
---|---|---|
@@ -1,55 +1,58 @@ | ||
package com.coolpeace.domain.coupon.dto.response; | ||
|
||
import com.coolpeace.domain.coupon.entity.Coupon; | ||
import com.coolpeace.domain.coupon.entity.type.CouponRoomType; | ||
import com.coolpeace.domain.coupon.entity.type.CouponStatusType; | ||
import com.coolpeace.domain.coupon.entity.type.CustomerType; | ||
import com.coolpeace.domain.coupon.entity.type.DiscountType; | ||
|
||
import java.time.DayOfWeek; | ||
import java.time.LocalDate; | ||
import java.time.LocalDateTime; | ||
import java.time.format.TextStyle; | ||
import java.util.List; | ||
import java.util.Locale; | ||
|
||
public record CouponResponse( | ||
String title, | ||
String couponNumber, | ||
CouponStatusType couponStatus, | ||
DiscountType discountType, | ||
String couponStatus, | ||
Boolean couponPromotion, | ||
String couponConcatTitle, | ||
String discountType, | ||
Integer discountValue, | ||
CustomerType customerType, | ||
CouponRoomType couponRoomType, | ||
String customerType, | ||
String couponRoomType, | ||
Integer minimumReservationPrice, | ||
List<DayOfWeek> couponUseConditionDays, | ||
List<String> couponUseConditionDays, | ||
LocalDate exposureStartDate, | ||
LocalDate exposureEndDate, | ||
Integer couponExpiration, | ||
Integer downloadCount, | ||
Integer useCount, | ||
Long accommodationId, | ||
List<Integer> registerRoomNumbers, | ||
LocalDateTime createdDate | ||
List<String> registerRoomNumbers, | ||
LocalDate createdDate | ||
) { | ||
|
||
public static CouponResponse from(Coupon coupon, List<Integer> registerRoomNumbers) { | ||
public static CouponResponse from(Coupon coupon) { | ||
return new CouponResponse( | ||
coupon.getTitle(), | ||
coupon.getCouponNumber(), | ||
coupon.getCouponStatus(), | ||
coupon.getDiscountType(), | ||
coupon.getCouponStatus().getValue(), | ||
false, // 프로모션이 개발되면 추후 수정 예정 | ||
coupon.getConcatTitle(), | ||
coupon.getDiscountType().getValue(), | ||
coupon.getDiscountValue(), | ||
coupon.getCustomerType(), | ||
coupon.getCouponRoomType(), | ||
coupon.getCustomerType().getValue(), | ||
coupon.getCouponRoomType().getValue(), | ||
coupon.getMinimumReservationPrice(), | ||
coupon.getCouponUseConditionDays(), | ||
coupon.getCouponUseConditionDays() | ||
.stream().map(dayOfWeek -> dayOfWeek.getDisplayName(TextStyle.SHORT, Locale.KOREAN)) | ||
.toList(), | ||
coupon.getExposureStartDate(), | ||
coupon.getExposureEndDate(), | ||
coupon.getCouponExpiration(), | ||
coupon.getDownloadCount(), | ||
coupon.getUseCount(), | ||
coupon.getAccommodation() != null ? coupon.getAccommodation().getId() : null, | ||
registerRoomNumbers, | ||
coupon.getCreatedAt() | ||
coupon.getCouponRooms().stream() | ||
.map(couponRooms -> couponRooms.getRoom().getRoomNumber() + "호").toList(), | ||
coupon.getCreatedAt().toLocalDate() | ||
); | ||
} | ||
} |
This file contains 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 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 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 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 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.