private void AppointmentBooked(AppointmentBookedEvent @event) { _appointmentRepository.Save(@event.Source); //todo: still a problem here. //Some logic has slipped into here on how to raise a command to make a booking. var makeBookingCommand = new MakeBooking { Id = @event.Source.Id.Value, EmployeeId = @event.Source.ConsultantId, Start = @event.Source.Date + @event.Source.StartTime, End = @event.Source.Date + @event.Source.EndTime, BookingTypeId = Constants.SalesAppointmentBookingTypeId }; _bus.Send(makeBookingCommand); }
private void HolidayBooked(HolidayBookedEvent @event) { _holidayRepository.Save(@event.Source); var makeBookingCommand = new MakeBooking { Id = @event.Source.Id.Value, EmployeeId = @event.Source.Employee.Id.Value, Start = @event.Source.Start, End = @event.Source.End, BookingTypeId = Constants.HolidayBookingTypeId }; _bus.Send(makeBookingCommand); }