Skip to content

Commit edfd3c1

Browse files
Merge pull request #144 from TransactionProcessing/task/#142_aggregaterefatoring
Completed refactor of aggregates to records, other nuget updates
2 parents cd37824 + ec3ee20 commit edfd3c1

File tree

17 files changed

+409
-578
lines changed

17 files changed

+409
-578
lines changed

MessagingService.BusinessLogic.Tests/MessagingService.BusinessLogic.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Lamar" Version="10.0.1" />
11-
<PackageReference Include="Moq" Version="4.18.2" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
13-
<PackageReference Include="Shouldly" Version="4.1.0" />
10+
<PackageReference Include="Lamar" Version="12.0.0" />
11+
<PackageReference Include="Moq" Version="4.18.4" />
12+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
13+
<PackageReference Include="Shouldly" Version="4.2.1" />
1414
<PackageReference Include="xunit" Version="2.4.2" />
1515
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
1616
<PrivateAssets>all</PrivateAssets>
1717
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1818
</PackageReference>
19-
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
19+
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2222
</PackageReference>

MessagingService.BusinessLogic/MessagingService.BusinessLogic.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
</ItemGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="NLog.Extensions.Logging" Version="5.1.0" />
13-
<PackageReference Include="MediatR" Version="11.0.0" />
14-
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.0" />
15-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
16-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
17-
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="6.0.2" />
12+
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.0" />
13+
<PackageReference Include="MediatR" Version="12.0.1" />
14+
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="7.0.5" />
15+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.5" />
16+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.5" />
17+
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="7.0.0" />
1818
</ItemGroup>
1919

