From 536e2079682f7bd2a99514b4814ee13bdcf6e1c0 Mon Sep 17 00:00:00 2001 From: Timo Notheisen <65653426+tnotheis@users.noreply.github.com> Date: Wed, 22 May 2024 16:09:08 +0200 Subject: [PATCH] Consumer API: Requesting/completing relationship reactivations does not create external events (#664) * fix: register RelationshipReactivationRequestedDomainEventHandler * fix: add DTO mapping for ExternalEventType RelationshipReactivationCompleted --- .../RelationshipReactivationRequestedDomainEventHandler.cs | 3 ++- .../Extensions/IEventBusExtensions.cs | 6 ++++++ .../SyncRuns/DTOs/ExternalEventDTO.cs | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Modules/Synchronization/src/Synchronization.Application/DomainEvents/Incoming/RelationshipReactivationRequested/RelationshipReactivationRequestedDomainEventHandler.cs b/Modules/Synchronization/src/Synchronization.Application/DomainEvents/Incoming/RelationshipReactivationRequested/RelationshipReactivationRequestedDomainEventHandler.cs index feeae6c3c4..e7c2f783d1 100644 --- a/Modules/Synchronization/src/Synchronization.Application/DomainEvents/Incoming/RelationshipReactivationRequested/RelationshipReactivationRequestedDomainEventHandler.cs +++ b/Modules/Synchronization/src/Synchronization.Application/DomainEvents/Incoming/RelationshipReactivationRequested/RelationshipReactivationRequestedDomainEventHandler.cs @@ -8,7 +8,8 @@ using Microsoft.Extensions.Logging; namespace Backbone.Modules.Synchronization.Application.DomainEvents.Incoming.RelationshipReactivationRequested; -public class RelationshipReactivationRequestedDomainEventHandler + +public class RelationshipReactivationRequestedDomainEventHandler : IDomainEventHandler { private readonly ISynchronizationDbContext _dbContext; private readonly IEventBus _eventBus; diff --git a/Modules/Synchronization/src/Synchronization.Application/Extensions/IEventBusExtensions.cs b/Modules/Synchronization/src/Synchronization.Application/Extensions/IEventBusExtensions.cs index 4bb7bf11d9..3fa6c94a85 100644 --- a/Modules/Synchronization/src/Synchronization.Application/Extensions/IEventBusExtensions.cs +++ b/Modules/Synchronization/src/Synchronization.Application/Extensions/IEventBusExtensions.cs @@ -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; @@ -31,5 +35,7 @@ private static void SubscribeToMessagesEvents(IEventBus eventBus) private static void SubscribeToRelationshipsEvents(IEventBus eventBus) { eventBus.Subscribe(); + eventBus.Subscribe(); + eventBus.Subscribe(); } } diff --git a/Modules/Synchronization/src/Synchronization.Application/SyncRuns/DTOs/ExternalEventDTO.cs b/Modules/Synchronization/src/Synchronization.Application/SyncRuns/DTOs/ExternalEventDTO.cs index 5d447eef5d..13fc65a293 100644 --- a/Modules/Synchronization/src/Synchronization.Application/SyncRuns/DTOs/ExternalEventDTO.cs +++ b/Modules/Synchronization/src/Synchronization.Application/SyncRuns/DTOs/ExternalEventDTO.cs @@ -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) });