Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: or-2472 clean up code of fusies #1015

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,15 @@
using Acties.GrarConsumer.HeradresseerLocaties;
using Acties.GrarConsumer.OntkoppelAdres;
using Amazon.Runtime;
using Amazon.SQS.Model;
using EventStore;
using Grar.AddressMatch;
using Grar.GrarUpdates.Fusies.TeHeradresserenLocaties;
using Hosts.Configuration;
using JasperFx.CodeGeneration;
using Serilog;
using Vereniging;
using Wolverine;
using Wolverine.AmazonSqs;
using Wolverine.ErrorHandling;
using Wolverine.Runtime.Routing;
using Wolverine.Runtime.Serialization;

public static class WolverineExtensions
{
Expand All @@ -31,13 +27,8 @@ public static void AddWolverine(this WebApplicationBuilder builder)
options.Discovery.IncludeAssembly(typeof(Vereniging).Assembly);
options.Discovery.IncludeType<TeAdresMatchenLocatieMessage>();
options.Discovery.IncludeType<TeAdresMatchenLocatieMessageHandler>();
options.Discovery.IncludeType<HeradresseerLocatiesMessage>();
options.Discovery.IncludeType<HeradresseerLocatiesMessageHandler>();
options.Discovery.IncludeType<TeAdresMatchenLocatieMessage>();
options.Discovery.IncludeType<OntkoppelLocatiesMessageHandler>();
options.Discovery.IncludeType<OverkoepelendeGrarConsumerMessage>();
options.Discovery.IncludeType<StringHandler>();

options.Discovery.IncludeType<OverkoepelendeGrarConsumerMessageHandler>();

options.OnException<UnexpectedAggregateVersionDuringSyncException>().RetryWithCooldown(
TimeSpan.FromSeconds(1),
Expand Down Expand Up @@ -118,37 +109,10 @@ private static void ConfigureGrarSyncListener(
{
configure.MaxNumberOfMessages = 1;
configure.DeadLetterQueueName = sqsDeadLetterQueueName;
configure.RegisterSerializer(new MySerializer());
})
.ConfigureDeadLetterQueue(sqsDeadLetterQueueName)
.ReceiveRawJsonMessage(typeof(OverkoepelendeGrarConsumerMessage))
.MaximumParallelMessages(1);
}
}

internal class MySerializer : IntrinsicSerializer
{
public byte[] Write(Envelope envelope)
{
return base.Write(envelope);
}

public object ReadFromData(Type messageType, Envelope envelope)
{
return base.ReadFromData(messageType, envelope);
}

public object ReadFromData(byte[] data)
{
return base.ReadFromData(data);

}

public byte[] WriteMessage(object message)
{
return base.WriteMessage(message);
}

public string ContentType { get; }
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,6 @@ namespace AssociationRegistry.Acties.GrarConsumer.HeradresseerLocaties;
using NodaTime;
using Wolverine;

public class StringHandler
{
private readonly IVerenigingsRepository _repository;
private readonly IGrarClient _client;

public StringHandler(IVerenigingsRepository repository, IGrarClient client)
{
_repository = repository;
_client = client;
}

public async Task Handle(HeradresseerLocatiesMessage message, Envelope envelope, CancellationToken cancellationToken)
{
var asJson = JsonConvert.SerializeObject(message);
var back1 = JsonConvert.DeserializeObject<HeradresseerLocatiesMessage>(asJson);
}
}

public class HeradresseerLocatiesMessageHandler
{
private readonly IVerenigingsRepository _repository;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
namespace AssociationRegistry.Grar.GrarUpdates.Hernummering;

using Acties.GrarConsumer.HeradresseerLocaties;
using AssociationRegistry.Grar.GrarUpdates.LocatieFinder;
using LocatieFinder;

public class TeHeradresserenLocatiesMapper
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ public interface ILocatieFinder
{
Task<LocatiesPerVCodeCollection> FindLocaties(params int[] adresIds);
Task<LocatiesPerVCodeCollection> FindLocaties(params string[] adresIds);
Task<IEnumerable<LocatieLookupData>> FindLocatieLookupDocuments(string[] adresIds);
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
namespace AssociationRegistry.Test.Admin.Api.GrarConsumer;

using AssociationRegistry.Admin.Api.GrarConsumer.Finders;
using AssociationRegistry.Admin.Schema.Detail;
using Grar.GrarUpdates;
using Grar.GrarUpdates.LocatieFinder;

public class StubLocatieFinder : ILocatieFinder
Expand Down
Loading