IntegrationEvent is completed
This commit is contained in:
parent
76c45d128a
commit
f70035641f
@ -27,7 +27,7 @@ public partial class OrderCompletedDomainEventHandler
|
|||||||
var order = await _orderRepository.GetAsync(domainEvent.Order.Id);
|
var order = await _orderRepository.GetAsync(domainEvent.Order.Id);
|
||||||
var buyer = await _buyerRepository.FindByIdAsync(order.GetBuyerId.Value.ToString());
|
var buyer = await _buyerRepository.FindByIdAsync(order.GetBuyerId.Value.ToString());
|
||||||
|
|
||||||
var integrationEvent = new OrderStatusChangedToCancelledIntegrationEvent(order.Id, order.OrderStatus.Name, buyer.Name);
|
var integrationEvent = new OrderStatusChangedToCompletedIntegrationEvent(order.Id, order.OrderStatus.Name, buyer.Name);
|
||||||
await _orderingIntegrationEventService.AddAndSaveEventAsync(integrationEvent);
|
await _orderingIntegrationEventService.AddAndSaveEventAsync(integrationEvent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
namespace Microsoft.eShopOnContainers.Services.Ordering.API.Application.IntegrationEvents.Events;
|
||||||
|
|
||||||
|
public record OrderStatusChangedToCompletedIntegrationEvent : IntegrationEvent
|
||||||
|
{
|
||||||
|
public int OrderId { get; }
|
||||||
|
public string OrderStatus { get; }
|
||||||
|
public string BuyerName { get; }
|
||||||
|
|
||||||
|
public OrderStatusChangedToCompletedIntegrationEvent(int orderId, string orderStatus, string buyerName)
|
||||||
|
{
|
||||||
|
OrderId = orderId;
|
||||||
|
OrderStatus = orderStatus;
|
||||||
|
BuyerName = buyerName;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user