Skip to content

Commit

Permalink
Consumer API: Requesting/completing relationship reactivations does n…
Browse files Browse the repository at this point in the history
…ot create external events (#664)

* fix: register RelationshipReactivationRequestedDomainEventHandler

* fix: add DTO mapping for ExternalEventType RelationshipReactivationCompleted
  • Loading branch information
tnotheis authored May 22, 2024
1 parent 43c3e83 commit 536e207
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
using Microsoft.Extensions.Logging;

namespace Backbone.Modules.Synchronization.Application.DomainEvents.Incoming.RelationshipReactivationRequested;
public class RelationshipReactivationRequestedDomainEventHandler

public class RelationshipReactivationRequestedDomainEventHandler : IDomainEventHandler<RelationshipReactivationRequestedDomainEvent>
{
private readonly ISynchronizationDbContext _dbContext;
private readonly IEventBus _eventBus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
using Backbone.Modules.Synchronization.Application.DomainEvents.Incoming.IdentityDeletionProcessStarted;
using Backbone.Modules.Synchronization.Application.DomainEvents.Incoming.IdentityDeletionProcessStatusChanged;
using Backbone.Modules.Synchronization.Application.DomainEvents.Incoming.MessageCreated;
using Backbone.Modules.Synchronization.Application.DomainEvents.Incoming.RelationshipReactivationCompleted;
using Backbone.Modules.Synchronization.Application.DomainEvents.Incoming.RelationshipReactivationRequested;
using Backbone.Modules.Synchronization.Application.DomainEvents.Incoming.RelationshipStatusChanged;
using Backbone.Modules.Synchronization.Domain.DomainEvents.Incoming.IdentityDeletionProcessStarted;
using Backbone.Modules.Synchronization.Domain.DomainEvents.Incoming.IdentityDeletionProcessStatusChanged;
using Backbone.Modules.Synchronization.Domain.DomainEvents.Incoming.MessageCreated;
using Backbone.Modules.Synchronization.Domain.DomainEvents.Incoming.RelationshipReactivationCompleted;
using Backbone.Modules.Synchronization.Domain.DomainEvents.Incoming.RelationshipReactivationRequested;
using Backbone.Modules.Synchronization.Domain.DomainEvents.Incoming.RelationshipStatusChanged;

namespace Backbone.Modules.Synchronization.Application.Extensions;
Expand All @@ -31,5 +35,7 @@ private static void SubscribeToMessagesEvents(IEventBus eventBus)
private static void SubscribeToRelationshipsEvents(IEventBus eventBus)
{
eventBus.Subscribe<RelationshipStatusChangedDomainEvent, RelationshipStatusChangedDomainEventHandler>();
eventBus.Subscribe<RelationshipReactivationRequestedDomainEvent, RelationshipReactivationRequestedDomainEventHandler>();
eventBus.Subscribe<RelationshipReactivationCompletedDomainEvent, RelationshipReactivationCompletedDomainEventHandler>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public void CreateMappings(Profile configuration)
ExternalEventType.IdentityDeletionProcessStatusChanged => "IdentityDeletionProcessStatusChanged",
ExternalEventType.RelationshipTerminated => "RelationshipTerminated",
ExternalEventType.RelationshipReactivationRequested => "RelationshipReactivationRequested",
ExternalEventType.RelationshipReactivationCompleted => "RelationshipReactivationCompleted",
ExternalEventType.RelationshipDecomposedByPeer => "RelationshipDecomposedByPeer",
_ => throw new ArgumentOutOfRangeException(nameof(externalEventType), externalEventType, null)
});
Expand Down

0 comments on commit 536e207

Please sign in to comment.