Skip to content

Commit

Permalink
fixed texts
Browse files Browse the repository at this point in the history
  • Loading branch information
minduca committed Mar 13, 2017
1 parent 01512fd commit 71eb3f0
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions Application/Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Inventory\EventHandlers\SubtractInventaryWhenOrderPayedEventHandler.cs" />
<Compile Include="Inventory\EventHandlers\SubtractInventaryWhenOrderPaidEventHandler.cs" />
<Compile Include="Inventory\InventoryService.cs" />
<Compile Include="NotificationsHandler.cs" />
<Compile Include="Orders\EventHandlers\PlaceOrderWhenPayedEventHandler.cs" />
<Compile Include="Orders\EventHandlers\PlaceOrderWhenPaidEventHandler.cs" />
<Compile Include="Orders\OrderPlacementService.cs" />
<Compile Include="Payments\PaymentService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@

namespace Minduca.Application.Inventory.EventHandlers
{
public class SubtractInventaryWhenOrderPayedEventHandler : IHandles<OrderPayedEvent>
public class SubtractInventaryWhenOrderPaidEventHandler : IHandles<OrderPaidEvent>
{
private readonly IInventoryService _inventory;

public SubtractInventaryWhenOrderPayedEventHandler(IInventoryService inventory)
public SubtractInventaryWhenOrderPaidEventHandler(IInventoryService inventory)
{
_inventory = inventory;
}

public bool Deferred { get { return false; } }

public void Handle(OrderPayedEvent domainEvent)
public void Handle(OrderPaidEvent domainEvent)
{
System.Console.WriteLine("[Event] - SubtractInventaryWhenOrderPayedEventHandler.Handle(domainEvent)");
System.Console.WriteLine("[Event] - SubtractInventaryWhenOrderPaidEventHandler.Handle(domainEvent)");
foreach (var item in domainEvent.OrderItems)
_inventory.SubtractAvailability(item.InventoryItemId, item.Quantity);
}
Expand Down
6 changes: 3 additions & 3 deletions Application/NotificationsHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace Minduca.BoundedContexts
{
public class NotificationsHandler : IHandles<OrderPayedEvent>, IHandles<OrderShippedEvent> //<- multiple events handled by a single handler
public class NotificationsHandler : IHandles<OrderPaidEvent>, IHandles<OrderShippedEvent> //<- multiple events handled by a single handler
{
private readonly IUserNotifier _notifier;

Expand All @@ -21,10 +21,10 @@ public NotificationsHandler(IUserNotifier notifier) // <-- instantiated by the d

public bool Deferred { get { return true; } } //<- 'true' here indicates that all these events should be invoked only after the transaction is committed

public void Handle(OrderPayedEvent domainEvent)
public void Handle(OrderPaidEvent domainEvent)
{
System.Console.WriteLine("[Event] - NotificationsHandler.Handle(domainEvent)");
_notifier.Notify("Yay! We received your money. Your order has been placed");
_notifier.Notify("Yay! Your payment has been processed.");
}

public void Handle(OrderShippedEvent domainEvent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@

namespace Minduca.Application.Orders.EventHandlers
{
public class PlaceOrderWhenPayedEventHandler : IHandles<OrderPayedEvent>
public class PlaceOrderWhenPaidEventHandler : IHandles<OrderPaidEvent>
{
private readonly IOrderPlacementService _orderPlacement;

public PlaceOrderWhenPayedEventHandler(IOrderPlacementService orderPlacement)
public PlaceOrderWhenPaidEventHandler(IOrderPlacementService orderPlacement)
{
_orderPlacement = orderPlacement;
}

public bool Deferred { get { return false; } }

public void Handle(OrderPayedEvent domainEvent)
public void Handle(OrderPaidEvent domainEvent)
{
System.Console.WriteLine("[Event] - PlaceOrderWhenPayedEventHandler.Handle(domainEvent)");
System.Console.WriteLine("[Event] - PlaceOrderWhenPaidEventHandler.Handle(domainEvent)");
_orderPlacement.PlaceOrder(domainEvent.Payment.OrderId);
}
}
Expand Down
2 changes: 1 addition & 1 deletion Application/Payments/PaymentService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void PayOrder(int orderId, decimal amount)

_paymentRepository.Insert(payment);

_events.Raise(new OrderPayedEvent(payment, order.Items));
_events.Raise(new OrderPaidEvent(payment, order.Items));
}
}
}
2 changes: 1 addition & 1 deletion Domain/Core/Data/IDbStateTracker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Minduca.Domain.Core.Data
{

/// <summary>
/// Tracks the database state
/// Tracks the database's state
/// </summary>
public interface IDbStateTracker : IDisposable
{
Expand Down
2 changes: 1 addition & 1 deletion Domain/Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<Compile Include="Inventory\IInventoryService.cs" />
<Compile Include="Orders\EOrderStatus.cs" />
<Compile Include="Orders\OrderItem.cs" />
<Compile Include="Payments\Events\OrderPayedEvent.cs" />
<Compile Include="Payments\Events\OrderPaidEvent.cs" />
<Compile Include="Orders\Events\OrderShippedEvent.cs" />
<Compile Include="Orders\IOrderPlacementService.cs" />
<Compile Include="Orders\Order.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

namespace Minduca.Domain.Payments.Events
{
public class OrderPayedEvent : IDomainEvent
public class OrderPaidEvent : IDomainEvent
{
public OrderPayedEvent(Payment payment, IEnumerable<OrderItem> orderItems)
public OrderPaidEvent(Payment payment, IEnumerable<OrderItem> orderItems)
{
Payment = payment;
OrderItems = new List<OrderItem>(orderItems);
Expand Down
8 changes: 4 additions & 4 deletions Infrastructure/DomainEventsRaiser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ class DomainEventsRaiser : IDomainEventsRaiser
/// <summary>
/// Locator of event handlers
/// </summary>
private readonly IServiceProvider _resolver;
private readonly IServiceProvider _locator;

internal DomainEventsRaiser(IServiceProvider resolver)
internal DomainEventsRaiser(IServiceProvider locator)
{
_resolver = resolver;
_locator = locator;
}

/// <summary>
Expand All @@ -26,7 +26,7 @@ internal DomainEventsRaiser(IServiceProvider resolver)
public void Raise<T>(T domainEvent) where T : IDomainEvent
{
//Get all the handlers that handle events of type T
IHandles<T>[] allHandlers = (IHandles<T>[])_resolver.GetService(typeof(IHandles<T>[]));
IHandles<T>[] allHandlers = (IHandles<T>[])_locator.GetService(typeof(IHandles<T>[]));

if (allHandlers != null && allHandlers.Length > 0)
foreach (var handler in allHandlers)
Expand Down

0 comments on commit 71eb3f0

Please sign in to comment.