Skip to content

Commit

Permalink
refactor: move events to separate project to ensure no mingling
Browse files Browse the repository at this point in the history
  • Loading branch information
koenmetsu committed Jan 8, 2025
1 parent 8414fc2 commit ceefc2e
Show file tree
Hide file tree
Showing 281 changed files with 1,102 additions and 905 deletions.
7 changes: 7 additions & 0 deletions AssociationRegistry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssociationRegistry.Test.Po
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssociationRegistry.Test.Projections", "test\AssociationRegistry.Test.Projections\AssociationRegistry.Test.Projections.csproj", "{F133FB97-C071-4CB8-91C4-F938497DB3A3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssociationRegistry.Events", "src\AssociationRegistry.Events\AssociationRegistry.Events.csproj", "{9381A2D5-C9A2-462C-A3EA-689D23F10D8A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -278,6 +280,10 @@ Global
{F133FB97-C071-4CB8-91C4-F938497DB3A3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F133FB97-C071-4CB8-91C4-F938497DB3A3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F133FB97-C071-4CB8-91C4-F938497DB3A3}.Release|Any CPU.Build.0 = Release|Any CPU
{9381A2D5-C9A2-462C-A3EA-689D23F10D8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9381A2D5-C9A2-462C-A3EA-689D23F10D8A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9381A2D5-C9A2-462C-A3EA-689D23F10D8A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9381A2D5-C9A2-462C-A3EA-689D23F10D8A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3BD77833-6175-4440-903D-88F9B07C6FE6} = {1157AB42-EACF-454D-92D5-DBA9FF3D0E24}
Expand Down Expand Up @@ -317,5 +323,6 @@ Global
{AC334242-4A17-4E1B-883F-9B0E85B47163} = {1157AB42-EACF-454D-92D5-DBA9FF3D0E24}
{14C4D10A-7BE1-4C89-833C-2699605319A9} = {C812C887-6495-405A-8B99-4F686D243126}
{F133FB97-C071-4CB8-91C4-F938497DB3A3} = {C812C887-6495-405A-8B99-4F686D243126}
{9381A2D5-C9A2-462C-A3EA-689D23F10D8A} = {1157AB42-EACF-454D-92D5-DBA9FF3D0E24}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ private void DeleteEvent<TEvent>(Func<IEvent<TEvent>, string> identityFunc) wher

public class LocatieZonderAdresMatchGrouper : IAggregateGrouper<string>
{
public async Task Group(IQuerySession session, IEnumerable<IEvent> events, ITenantSliceGroup<string> grouping)
public async Task Group(IQuerySession session, IEnumerable<Marten.Events.IEvent> events, ITenantSliceGroup<string> grouping)
{
var verwijderdEvents = events
.OfType<IEvent<VerenigingWerdVerwijderd>>()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AssociationRegistry.Events;

public record AdresDetailUitAdressenregister
{
public Registratiedata.AdresId AdresId { get; init; }
public Registratiedata.AdresUitAdressenregister Adres { get; init; }
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;


public record AdresHeeftGeenVerschillenMetAdressenregister(
string VCode,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
namespace AssociationRegistry.Events;

using Framework;

public record AdresKonNietOvergenomenWordenUitAdressenregister(string VCode, int LocatieId, string Adres, string Reden = "") : IEvent
{
public const string RedenLocatieWerdVerwijderd = "Locatie kon niet gevonden worden. Mogelijks is deze verwijderd.";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace AssociationRegistry.Events;

using Framework;


public record AdresNietUniekInAdressenregister(string VCode, int LocatieId, NietUniekeAdresMatchUitAdressenregister[] NietOvergenomenAdressenUitAdressenregister) : IEvent;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;


public record AdresWerdGewijzigdInAdressenregister(
string VCode,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace AssociationRegistry.Events;



public record AdresWerdNietGevondenInAdressenregister(
string VCode,
int LocatieId,
string Straatnaam,
string Huisnummer,
string Busnummer,
string Postcode,
string Gemeente) : IEvent
{
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;


public record AdresWerdOntkoppeldVanAdressenregister(string VCode, int LocatieId, Registratiedata.AdresId? AdresId, Registratiedata.Adres? Adres) : IEvent;

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;


public record AdresWerdOvergenomenUitAdressenregister(
string VCode,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
namespace AssociationRegistry.Events;

using Framework;

using System.Runtime.Serialization;
using Vereniging.Bronnen;

[Obsolete]
public record AfdelingWerdGeregistreerd(
Expand All @@ -18,9 +17,9 @@ public record AfdelingWerdGeregistreerd(
Registratiedata.Vertegenwoordiger[] Vertegenwoordigers,
Registratiedata.HoofdactiviteitVerenigingsloket[] HoofdactiviteitenVerenigingsloket) : IEvent
{
[IgnoreDataMember]
public Bron Bron
=> Bron.Initiator;
// [IgnoreDataMember]
// public Bron Bron
// => Bron.Initiator;

public record MoederverenigingsData(string KboNummer, string VCode, string Naam);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace AssociationRegistry.Vereniging.Bronnen;
// ReSharper disable once CheckNamespace
namespace AssociationRegistry.Vereniging.Bronnen;

public class Bron
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;


public record ContactgegevenKonNietOvergenomenWordenUitKBO(
string Contactgegeventype,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;

using System.Runtime.Serialization;
using Vereniging;
using Vereniging.Bronnen;
Expand All @@ -14,6 +14,4 @@ public record ContactgegevenUitKBOWerdGewijzigd(
public Bron Bron
=> Bron.KBO;

public static ContactgegevenUitKBOWerdGewijzigd With(Contactgegeven contactgegeven)
=> new(contactgegeven.ContactgegevenId, contactgegeven.Beschrijving, contactgegeven.IsPrimair);
}
14 changes: 14 additions & 0 deletions src/AssociationRegistry.Events/ContactgegevenWerdGewijzigd.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace AssociationRegistry.Events;


using Vereniging;

public record ContactgegevenWerdGewijzigd(
int ContactgegevenId,
string Contactgegeventype,
string Waarde,
string Beschrijving,
bool IsPrimair) : IEvent
{

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;

using System.Runtime.Serialization;
using Vereniging;
using Vereniging.Bronnen;
Expand All @@ -15,10 +15,4 @@ public record ContactgegevenWerdGewijzigdInKbo(
public Bron Bron
=> Bron.KBO;

public static ContactgegevenWerdGewijzigdInKbo With(Contactgegeven contactgegeven, ContactgegeventypeVolgensKbo typeVolgensKbo)
=> new(
contactgegeven.ContactgegevenId,
contactgegeven.Contactgegeventype,
typeVolgensKbo.Waarde,
contactgegeven.Waarde);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;

using System.Runtime.Serialization;
using Vereniging;
using Vereniging.Bronnen;
Expand All @@ -15,10 +15,5 @@ public record ContactgegevenWerdInBeheerGenomenDoorKbo(
public Bron Bron
=> Bron.KBO;

public static ContactgegevenWerdInBeheerGenomenDoorKbo With(Contactgegeven contactgegeven, ContactgegeventypeVolgensKbo typeVolgensKbo)
=> new(
contactgegeven.ContactgegevenId,
contactgegeven.Contactgegeventype,
typeVolgensKbo.Waarde,
contactgegeven.Waarde);

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;

using System.Runtime.Serialization;
using Vereniging;
using Vereniging.Bronnen;
Expand All @@ -15,10 +15,5 @@ public record ContactgegevenWerdOvergenomenUitKBO(
public Bron Bron
=> Bron.KBO;

public static ContactgegevenWerdOvergenomenUitKBO With(Contactgegeven contactgegeven, ContactgegeventypeVolgensKbo typeVolgensKbo)
=> new(
contactgegeven.ContactgegevenId,
contactgegeven.Contactgegeventype,
typeVolgensKbo.Waarde,
contactgegeven.Waarde);

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;

using System.Runtime.Serialization;
using Vereniging;
using Vereniging.Bronnen;
Expand All @@ -16,11 +16,5 @@ public record ContactgegevenWerdToegevoegd(
public Bron Bron
=> Bron.Initiator;

public static ContactgegevenWerdToegevoegd With(Contactgegeven contactgegeven)
=> new(
contactgegeven.ContactgegevenId,
contactgegeven.Contactgegeventype,
contactgegeven.Waarde,
contactgegeven.Beschrijving,
contactgegeven.IsPrimair);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace AssociationRegistry.Events;


using Vereniging;

public record ContactgegevenWerdVerwijderd(int ContactgegevenId, string Type, string Waarde, string Beschrijving, bool IsPrimair) : IEvent
{

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;

using System.Runtime.Serialization;
using Vereniging;
using Vereniging.Bronnen;
Expand All @@ -15,10 +15,5 @@ public record ContactgegevenWerdVerwijderdUitKBO(
public Bron Bron
=> Bron.KBO;

public static ContactgegevenWerdVerwijderdUitKBO With(Contactgegeven contactgegeven)
=> new(
contactgegeven.ContactgegevenId,
contactgegeven.Contactgegeventype,
contactgegeven.TypeVolgensKbo!.Waarde,
contactgegeven.Waarde);

}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
namespace AssociationRegistry.Events;

using Framework;

using Vereniging;

public record DoelgroepWerdGewijzigd(Registratiedata.Doelgroep Doelgroep) : IEvent
{
public static DoelgroepWerdGewijzigd With(Doelgroep doelgroep)
=> new(Registratiedata.Doelgroep.With(doelgroep));

}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
namespace AssociationRegistry.Events;

using Framework;

using Vereniging;

public record EinddatumWerdGewijzigd(DateOnly Einddatum) : IEvent
{
public static EinddatumWerdGewijzigd With(Datum datum)
=> new(datum.Value);

}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;

using System.Runtime.Serialization;
using Vereniging.Bronnen;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace AssociationRegistry.Events;


using Vereniging;

public record HoofdactiviteitenVerenigingsloketWerdenGewijzigd(
Registratiedata.HoofdactiviteitVerenigingsloket[] HoofdactiviteitenVerenigingsloket) : IEvent
{

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace AssociationRegistry.Framework;
namespace AssociationRegistry.Events;

/// <summary>
/// marker interface: do not add logic
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace AssociationRegistry.Events;

using Framework;


public record KorteBeschrijvingWerdGewijzigd(string VCode, string KorteBeschrijving) : IEvent;
public record RoepnaamWerdGewijzigd(string Roepnaam) : IEvent;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace AssociationRegistry.Events;

using Framework;


public record KorteNaamWerdGewijzigd(string VCode, string KorteNaam) : IEvent;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
namespace AssociationRegistry.Events;

using Framework;


public record KorteNaamWerdGewijzigdInKbo(string? KorteNaam) : IEvent;
9 changes: 9 additions & 0 deletions src/AssociationRegistry.Events/LidmaatschapWerdGewijzigd.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace AssociationRegistry.Events;


using Vereniging;

public record LidmaatschapWerdGewijzigd(string VCode, Registratiedata.Lidmaatschap Lidmaatschap) : IEvent
{

}
9 changes: 9 additions & 0 deletions src/AssociationRegistry.Events/LidmaatschapWerdToegevoegd.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace AssociationRegistry.Events;


using Vereniging;

public record LidmaatschapWerdToegevoegd(string VCode, Registratiedata.Lidmaatschap Lidmaatschap) : IEvent
{

}
Loading

0 comments on commit ceefc2e

Please sign in to comment.