public WorkOrder Handle(CreateWorkOrderItemMessage message) { var workOrderItemEvent = new CreateWorkOrderItemEvent(message.Id, message.Sku, message.StartDate, message.CompleteDate, message.Status, message.Details); var workOrderEvents = _eventStore.AddEvent <WorkOrderEvents>(message.Id, workOrderItemEvent); _eventPublisher.Publish(message); return(new WorkOrder(message.Id, workOrderEvents)); }
private void AddWorkOrderItem(CreateWorkOrderItemEvent createWorkOrderItemEvent) { _items.Add(new WorkOrderItem(_items.Count + 1, createWorkOrderItemEvent.Sku, createWorkOrderItemEvent.StartDate, createWorkOrderItemEvent.CompleteDate, createWorkOrderItemEvent.Status, createWorkOrderItemEvent.Details)); }