feat: ajustes, refinamentos e code cleanup
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.30114.105
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
@@ -17,8 +16,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{DFB189FE
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shop.UnitTests", "tests\Shop.UnitTests\Shop.UnitTests.csproj", "{D957E297-38EA-402F-B603-25F3EC156E18}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shop.IntegrationTests", "tests\Shop.IntegrationTests\Shop.IntegrationTests.csproj", "{8EF0E054-F77D-4C6D-9102-565887855766}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Shop.PublicApi", "src\Shop.PublicApi\Shop.PublicApi.csproj", "{E94C4296-DC64-4C22-87A1-B5A054FAADAC}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1DAF7B63-F776-4466-908D-56FD1FD02F42}"
|
||||
@@ -60,10 +57,6 @@ Global
|
||||
{D957E297-38EA-402F-B603-25F3EC156E18}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D957E297-38EA-402F-B603-25F3EC156E18}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D957E297-38EA-402F-B603-25F3EC156E18}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{8EF0E054-F77D-4C6D-9102-565887855766}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{8EF0E054-F77D-4C6D-9102-565887855766}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{8EF0E054-F77D-4C6D-9102-565887855766}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{8EF0E054-F77D-4C6D-9102-565887855766}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{E94C4296-DC64-4C22-87A1-B5A054FAADAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{E94C4296-DC64-4C22-87A1-B5A054FAADAC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{E94C4296-DC64-4C22-87A1-B5A054FAADAC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
@@ -75,7 +68,6 @@ Global
|
||||
{7FDA8D84-9E01-4424-872E-ABAABC3965A9} = {8011CDDD-0814-4C74-9B74-C3E3365D50CC}
|
||||
{11296DB2-D948-4ADF-A4CE-3F2BFF627478} = {8011CDDD-0814-4C74-9B74-C3E3365D50CC}
|
||||
{D957E297-38EA-402F-B603-25F3EC156E18} = {DFB189FE-F11B-46EA-A5CD-3571CEC8193A}
|
||||
{8EF0E054-F77D-4C6D-9102-565887855766} = {DFB189FE-F11B-46EA-A5CD-3571CEC8193A}
|
||||
{E94C4296-DC64-4C22-87A1-B5A054FAADAC} = {8011CDDD-0814-4C74-9B74-C3E3365D50CC}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -3,6 +3,9 @@ using Shop.Core.Abstractions;
|
||||
|
||||
namespace Shop.Core.Events;
|
||||
|
||||
/// <summary>
|
||||
/// A classe de armazenamento de evento.
|
||||
/// </summary>
|
||||
public class EventStore : BaseDomainEvent
|
||||
{
|
||||
public EventStore(string type, string data)
|
||||
@@ -13,6 +16,9 @@ public class EventStore : BaseDomainEvent
|
||||
|
||||
private EventStore() { }
|
||||
|
||||
/// <summary>
|
||||
/// ID do evento.
|
||||
/// </summary>
|
||||
public Guid Id { get; private init; } = Guid.NewGuid();
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3,7 +3,14 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace Shop.Core.Events;
|
||||
|
||||
/// <summary>
|
||||
/// Repositório de armazenamento de eventos.
|
||||
/// </summary>
|
||||
public interface IEventStoreRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// Salva uma lista de eventos.
|
||||
/// </summary>
|
||||
/// <param name="eventStores">A lista de eventos.</param>
|
||||
Task InsertManyAsync(IEnumerable<EventStore> eventStores);
|
||||
}
|
||||
@@ -32,7 +32,7 @@ public class Customer : BaseEntity, IAggregateRoot
|
||||
AddDomainEvent(new CustomerCreatedEvent(Id, firstName, lastName, gender, email.Address, dateOfBirth));
|
||||
}
|
||||
|
||||
public Customer() { } // ORM
|
||||
private Customer() { }
|
||||
|
||||
/// <summary>
|
||||
/// Primeiro Nome.
|
||||
|
||||
@@ -1,49 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<IsPackable>false</IsPackable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="coverlet.collector" Version="3.2.0">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="coverlet.msbuild" Version="3.2.0">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="FluentAssertions" Version="6.10.0" />
|
||||
<PackageReference Include="FluentAssertions.Analyzers" Version="0.17.2">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.3" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.4.1" />
|
||||
<PackageReference Include="Moq" Version="4.18.4" />
|
||||
<PackageReference Include="Moq.Analyzers" Version="0.0.9">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="xunit" Version="2.4.2" />
|
||||
<PackageReference Include="xunit.analyzers" Version="1.1.0" />
|
||||
<PackageReference Include="xunit.categories" Version="2.0.6" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\src\Shop.PublicApi\Shop.PublicApi.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="xunit.runner.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json",
|
||||
"diagnosticMessages": true,
|
||||
"parallelizeAssembly": true,
|
||||
"parallelizeTestCollections": true,
|
||||
"preEnumerateTheories": true
|
||||
}
|
||||
Reference in New Issue
Block a user