Exemplo n.º 1
0
        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));
        }
Exemplo n.º 2
0
 private void AddWorkOrderItem(CreateWorkOrderItemEvent createWorkOrderItemEvent)
 {
     _items.Add(new WorkOrderItem(_items.Count + 1, createWorkOrderItemEvent.Sku, createWorkOrderItemEvent.StartDate, createWorkOrderItemEvent.CompleteDate, createWorkOrderItemEvent.Status, createWorkOrderItemEvent.Details));
 }