-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added custom Inbox/Outbox implementation using Quartz.NET (changed migrations) * refactored modules (module and module with endpoints), added notifications module * fixed dependency tests * fixed configurations (MassTransit) * added endpoint group builder and refactored endpoints * added waiting for integrating event handling in E2E tests * updated packages * refactoring (namespaces, typos ...) * additional fixes
- Loading branch information
1 parent
7b0ce37
commit c80e541
Showing
151 changed files
with
2,298 additions
and
1,343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
docker run -d --name mm-rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3-management | ||
docker run -d --name mm-rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3.13.1-management | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
docker run -d --name mm-rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq | ||
docker run -d --name mm-rabbitmq -p 5672:5672 -p 15672:15672 rabbitmq:3.13.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
docker run --name mm-postgres -e POSTGRES_PASSWORD=devpass -p 5432:5432 -d postgres | ||
docker run --name mm-postgres -e POSTGRES_PASSWORD=devpass -p 5432:5432 -d postgres:16.2 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
src/Common/TeamUp.Common.Application/IIntegrationEventHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
using RailwayResult; | ||
|
||
using TeamUp.Domain.Abstractions; | ||
using TeamUp.Common.Contracts; | ||
|
||
namespace TeamUp.Common.Application; | ||
|
||
public interface IIntegrationEventHandler<TIntegrationEvent> where TIntegrationEvent : class, IIntegrationEvent | ||
public interface IIntegrationEventHandlerMarker; | ||
|
||
public interface IIntegrationEventHandler<TIntegrationEvent> : IIntegrationEventHandlerMarker where TIntegrationEvent : class, IIntegrationEvent | ||
{ | ||
public Task<Result> Handle(TIntegrationEvent integrationEvent, CancellationToken ct); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
using RailwayResult; | ||
|
||
using TeamUp.Common.Contracts; | ||
|
||
namespace TeamUp.Common.Application; | ||
|
||
public interface IUnitOfWork | ||
public interface IUnitOfWork<TModuleId> where TModuleId : IModuleId | ||
{ | ||
public Task<Result> SaveChangesAsync(CancellationToken ct = default); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
namespace TeamUp.Domain.Abstractions; | ||
namespace TeamUp.Common.Contracts; | ||
|
||
public interface IIntegrationEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace TeamUp.Common.Contracts; | ||
|
||
public interface IModuleId | ||
{ | ||
public static abstract string ModuleName { get; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
src/Common/TeamUp.Common.Domain/IIntegrationEventPublisher.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using TeamUp.Common.Contracts; | ||
|
||
namespace TeamUp.Common.Domain; | ||
|
||
public interface IIntegrationEventPublisher<TModuleId> where TModuleId : IModuleId | ||
{ | ||
public void Publish<TEvent>(TEvent integrationEvent) where TEvent : class, IIntegrationEvent; | ||
} |
21 changes: 0 additions & 21 deletions
21
src/Common/TeamUp.Common.Endpoints/ComplexEndpointGroup.cs
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
61 changes: 61 additions & 0 deletions
61
src/Common/TeamUp.Common.Endpoints/EndpointGroupBuilder.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
using Microsoft.AspNetCore.Builder; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Routing; | ||
|
||
namespace TeamUp.Common.Endpoints; | ||
|
||
public sealed class EndpointGroupBuilder | ||
{ | ||
public RouteGroupBuilder Group { get; private set; } | ||
|
||
private readonly List<EndpointGroupBuilder> _subGroups = []; | ||
|
||
public EndpointGroupBuilder(RouteGroupBuilder group) | ||
{ | ||
Group = group; | ||
} | ||
|
||
public EndpointGroupBuilder WithTags(params string[] tags) | ||
{ | ||
foreach (var group in _subGroups) | ||
{ | ||
group.Group.WithTags(tags); | ||
} | ||
|
||
return this; | ||
} | ||
|
||
public EndpointGroupBuilder AddEndpoint<TEndpoint>() where TEndpoint : IEndpoint, new() | ||
{ | ||
var endpoint = new TEndpoint(); | ||
endpoint.MapEndpoint(Group); | ||
return this; | ||
} | ||
|
||
public EndpointGroupBuilder Configure(Func<RouteGroupBuilder, RouteGroupBuilder> configureGroup) | ||
{ | ||
Group = configureGroup(Group); | ||
return this; | ||
} | ||
|
||
public EndpointGroupBuilder CreateGroup([StringSyntax("Route")] string prefix, Action<EndpointGroupBuilder> configureGroup) | ||
{ | ||
var newGroup = Group.MapGroup(prefix); | ||
|
||
var newEndpointGroup = new EndpointGroupBuilder(newGroup); | ||
configureGroup(newEndpointGroup); | ||
_subGroups.Add(newEndpointGroup); | ||
|
||
return this; | ||
} | ||
|
||
public EndpointGroupBuilder MapGroup<TEndpointGroup>() where TEndpointGroup : IEndpointGroup, new() | ||
{ | ||
var group = new TEndpointGroup(); | ||
group.MapEndpoints(this); | ||
|
||
return this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
using Microsoft.AspNetCore.Routing; | ||
|
||
namespace TeamUp.Common.Endpoints; | ||
namespace TeamUp.Common.Endpoints; | ||
|
||
public interface IEndpointGroup | ||
{ | ||
public RouteGroupBuilder MapEndpoints(RouteGroupBuilder group); | ||
public EndpointGroupBuilder MapEndpoints(EndpointGroupBuilder group); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
src/Common/TeamUp.Common.Endpoints/RouteGroupBuilderExtensions.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
src/Common/TeamUp.Common.Infrastructure/Extensions/ModelBuilderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
|
||
using TeamUp.Common.Infrastructure.Processing.Inbox; | ||
using TeamUp.Common.Infrastructure.Processing.Outbox; | ||
|
||
namespace TeamUp.Common.Infrastructure.Extensions; | ||
|
||
public static class ModelBuilderExtensions | ||
{ | ||
public static void ConfigureOutbox(this ModelBuilder builder) | ||
{ | ||
builder.Entity<OutboxMessage>() | ||
.ToTable("OutboxMessages") | ||
.HasKey(m => m.Id); | ||
|
||
builder.Entity<InboxMessage>() | ||
.ToTable("InboxMessages") | ||
.HasKey(m => m.Id); | ||
} | ||
} |
Oops, something went wrong.