Skip to content

Commit

Permalink
Project structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jezzsantos committed Jun 11, 2024
1 parent 6b1fda1 commit 02eac1a
Show file tree
Hide file tree
Showing 36 changed files with 808 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/ApiHost1/ApiHost1.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<ProjectReference Include="..\ImagesInfrastructure\ImagesInfrastructure.csproj" />
<ProjectReference Include="..\Infrastructure.Web.Hosting.Common\Infrastructure.Web.Hosting.Common.csproj" />
<ProjectReference Include="..\OrganizationsInfrastructure\OrganizationsInfrastructure.csproj" />
<ProjectReference Include="..\SubscriptionsInfrastructure\SubscriptionsInfrastructure.csproj" />
<ProjectReference Include="..\UserProfilesInfrastructure\UserProfilesInfrastructure.csproj" />
</ItemGroup>

Expand Down
2 changes: 2 additions & 0 deletions src/ApiHost1/HostedModules.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using ImagesInfrastructure;
using Infrastructure.Web.Hosting.Common;
using OrganizationsInfrastructure;
using SubscriptionsInfrastructure;
using UserProfilesInfrastructure;

namespace ApiHost1;
Expand All @@ -21,6 +22,7 @@ public static SubdomainModules Get()
modules.Register(new UserProfilesModule());
modules.Register(new EndUsersModule());
modules.Register(new OrganizationsModule());
modules.Register(new SubscriptionsModule());
modules.Register(new IdentityModule());
modules.Register(new EventNotificationsModule());
modules.Register(new AncillaryModule());
Expand Down
5 changes: 5 additions & 0 deletions src/Application.Services.Shared/ISubscriptionsService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace Application.Services.Shared;

public interface ISubscriptionsService
{
}
21 changes: 21 additions & 0 deletions src/Domain.Events.Shared/Subscriptions/Created.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using Domain.Common;
using Domain.Common.ValueObjects;
using JetBrains.Annotations;

namespace Domain.Events.Shared.Subscriptions;

