diff --git a/examples/csharp/csharp-booking-01_base/src/Booking/Booking.cs b/examples/csharp/csharp-booking-01_base/src/Booking/Booking.cs index 0a765eab..67241602 100644 --- a/examples/csharp/csharp-booking-01_base/src/Booking/Booking.cs +++ b/examples/csharp/csharp-booking-01_base/src/Booking/Booking.cs @@ -2,33 +2,25 @@ namespace CodelyTv.Booking { - public sealed class Booking + public class BookingPricing { - private readonly BookingId id; - private readonly DateTime startDate; - private readonly DateTime endDate; - private readonly CustomerId customerId; - private readonly CustomerName customerName; - private readonly EmailAddress customerEmail; - private readonly BookingType bookingType; - private readonly DiscountType discountType; - private readonly DiscountValue discountValue; - private readonly TaxType taxType; - private readonly TaxValue taxValue; + public DiscountType DiscountType { get; } + public DiscountValue DiscountValue { get; } + public TaxType TaxType { get; } + public TaxValue TaxValue { get; } - public Booking( - BookingId id, - DateTime startDate, - DateTime endDate, - CustomerId customerId, - CustomerName customerName, - EmailAddress customerEmail, - BookingType bookingType, - DiscountType discountType, - DiscountValue discountValue, - TaxType taxType, - TaxValue taxValue - ) + public BookingPricing(DiscountType discountType, DiscountValue discountValue, TaxType taxType, TaxValue taxValue) + { + DiscountType = discountType; + DiscountValue = discountValue; + TaxType = taxType; + TaxValue = taxValue; + } + + private readonly BookingPricing pricing; + + public Booking(BookingId id, DateTime startDate, DateTime endDate, CustomerId customerId, + CustomerName customerName, EmailAddress customerEmail, BookingType bookingType, BookingPricing pricing) { this.id = id; this.startDate = startDate; @@ -37,10 +29,7 @@ TaxValue taxValue this.customerName = customerName; this.customerEmail = customerEmail; this.bookingType = bookingType; - this.discountType = discountType; - this.discountValue = discountValue; - this.taxType = taxType; - this.taxValue = taxValue; + this.pricing = pricing; } public BookingStatus StatusFor(DateTime date)