Skip to content

Commit

Permalink
Merge pull request #79 from daadaadaah/fix/add-missing-startedAt-and-…
Browse files Browse the repository at this point in the history
…finishedAt-in-DealProductDetail

`TimeDealProductDetail`에 빠진 `startedAt`, `finishedAt` 추가
  • Loading branch information
daadaadaah authored Jun 30, 2023
2 parents 9acadac + cb36377 commit 3bd8e5e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ private TimeDealProductDetail convertTimeDealProductToTimeDealProductDetail(Time
.productMainImgUrl(timeDealProductEntity.getProductMainImgUrl())
.productDetailImgUrls(timeDealProductEntity.getProductDetailImgUrls())
.maxOrderQuantityPerOrder(timeDealProductEntity.getMaxOrderQuantityPerOrder())
.startedAt(timeDealProductEntity.getStartedAt())
.finishedAt(timeDealProductEntity.getFinishedAt())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.hcommerce.heecommerce.deal;

import java.time.Instant;
import java.util.UUID;
import lombok.Builder;
import lombok.Getter;
Expand All @@ -16,6 +17,9 @@ public class TimeDealProductDetail {
private final int dealProductDiscountValue;
private final int dealProductDealQuantity;
private final int maxOrderQuantityPerOrder;
private final Instant startedAt;
private final Instant finishedAt;

@Builder
public TimeDealProductDetail(
UUID dealProductUuid,
Expand All @@ -26,7 +30,9 @@ public TimeDealProductDetail(
DiscountType dealProductDiscountType,
int dealProductDiscountValue,
int dealProductDealQuantity,
int maxOrderQuantityPerOrder
int maxOrderQuantityPerOrder,
Instant startedAt,
Instant finishedAt
) {
this.dealProductUuid = dealProductUuid;
this.dealProductTile = dealProductTile;
Expand All @@ -37,5 +43,7 @@ public TimeDealProductDetail(
this.dealProductDiscountValue = dealProductDiscountValue;
this.dealProductDealQuantity = dealProductDealQuantity;
this.maxOrderQuantityPerOrder = maxOrderQuantityPerOrder;
this.startedAt = startedAt;
this.finishedAt = finishedAt;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ void It_returns_200_OK() throws Exception {
.dealProductDiscountValue(1000)
.dealProductDealQuantity(3)
.maxOrderQuantityPerOrder(10)
.startedAt(STARTED_AT)
.finishedAt(FINISHED_AT)
.build();

given(dealService.getTimeDealProductDetailByDealProductUuid(DEAL_PRODUCT_UUID)).willReturn(timeDealProductDetailFixture);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ void It_return_dealProducts() {
.dealProductDiscountValue(1000)
.dealProductDealQuantity(3)
.maxOrderQuantityPerOrder(10)
.startedAt(STARTED_AT)
.finishedAt(FINISHED_AT)
.build();

given(dealQueryRepository.getTimeDealProductDetailByDealProductUuid(dealProductUuid)).willReturn(timeDealProductDetailFixture);
Expand Down

0 comments on commit 3bd8e5e

Please sign in to comment.