/// <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)); }
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; }
public TherapistBookingConfirmedEvent(TenantId tenantId, BookingId bookingId, TherapistId therapistId) : base(tenantId, bookingId, therapistId) { }
public TherapistBookingEvent(TenantId tenantId, BookingId bookingId, TherapistId therapistId) : base(tenantId, bookingId) { TherapistId = therapistId; }
public BookingEvent(TenantId tenantId, BookingId bookingId) : base(tenantId) { BookingId = bookingId; }
public BookingTenderEvent(TenantId tenantId, BookingId bookingId) : base(tenantId, bookingId) { }
public BookingCancelledEvent(TenantId tenantId, BookingId bookingId, string reason) : this(tenantId, bookingId, TherapistId.Empty, reason) { }
public BookingCancelledEvent(TenantId tenantId, BookingId bookingId, TherapistId therapistId, string reason) : base(tenantId, bookingId) { TherapistId = therapistId; Reason = reason; }
public TherapistBookingAcceptedEvent(TenantId tenantId, BookingId bookingId, TherapistId therapistId) : base(tenantId, bookingId, therapistId) { }
public BookingBidEvent(TenantId tenantId, BookingId bookingId, TherapistId therapistId, DateTimeOffset proposedTime) : base(tenantId, bookingId) { TherapistId = therapistId; ProposedTime = proposedTime; }