Преглед на файлове

cappublish next end step

xf преди 1 година
родител
ревизия
4bb1512c3b
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      src/Hotline/Orders/OrderDomainService.cs

+ 5 - 1
src/Hotline/Orders/OrderDomainService.cs

@@ -119,7 +119,8 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
 
         await _orderRepository.UpdateAsync(order, cancellationToken);
 
-        //todo push msg to next step handler
+        await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, _mapper.Map<OrderDto>(order),
+            cancellationToken: cancellationToken);
     }
 
     /// <summary>
@@ -159,6 +160,9 @@ public class OrderDomainService : IOrderDomainService, IScopeDependency
         CheckOrderIfFiled(order);
         order.Filed();
         await _orderRepository.UpdateAsync(order, cancellationToken);
+
+        await _capPublisher.PublishAsync(EventNames.HotlineOrderCreated, _mapper.Map<OrderDto>(order),
+            cancellationToken: cancellationToken);
     }
 
     /// <summary>