public sealed class Created : DomainEvent
{
public Created(Identifier id) : base(id)
{
}

[UsedImplicitly]
public Created()
{
}

public required string CreatedById { get; set; }

public required string OrganizationId { get; set; }
}
66 changes: 66 additions & 0 deletions src/SaaStack.sln
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,22 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventNotificationsApplicati
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Infrastructure.Hosting.Common.UnitTests", "Infrastructure.Hosting.Common.UnitTests\Infrastructure.Hosting.Common.UnitTests.csproj", "{C85713CE-CFEC-4A47-8A2E-B9FAAC20EB72}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubscriptionsInfrastructure", "SubscriptionsInfrastructure\SubscriptionsInfrastructure.csproj", "{AC4B3281-7555-4CDD-9574-96B73D2414D0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubscriptionsApplication", "SubscriptionsApplication\SubscriptionsApplication.csproj", "{00E15D5F-CECF-4B2C-8C88-FCC526DB9EED}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubscriptionsDomain", "SubscriptionsDomain\SubscriptionsDomain.csproj", "{EB8FC27F-3138-4311-BF55-0590019ED5A1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{1A2524F5-09D6-4774-A585-96DBAC6E9CAE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubscriptionsDomain.UnitTests", "SubscriptionsDomain.UnitTests\SubscriptionsDomain.UnitTests.csproj", "{687C172C-1B65-476F-B951-DD82E3C9CB69}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubscriptionsApplication.UnitTests", "SubscriptionsApplication.UnitTests\SubscriptionsApplication.UnitTests.csproj", "{BCD2C514-FEE5-4B06-9A80-A0908AB4BC8E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubscriptionsInfrastructure.UnitTests", "SubscriptionsInfrastructure.UnitTests\SubscriptionsInfrastructure.UnitTests.csproj", "{06282A09-852B-4628-988B-D0379FDFC4E1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SubscriptionsInfrastructure.IntegrationTests", "SubscriptionsInfrastructure.IntegrationTests\SubscriptionsInfrastructure.IntegrationTests.csproj", "{90055376-3EB3-4AFD-B413-1CE6EC1CC909}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1211,6 +1227,48 @@ Global
{C85713CE-CFEC-4A47-8A2E-B9FAAC20EB72}.Release|Any CPU.Build.0 = Release|Any CPU
{C85713CE-CFEC-4A47-8A2E-B9FAAC20EB72}.ReleaseForDeploy|Any CPU.ActiveCfg = ReleaseForDeploy|Any CPU
{C85713CE-CFEC-4A47-8A2E-B9FAAC20EB72}.ReleaseForDeploy|Any CPU.Build.0 = ReleaseForDeploy|Any CPU
{AC4B3281-7555-4CDD-9574-96B73D2414D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC4B3281-7555-4CDD-9574-96B73D2414D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC4B3281-7555-4CDD-9574-96B73D2414D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC4B3281-7555-4CDD-9574-96B73D2414D0}.Release|Any CPU.Build.0 = Release|Any CPU
{AC4B3281-7555-4CDD-9574-96B73D2414D0}.ReleaseForDeploy|Any CPU.ActiveCfg = ReleaseForDeploy|Any CPU
{AC4B3281-7555-4CDD-9574-96B73D2414D0}.ReleaseForDeploy|Any CPU.Build.0 = ReleaseForDeploy|Any CPU
{00E15D5F-CECF-4B2C-8C88-FCC526DB9EED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00E15D5F-CECF-4B2C-8C88-FCC526DB9EED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00E15D5F-CECF-4B2C-8C88-FCC526DB9EED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00E15D5F-CECF-4B2C-8C88-FCC526DB9EED}.Release|Any CPU.Build.0 = Release|Any CPU
{00E15D5F-CECF-4B2C-8C88-FCC526DB9EED}.ReleaseForDeploy|Any CPU.ActiveCfg = ReleaseForDeploy|Any CPU
{00E15D5F-CECF-4B2C-8C88-FCC526DB9EED}.ReleaseForDeploy|Any CPU.Build.0 = ReleaseForDeploy|Any CPU
{EB8FC27F-3138-4311-BF55-0590019ED5A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB8FC27F-3138-4311-BF55-0590019ED5A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB8FC27F-3138-4311-BF55-0590019ED5A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB8FC27F-3138-4311-BF55-0590019ED5A1}.Release|Any CPU.Build.0 = Release|Any CPU
{EB8FC27F-3138-4311-BF55-0590019ED5A1}.ReleaseForDeploy|Any CPU.ActiveCfg = ReleaseForDeploy|Any CPU
{EB8FC27F-3138-4311-BF55-0590019ED5A1}.ReleaseForDeploy|Any CPU.Build.0 = ReleaseForDeploy|Any CPU
{687C172C-1B65-476F-B951-DD82E3C9CB69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{687C172C-1B65-476F-B951-DD82E3C9CB69}.Debug|Any CPU.Build.0 = Debug|Any CPU
{687C172C-1B65-476F-B951-DD82E3C9CB69}.Release|Any CPU.ActiveCfg = Release|Any CPU
{687C172C-1B65-476F-B951-DD82E3C9CB69}.Release|Any CPU.Build.0 = Release|Any CPU
{687C172C-1B65-476F-B951-DD82E3C9CB69}.ReleaseForDeploy|Any CPU.ActiveCfg = ReleaseForDeploy|Any CPU
{687C172C-1B65-476F-B951-DD82E3C9CB69}.ReleaseForDeploy|Any CPU.Build.0 = ReleaseForDeploy|Any CPU
{BCD2C514-FEE5-4B06-9A80-A0908AB4BC8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BCD2C514-FEE5-4B06-9A80-A0908AB4BC8E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BCD2C514-FEE5-4B06-9A80-A0908AB4BC8E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BCD2C514-FEE5-4B06-9A80-A0908AB4BC8E}.Release|Any CPU.Build.0 = Release|Any CPU
{BCD2C514-FEE5-4B06-9A80-A0908AB4BC8E}.ReleaseForDeploy|Any CPU.ActiveCfg = ReleaseForDeploy|Any CPU
{BCD2C514-FEE5-4B06-9A80-A0908AB4BC8E}.ReleaseForDeploy|Any CPU.Build.0 = ReleaseForDeploy|Any CPU
{06282A09-852B-4628-988B-D0379FDFC4E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06282A09-852B-4628-988B-D0379FDFC4E1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06282A09-852B-4628-988B-D0379FDFC4E1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06282A09-852B-4628-988B-D0379FDFC4E1}.Release|Any CPU.Build.0 = Release|Any CPU
{06282A09-852B-4628-988B-D0379FDFC4E1}.ReleaseForDeploy|Any CPU.ActiveCfg = ReleaseForDeploy|Any CPU
{06282A09-852B-4628-988B-D0379FDFC4E1}.ReleaseForDeploy|Any CPU.Build.0 = ReleaseForDeploy|Any CPU
{90055376-3EB3-4AFD-B413-1CE6EC1CC909}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90055376-3EB3-4AFD-B413-1CE6EC1CC909}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90055376-3EB3-4AFD-B413-1CE6EC1CC909}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90055376-3EB3-4AFD-B413-1CE6EC1CC909}.Release|Any CPU.Build.0 = Release|Any CPU
{90055376-3EB3-4AFD-B413-1CE6EC1CC909}.ReleaseForDeploy|Any CPU.ActiveCfg = ReleaseForDeploy|Any CPU
{90055376-3EB3-4AFD-B413-1CE6EC1CC909}.ReleaseForDeploy|Any CPU.Build.0 = ReleaseForDeploy|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{F5C77A86-38AF-40E4-82FC-617E624B2754} = {508E7DA4-4DF2-4201-955D-CCF70C41AD05}
Expand Down Expand Up @@ -1393,5 +1451,13 @@ Global
{41729001-D63B-4C95-AAE7-AC976EC306D2} = {E15AB9C5-C0F1-471D-BFC3-72ED133C4470}
{E1D4D16F-9F16-4EF7-8893-A43446EC1653} = {E15AB9C5-C0F1-471D-BFC3-72ED133C4470}
{C85713CE-CFEC-4A47-8A2E-B9FAAC20EB72} = {F561CAF6-2A8C-4440-B12E-7753F25D9879}
{AC4B3281-7555-4CDD-9574-96B73D2414D0} = {124D8FF5-43D1-4019-B07C-7F55DC4A1807}
{00E15D5F-CECF-4B2C-8C88-FCC526DB9EED} = {124D8FF5-43D1-4019-B07C-7F55DC4A1807}
{EB8FC27F-3138-4311-BF55-0590019ED5A1} = {124D8FF5-43D1-4019-B07C-7F55DC4A1807}
{1A2524F5-09D6-4774-A585-96DBAC6E9CAE} = {124D8FF5-43D1-4019-B07C-7F55DC4A1807}
{687C172C-1B65-476F-B951-DD82E3C9CB69} = {1A2524F5-09D6-4774-A585-96DBAC6E9CAE}
{BCD2C514-FEE5-4B06-9A80-A0908AB4BC8E} = {1A2524F5-09D6-4774-A585-96DBAC6E9CAE}
{06282A09-852B-4628-988B-D0379FDFC4E1} = {1A2524F5-09D6-4774-A585-96DBAC6E9CAE}
{90055376-3EB3-4AFD-B413-1CE6EC1CC909} = {1A2524F5-09D6-4774-A585-96DBAC6E9CAE}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Application.Interfaces\Application.Interfaces.csproj" />
<ProjectReference Include="..\SubscriptionsApplication\SubscriptionsApplication.csproj" />
<ProjectReference Include="..\UnitTesting.Common\UnitTesting.Common.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Xunit;

namespace SubscriptionsApplication.UnitTests;

[Trait("Category", "Unit")]
public class SubscriptionsApplicationSpec
{
//TODO: type testm or testma to create a new test method
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Application.Services.Shared;

namespace SubscriptionsApplication.ApplicationServices;

public class SubscriptionsInProcessServiceClient : ISubscriptionsService
{
private readonly ISubscriptionsApplication _subscriptionsApplication;

public SubscriptionsInProcessServiceClient(ISubscriptionsApplication subscriptionsApplication)
{
_subscriptionsApplication = subscriptionsApplication;
}
}
5 changes: 5 additions & 0 deletions src/SubscriptionsApplication/ISubscriptionsApplication.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace SubscriptionsApplication;

public interface ISubscriptionsApplication
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace SubscriptionsApplication.Persistence;

public interface ISubscriptionRepository
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Application.Persistence.Common;
using Common;
using QueryAny;

namespace SubscriptionsApplication.Persistence.ReadModels;

[EntityName("Subscription")]
public class Subscription : ReadModelEntity
{
public Optional<string> CreatedById { get; set; }
}
5 changes: 5 additions & 0 deletions src/SubscriptionsApplication/SubscriptionsApplication.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace SubscriptionsApplication;

public class SubscriptionsApplication : ISubscriptionsApplication
{
}
18 changes: 18 additions & 0 deletions src/SubscriptionsApplication/SubscriptionsApplication.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleToAttribute">
<_Parameter1>$(AssemblyName).UnitTests</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Application.Persistence.Common\Application.Persistence.Common.csproj" />
<ProjectReference Include="..\SubscriptionsDomain\SubscriptionsDomain.csproj" />
</ItemGroup>

</Project>
9 changes: 9 additions & 0 deletions src/SubscriptionsDomain.UnitTests/SubscriptionRootSpec.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Xunit;

namespace SubscriptionsDomain.UnitTests;

[Trait("Category", "Unit")]
public class SubscriptionRootSpec
{
//TODO: type testm or testma to create a new test method
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Application.Interfaces\Application.Interfaces.csproj" />
<ProjectReference Include="..\SubscriptionsDomain\SubscriptionsDomain.csproj" />
<ProjectReference Include="..\UnitTesting.Common\UnitTesting.Common.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
</ItemGroup>

</Project>
16 changes: 16 additions & 0 deletions src/SubscriptionsDomain/Events.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Domain.Common.ValueObjects;
using Domain.Events.Shared.Subscriptions;

namespace SubscriptionsDomain;

public static class Events
{
public static Created Created(Identifier id, Identifier organizationId, Identifier createdBy)
{
return new Created(id)
{
OrganizationId = organizationId,
CreatedById = createdBy
};
}
}
62 changes: 62 additions & 0 deletions src/SubscriptionsDomain/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 27 additions & 0 deletions src/SubscriptionsDomain/Resources.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>

<root>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"
id="root"
xmlns="">
<xsd:element name="root" msdata:IsDataSet="true">

</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
</value>
</resheader>
</root>
Loading

0 comments on commit 02eac1a

Please sign in to comment.