TANG JIANG há 1 ano atrás
pai
commit
2a8b0912b1

+ 25 - 0
src/Hotline.Application/Handlers/Order/AddOrderComplementAsyncNotifyHandler.cs

@@ -0,0 +1,25 @@
+using Hotline.Application.Orders;
+using Hotline.DataSharing.Province.Notifications;
+using Hotline.Orders;
+using MediatR;
+
+namespace Hotline.Application.Handlers.Order
+{
+    public class AddOrderComplementAsyncNotifyHandler : INotificationHandler<AddOrderComplementAsyncNotify>
+    {
+        private readonly IOrderDomainService _orderDomainService;
+
+        public AddOrderComplementAsyncNotifyHandler(IOrderDomainService orderDomainService)
+        {
+            _orderDomainService = orderDomainService;
+        }
+
+        /// <summary>Handles a notification</summary>
+        /// <param name="notification">The notification</param>
+        /// <param name="cancellationToken">Cancellation token</param>
+        public async Task Handle(AddOrderComplementAsyncNotify notification, CancellationToken cancellationToken)
+        {
+            await _orderDomainService.AddOrderComplementAsync(notification.OrderComplementDto, cancellationToken);
+        }
+    }
+}