-
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.
- Loading branch information
Showing
7 changed files
with
90 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,4 +51,4 @@ public void applyDiscounts() { | |
|
||
Objects.requireNonNull(cacheManager.getCache("PackageDetail")).clear(); | ||
} | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
...d/product/src/main/java/org/samtuap/inong/domain/discount/dto/DiscountDetailResponse.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package org.samtuap.inong.domain.discount.dto; | ||
|
||
import lombok.Builder; | ||
import org.samtuap.inong.domain.discount.entity.Discount; | ||
|
||
import java.time.LocalDate; | ||
import java.util.List; | ||
|
||
@Builder | ||
public record DiscountDetailResponse( | ||
Long id, | ||
Integer discount, | ||
LocalDate startAt, | ||
LocalDate endAt, | ||
boolean discountActive, | ||
List<Long>productIdList | ||
) { | ||
public static DiscountDetailResponse fromEntity(Discount discount, List<Long> productIdList) { | ||
return DiscountDetailResponse.builder() | ||
.id(discount.getId()) | ||
.discount(discount.getDiscount()) | ||
.startAt(discount.getStartAt()) | ||
.endAt(discount.getEndAt()) | ||
.discountActive(discount.isDiscountActive()) | ||
.productIdList(productIdList) | ||
.build(); | ||
} | ||
} |
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