File tree Expand file tree Collapse file tree
apps/commerce-api/src/main/java/com/loopers/domain/order Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,11 +7,12 @@ public record OrderCreatedEvent(
77 Long orderId ,
88 Long userId ,
99 Long totalAmount ,
10+ Long discountAmount ,
1011 Long couponId ,
1112 List <OrderItemInfo > items ,
1213 ZonedDateTime createdAt
1314) {
14- public static OrderCreatedEvent from (Order order ) {
15+ public static OrderCreatedEvent from (Order order , Long discountAmount ) {
1516 List <OrderItemInfo > itemInfos = order .getOrderItems ().stream ()
1617 .map (item -> new OrderItemInfo (
1718 item .getProductId (),
@@ -24,6 +25,7 @@ public static OrderCreatedEvent from(Order order) {
2425 order .getId (),
2526 order .getUser ().getId (),
2627 order .getTotalAmountValue (),
28+ discountAmount != null ? discountAmount : 0L ,
2729 order .getCouponId (),
2830 itemInfos ,
2931 order .getCreatedAt ()
You can’t perform that action at this time.
0 commit comments