2020
<ItemGroup>
Lines changed: 22 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,21 @@
1-
namespace MessagingService.BusinessLogic.RequestHandlers
2-
{
3-
using System;
1+
namespace MessagingService.BusinessLogic.RequestHandlers{
42
using System.Collections.Generic;
53
using System.Threading;
64
using System.Threading.Tasks;
75
using MediatR;
86
using Requests;
97
using Services;
108
using EmailAttachment = Models.EmailAttachment;
9+
using FileType = Models.FileType;
1110

1211
/// <summary>
1312
///
1413
/// </summary>
1514
/// <seealso cref="MediatR.IRequestHandler{MessagingService.BusinessLogic.Requests.SendEmailRequest, System.String}" />
16-
public class MessagingRequestHandler : IRequestHandler<SendEmailRequest>,
15+
public class MessagingRequestHandler : IRequestHandler<SendEmailRequest>,
1716
IRequestHandler<SendSMSRequest>,
1817
IRequestHandler<ResendEmailRequest>,
19-
IRequestHandler<ResendSMSRequest>
20-
{
18+
IRequestHandler<ResendSMSRequest>{
2119
#region Fields
2220

2321
/// <summary>
@@ -33,8 +31,7 @@ public class MessagingRequestHandler : IRequestHandler<SendEmailRequest>,
3331
/// Initializes a new instance of the <see cref="MessagingRequestHandler" /> class.
3432
/// </summary>
3533
/// <param name="messagingDomainService">The messaging domain service.</param>
36-
public MessagingRequestHandler(IMessagingDomainService messagingDomainService)
37-
{
34+
public MessagingRequestHandler(IMessagingDomainService messagingDomainService){
3835
this.MessagingDomainService = messagingDomainService;
3936
}
4037

@@ -50,9 +47,9 @@ public MessagingRequestHandler(IMessagingDomainService messagingDomainService)
5047
/// <returns>
5148
/// Response from the request
5249
/// </returns>
53-
public async Task<Unit> Handle(SendEmailRequest request,
54-
CancellationToken cancellationToken){
55-
List<EmailAttachment> attachments = new List<Models.EmailAttachment>();
50+
public async Task Handle(SendEmailRequest request,
51+
CancellationToken cancellationToken){
52+
List<EmailAttachment> attachments = new List<EmailAttachment>();
5653

5754
foreach (Requests.EmailAttachment requestEmailAttachment in request.EmailAttachments){
5855
attachments.Add(new EmailAttachment{
@@ -61,7 +58,7 @@ public async Task<Unit> Handle(SendEmailRequest request,
6158
Filename = requestEmailAttachment.Filename,
6259
});
6360
}
64-
61+
6562
await this.MessagingDomainService.SendEmailMessage(request.ConnectionIdentifier,
6663
request.MessageId,
6764
request.FromAddress,
@@ -71,46 +68,36 @@ await this.MessagingDomainService.SendEmailMessage(request.ConnectionIdentifier,
7168
request.IsHtml,
7269
attachments,
7370
cancellationToken);
74-
75-
return Unit.Value;
7671
}
7772

78-
public async Task<Unit> Handle(SendSMSRequest request,
79-
CancellationToken cancellationToken)
80-
{
73+
public async Task Handle(SendSMSRequest request,
74+
CancellationToken cancellationToken){
8175
await this.MessagingDomainService.SendSMSMessage(request.ConnectionIdentifier,
8276
request.MessageId,
8377
request.Sender,
8478
request.Destination,
8579
request.Message,
8680
cancellationToken);
87-
return Unit.Value;
8881
}
8982

90-
#endregion
91-
92-
public async Task<Unit> Handle(ResendEmailRequest request,
93-
CancellationToken cancellationToken) {
83+
public async Task Handle(ResendEmailRequest request,
84+
CancellationToken cancellationToken){
9485
await this.MessagingDomainService.ResendEmailMessage(request.ConnectionIdentifier, request.MessageId, cancellationToken);
86+
}
9587

96-
return Unit.Value;
88+
public async Task Handle(ResendSMSRequest request, CancellationToken cancellationToken){
89+
await this.MessagingDomainService.ResendSMSMessage(request.ConnectionIdentifier, request.MessageId, cancellationToken);
9790
}
9891

99-
private Models.FileType ConvertFileType(FileType emailAttachmentFileType)
100-
{
101-
switch (emailAttachmentFileType)
102-
{
103-
case FileType.PDF:
104-
return Models.FileType.PDF;
92+
private FileType ConvertFileType(Requests.FileType emailAttachmentFileType){
93+
switch(emailAttachmentFileType){
94+
case Requests.FileType.PDF:
95+
return FileType.PDF;
10596
default:
106-
return Models.FileType.None;
97+
return FileType.None;
10798
}
10899
}
109100

110-
public async Task<Unit> Handle(ResendSMSRequest request, CancellationToken cancellationToken){
111-
await this.MessagingDomainService.ResendSMSMessage(request.ConnectionIdentifier, request.MessageId, cancellationToken);
112-
113-
return Unit.Value;
114-
}
101+
#endregion
115102
}
116103
}

MessagingService.Client/MessagingService.Client.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
</PropertyGroup>
77

88
<ItemGroup>
9-
<PackageReference Include="ClientProxyBase" Version="2023.1.0" />
10-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
9+
<PackageReference Include="ClientProxyBase" Version="2023.6.1" />
10+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1111
</ItemGroup>
1212

1313
<ItemGroup>

MessagingService.DataTransferObjects/MessagingService.DataTransferObjects.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
12+
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1313
</ItemGroup>
1414

1515
</Project>

MessagingService.EmailAggregate.Tests/MessagingService.EmailAggregate.Tests.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.0" />
11-
<PackageReference Include="Shared.EventStore" Version="2023.1.0" />
12-
<PackageReference Include="Shouldly" Version="4.1.0" />
10+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.2" />
11+
<PackageReference Include="Shared.EventStore" Version="2023.6.1" />
12+
<PackageReference Include="Shouldly" Version="4.2.1" />
1313
<PackageReference Include="xunit" Version="2.4.2" />
1414
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
1515
<PrivateAssets>all</PrivateAssets>
1616
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1717
</PackageReference>
18-
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
18+
<PackageReference Include="coverlet.msbuild" Version="6.0.0">
1919
<PrivateAssets>all</PrivateAssets>
2020
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2121
</PackageReference>

MessagingService.EmailMessage.DomainEvents/MessagingService.EmailMessage.DomainEvents.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Shared" Version="2023.1.0" />
9-
<PackageReference Include="Shared.DomainDrivenDesign" Version="2023.1.0" />
8+
<PackageReference Include="Shared" Version="2023.6.1" />
9+
<PackageReference Include="Shared.DomainDrivenDesign" Version="2023.6.1" />
1010
</ItemGroup>
1111

1212
</Project>

0 commit comments

Comments
 (0)