Skip to content

Commit 321d3a8

Browse files
committed
[java][booking][03_preserve_object] Preserve Discount object
1 parent af0761a commit 321d3a8

File tree

1 file changed

+2
-4
lines changed
  • examples/java/java-booking-03_preserve_whole_object/src/main/java/tv/codely/booking

1 file changed

+2
-4
lines changed

examples/java/java-booking-03_preserve_whole_object/src/main/java/tv/codely/booking/Booking.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ public final class Booking {
1010
private final CustomerName customerName;
1111
private final EmailAddress customerEmail;
1212
private final BookingType bookingType;
13-
private final DiscountType discountType;
14-
private final DiscountValue discountValue;
13+
private final Discount discount;
1514
private final Tax tax;
1615

1716
public Booking(
@@ -29,8 +28,7 @@ public Booking(
2928
this.customerName = customer.name();
3029
this.customerEmail = customer.emailAddress();
3130
this.bookingType = bookingType;
32-
this.discountType = discount.type();
33-
this.discountValue = discount.value();
31+
this.discount = discount;
3432
this.tax = tax;
3533
}
3634

0 commit comments

Comments
 (0)