private Booking(DateTime startTime, Money price, Percent vatRate, Party bookingParty, Location location, ISystemClock systemClock) { this.StartTime = startTime; this.BookingParty = bookingParty; this.basicPrice = price; this.vatRate = vatRate; this.Location = location; this.systemClock = systemClock; bookingParty.AddBooking(this); }
public Price(Money amount, Percent vat) { this.Amount = amount; this.Vat = vat; }
public static Booking Create(DateTime startTime, int durationMinutes, Money price, Percent vatRate, Party bookingParty, Location location, ISystemClock systemClock) { if (durationMinutes > 60) { throw new InvalidOperationException("Bookings must not exceed 60 minutes."); } if (new LocalTime(startTime.Hour, startTime.Minute) < location.OpeningTime) { throw new InvalidOperationException("Bookings must not exceed 60 minutes."); } return(new Booking(startTime, price, vatRate, bookingParty, location, systemClock)); }
public Company(Percent discount) { this.DiscountPercent = discount; }