public void Handle(CompleteVisit message) { DomainEvents.Register <VisitCompletedDomainEvent>(VisitCompletedDomainEventHandler); var visit = _visitRepository.GetById(message.Id); visit.Complete(); _visitRepository.Flush(); _bus.Return(ReturnCode.OK); }
public void Handle(BookVisit message) { DomainEvents.Register <VisitBookedDomainEvent>(VisitBookedDomainEventHandler); var lead = _leadRepository.GetById(message.LeadId); Visit.Book( message.Id, message.AppointmentId, lead, message.ConsultantId); _visitRepository.Flush(); _bus.Return(ReturnCode.OK); }