Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public Price(Money amount, Percent vat)
 {
     this.Amount = amount;
     this.Vat    = vat;
 }
Ejemplo n.º 3
0
 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));
 }
Ejemplo n.º 4
0
 public Company(Percent discount)
 {
     this.DiscountPercent = discount;
 }