示例#1
0
        /// <summary>
        /// Create the booking object
        /// </summary>
        /// <param name="tenantId">Tenant identifier to associate booking with</param>
        /// <param name="customerId">Customer identifier of customer creating booking</param>
        /// <param name="therapyId">Treatment therapy identifier</param>
        /// <param name="proposedTime">Proposed date/time for the treatment</param>
        /// <param name="duration">Duration of the treatment</param>
        /// <remarks>
        /// This method should never be exposed to the IBooking interface and
        /// is only called by the BookingFactory.
        /// </remarks>
        public void Create(TenantId tenantId, CustomerId customerId, TherapyId therapyId, DateTimeOffset proposedTime, TimeSpan duration)
        {
            if (BookingId != BookingId.Empty)
            {
                throw new InvalidOperationException("Booking has already been created.");
            }

            var bookingId = new BookingId(Guid.NewGuid());

            ApplyChange(new BookingCreatedEvent(tenantId, bookingId, customerId, therapyId, proposedTime, duration));
        }
示例#2
0
 public BookingCreatedEvent(
     TenantId tenantId,
     BookingId bookingId,
     CustomerId customerId,
     TherapyId therapyId,
     DateTimeOffset proposedTime,
     TimeSpan duration)
     : base(tenantId, bookingId)
 {
     CustomerId   = customerId;
     TherapyId    = therapyId;
     ProposedTime = proposedTime;
     Duration     = duration;
 }
示例#3
0
 public TherapistBookingConfirmedEvent(TenantId tenantId, BookingId bookingId, TherapistId therapistId)
     : base(tenantId, bookingId, therapistId)
 {
 }
示例#4
0
 public TherapistBookingEvent(TenantId tenantId, BookingId bookingId, TherapistId therapistId)
     : base(tenantId, bookingId)
 {
     TherapistId = therapistId;
 }
示例#5
0
 public BookingEvent(TenantId tenantId, BookingId bookingId)
     : base(tenantId)
 {
     BookingId = bookingId;
 }
 public BookingTenderEvent(TenantId tenantId, BookingId bookingId)
     : base(tenantId, bookingId)
 {
 }
示例#7
0
 public BookingCancelledEvent(TenantId tenantId, BookingId bookingId, string reason)
     : this(tenantId, bookingId, TherapistId.Empty, reason)
 {
 }
示例#8
0
 public BookingCancelledEvent(TenantId tenantId, BookingId bookingId, TherapistId therapistId, string reason)
     : base(tenantId, bookingId)
 {
     TherapistId = therapistId;
     Reason      = reason;
 }
示例#9
0
 public TherapistBookingAcceptedEvent(TenantId tenantId, BookingId bookingId, TherapistId therapistId)
     : base(tenantId, bookingId, therapistId)
 {
 }
示例#10
0
 public BookingBidEvent(TenantId tenantId, BookingId bookingId, TherapistId therapistId, DateTimeOffset proposedTime)
     : base(tenantId, bookingId)
 {
     TherapistId  = therapistId;
     ProposedTime = proposedTime;
 }