├── .github
├── CODEOWNERS
└── dependabot.yml
├── docs
├── _config.yml
├── logo
│ ├── volley-mgmt-logo.ico
│ └── volley-mgmt-logo.jpg
├── index.md
├── adr
│ ├── 0005-use-azure-app-services-for-hosting.md
│ ├── 0002-use-sendgrid-as-mailing-system.md
│ ├── 0003-use-angular-for-spa.md
│ ├── index.md
│ ├── 0000-use-markdown-architectural-decision-records.md
│ └── 0006-use-azure-table-storage-for-persistence.md
├── tournaments
│ └── lviv-it-league-2018.html
└── PRIVACY-POLICY-DEV.md
├── tests
├── unit-tests
│ ├── .artifactignore
│ ├── .gitignore
│ ├── VolleyM.Domain.Framework.UnitTests
│ │ ├── test-config.json
│ │ ├── AssemblyInfo.cs
│ │ ├── Fixture
│ │ │ ├── SampleEvent.cs
│ │ │ ├── MockedHandler.cs
│ │ │ ├── NotNestedHandler.cs
│ │ │ ├── RootNsHandler.cs
│ │ │ ├── NoAttributeHandler.cs
│ │ │ ├── NoEventSupportHandler.cs
│ │ │ ├── NoValidationHandler.cs
│ │ │ ├── SpyEventListener.cs
│ │ │ ├── HandlerWithNullDomainEventsProperty.cs
│ │ │ ├── HandlerWhichDoesNotProduceEvent.cs
│ │ │ ├── TwoInterfacesHandler.cs
│ │ │ ├── SampleHandler.cs
│ │ │ └── SeveralEventsHandler.cs
│ │ ├── AuthorizationHandlerDecorator
│ │ │ └── AuthorizationDecorator.feature
│ │ ├── FeatureManagement
│ │ │ └── FeatureToggleDecorator.feature
│ │ ├── HandlerStructure
│ │ │ └── ValidatorLocator.feature
│ │ ├── IDomainFrameworkTestFixture.cs
│ │ ├── ValidationDecorator
│ │ │ └── ValidationDecorator.feature
│ │ ├── Authorization
│ │ │ └── CheckAccess.feature
│ │ └── EventBroker
│ │ │ └── EventProducerDecorator.feature
│ ├── VolleyM.Infrastructure.EventBroker.UnitTests
│ │ ├── test-config.json
│ │ ├── AssemblyInfo.cs
│ │ ├── Fixture
│ │ │ ├── ContextA
│ │ │ │ ├── EventA.cs
│ │ │ │ ├── EventB.cs
│ │ │ │ ├── EventC.cs
│ │ │ │ ├── EventD.cs
│ │ │ │ ├── EventE.cs
│ │ │ │ ├── EventF.cs
│ │ │ │ ├── EventG.cs
│ │ │ │ ├── EventH.cs
│ │ │ │ ├── EventJ.cs
│ │ │ │ ├── EventI.cs
│ │ │ │ ├── AnotherApplicationService.cs
│ │ │ │ ├── SampleEventAProducingHandler.cs
│ │ │ │ ├── SampleEventBProducingHandler.cs
│ │ │ │ ├── SampleEventCProducingHandler.cs
│ │ │ │ ├── SampleEventDProducingHandler.cs
│ │ │ │ ├── SampleEventEProducingHandler.cs
│ │ │ │ ├── SampleEventFProducingHandler.cs
│ │ │ │ ├── SampleEventGProducingHandler.cs
│ │ │ │ ├── SampleEventHProducingHandler.cs
│ │ │ │ ├── AnotherEventAProducingHandler.cs
│ │ │ │ ├── SampleEventIProducingHandler.cs
│ │ │ │ ├── ScopeAwareApplicationService1.cs
│ │ │ │ ├── ScopeAwareApplicationService2.cs
│ │ │ │ ├── ScopeAwareRequestHandler.cs
│ │ │ │ └── SampleApplicationService.cs
│ │ │ ├── ContextB
│ │ │ │ ├── EventD.cs
│ │ │ │ ├── EventF.cs
│ │ │ │ ├── EventG.cs
│ │ │ │ ├── EventH.cs
│ │ │ │ ├── AnotherApplicationService.cs
│ │ │ │ └── SamplePublicApplicationService.cs
│ │ │ ├── ContextC
│ │ │ │ ├── EventG.cs
│ │ │ │ ├── EventI.cs
│ │ │ │ ├── AnotherApplicationService.cs
│ │ │ │ └── SamplePublicApplicationService.cs
│ │ │ ├── EventBase.cs
│ │ │ ├── IEventProducingRequest.cs
│ │ │ ├── EventInvocationSpy.cs
│ │ │ ├── EventProducingHandlerBase.cs
│ │ │ └── ScopeLitmus.cs
│ │ ├── IEventBrokerTestFixture.cs
│ │ ├── UnitEventBrokerTestFixture.cs
│ │ └── EvenBrokerTestSetup.cs
│ ├── VolleyM.Architecture.UnitTests
│ │ ├── AssemblyInfo.cs
│ │ ├── TypesFixture.cs
│ │ ├── TestExtensions.cs
│ │ └── PackageStructureConditionExtensions.cs
│ ├── VolleyM.Domain.Contributors.UnitTests
│ │ ├── test-config.json
│ │ ├── GetAll
│ │ │ └── Contributors.feature
│ │ ├── IContributorsTestFixture.cs
│ │ ├── UnitContributorsTestFixture.cs
│ │ └── ContributorsTestSetup.cs
│ ├── VolleyM.Domain.UnitTests.Framework
│ │ ├── TestTarget.cs
│ │ ├── TestFixture
│ │ │ ├── ITenantTestFixture.cs
│ │ │ ├── EntityId.cs
│ │ │ ├── IAuthFixture.cs
│ │ │ ├── NoOpOneTimeTestFixture.cs
│ │ │ ├── NoOpTestFixture.cs
│ │ │ ├── TenantTestFixtureBase.cs
│ │ │ └── ITestFixture.cs
│ │ ├── Transforms
│ │ │ ├── ISpecFlowTransform.cs
│ │ │ ├── NoOpSpecFlowTransform.cs
│ │ │ ├── ISpecFlowTransformFactory.cs
│ │ │ ├── SpecFlowTransformFactory.cs
│ │ │ └── Common
│ │ │ │ ├── TenantIdTransform.cs
│ │ │ │ └── Version
│ │ │ │ └── VersionEquivalencyStep.cs
│ │ ├── Constants.cs
│ │ ├── TestSpyEventPublisher.cs
│ │ └── VolleyM.Domain.UnitTests.Framework.csproj
│ ├── VolleyM.Domain.IdentityAndAccess.UnitTests
│ │ ├── Users
│ │ │ ├── GetUser.feature
│ │ │ └── CreateUser.feature
│ │ ├── Fixture
│ │ │ ├── IIdentityAndAccessFixture.cs
│ │ │ ├── IdentityAndAccessFixtureBase.cs
│ │ │ └── AzureCloudIdentityAndAccessOneTimeFixture.cs
│ │ ├── test-config.json
│ │ └── Roles
│ │ │ ├── SystemRoles.feature
│ │ │ └── Role.feature
│ └── VolleyM.Domain.Players.UnitTests
│ │ ├── Fixture
│ │ ├── TestPlayerDto.cs
│ │ └── AzureCloudPlayersOneTimeFixture.cs
│ │ ├── EventAssertionStepsHook.cs
│ │ ├── Transforms
│ │ └── PlayerIdTransform.cs
│ │ ├── test-config.json
│ │ ├── Players
│ │ ├── GetAllPlayers.feature
│ │ └── CreatePlayer.feature
│ │ └── IPlayersTestFixture.cs
└── api-tests
│ ├── extensions.json
│ ├── publish-karate.azcli
│ ├── set-dev-environment.ps1
│ ├── common
│ └── authenticate.feature
│ ├── get-karate.ps1
│ ├── Contributors
│ └── hardcoded-contributors.feature
│ ├── Players
│ └── players.feature
│ └── karate-config.js
├── global.json
├── src
├── Client
│ ├── VolleyM.API.Contributors
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── Contributor.cs
│ │ ├── ContributorsApiMappingProfile.cs
│ │ ├── VolleyM.API.Contributors.csproj
│ │ ├── ContributorsApiAssemblyBootstrapper.cs
│ │ └── ContributorsController.cs
│ ├── VolleyM.API
│ │ ├── volley-mgmt-logo.ico
│ │ ├── CORS
│ │ │ ├── CorsOptions.cs
│ │ │ └── CorsExtensions.cs
│ │ ├── esquio.json
│ │ ├── Constants.cs
│ │ ├── serilog.Development.json
│ │ ├── Authentication
│ │ │ ├── Auth0Options.cs
│ │ │ └── AuthenticationExtensions.cs
│ │ ├── Authorization
│ │ │ ├── DefaultVolleyMAuthorizationRequirement.cs
│ │ │ ├── AuthorizationExtensions.cs
│ │ │ └── VolleyMDefaultAuthorizationHandler.cs
│ │ ├── esquio.Staging.json
│ │ ├── esquio.Development.json
│ │ ├── esquio.Production.json
│ │ ├── VolleyMApiApplicationInfo.cs
│ │ ├── serilog.json
│ │ ├── appsettings.Production.json
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── appsettings.Staging.json
│ │ ├── appsettings.json
│ │ ├── appsettings.Development.json
│ │ ├── Extensions
│ │ │ └── AppPartsExtensions.cs
│ │ └── FeatureManagement
│ │ │ └── ApiFeatureManager.cs
│ ├── VolleyM.API.Players
│ │ ├── Player.cs
│ │ ├── PlayersApiMappingProfile.cs
│ │ ├── VolleyM.API.Players.csproj
│ │ ├── Properties
│ │ │ └── launchSettings.json
│ │ ├── PlayersApiAssemblyBootstrapper.cs
│ │ └── PlayersController.cs
│ └── VolleyM.API.Contracts
│ │ ├── VolleyM.API.Contracts.csproj
│ │ └── Properties
│ │ └── launchSettings.json
├── Infrastructure
│ ├── VolleyM.Infrastructure.Players.AzureStorage
│ │ ├── pluginsettings.Production.json
│ │ ├── pluginsettings.Staging.json
│ │ ├── pluginsettings.json
│ │ ├── pluginsettings.Development.json
│ │ ├── TableConfiguration
│ │ │ ├── PlayersContextTableStorageOptions.cs
│ │ │ └── TableConfiguration.cs
│ │ ├── PlayerEntity.cs
│ │ ├── VolleyM.Infrastructure.Players.AzureStorage.csproj
│ │ ├── PlayersAzureStorageMigrationTask.cs
│ │ ├── InfrastructurePlayersAzureStorageBootstrapper.cs
│ │ └── PlayersAzureStorageMappingProfile.cs
│ ├── VolleyM.Infrastructure.IdentityAndAccess.AzureStorage
│ │ ├── pluginsettings.Production.json
│ │ ├── pluginsettings.Staging.json
│ │ ├── pluginsettings.json
│ │ ├── pluginsettings.Development.json
│ │ ├── TableConfiguration
│ │ │ ├── IdentityContextTableStorageOptions.cs
│ │ │ └── TableConfiguration.cs
│ │ ├── UserEntity.cs
│ │ └── IdentityAndAccessAzureStorageMigrationTask.cs
│ ├── VolleyM.Infrastructure.AzureStorage
│ │ ├── AzureTableStorageOptions.cs
│ │ └── VolleyM.Infrastructure.AzureStorage.csproj
│ ├── VolleyM.Infrastructure.EventBroker
│ │ ├── IEventHandlerWrapperCache.cs
│ │ ├── VolleyM.Infrastructure.EventBroker.csproj
│ │ ├── EventHandlerWrapperCache.cs
│ │ ├── EventHandlerWrapper.cs
│ │ ├── AsyncScopedEventHandlerProxy.cs
│ │ └── EventBrokerAssemblyBootstrapper.cs
│ ├── VolleyM.Infrastructure.Bootstrap
│ │ ├── IDomainComponentDependencyRegistrar.cs
│ │ ├── VolleyM.Infrastructure.Bootstrap.csproj
│ │ └── IAssemblyBootstrapper.cs
│ ├── VolleyM.Infrastructure.Hardcoded
│ │ ├── VolleyM.Infrastructure.Hardcoded.csproj
│ │ ├── GetAllContributorsQuery.cs
│ │ ├── InfrastructureHardcodedAssemblyBootstrapper.cs
│ │ └── HardcodedRolesStore.cs
│ └── VolleyM.Infrastructure.EventBroker.MassTransit
│ │ ├── VolleyM.Infrastructure.EventBroker.MassTransit.csproj
│ │ ├── EventBrokerMassTransitAssemblyBootstrapper.cs
│ │ └── MassTransitEventPublisher.cs
└── Domain
│ ├── VolleyM.Domain.Contracts
│ ├── Crosscutting
│ │ ├── IRandomIdGenerator.cs
│ │ ├── UserId.cs
│ │ ├── IApplicationInfo.cs
│ │ ├── IAuthorizationHandler.cs
│ │ ├── ICurrentUserProvider.cs
│ │ └── TenantId.cs
│ ├── EventBroker
│ │ ├── IEvent.cs
│ │ ├── ICanProduceEvent.cs
│ │ ├── IPublicEvent.cs
│ │ └── IEventHandler.cs
│ ├── Version.cs
│ ├── FeatureManagement
│ │ └── IFeatureManager.cs
│ ├── Error
│ │ ├── ValidationError.cs
│ │ ├── ErrorType.cs
│ │ └── Error.cs
│ ├── IQuery.cs
│ ├── VolleyM.Domain.Contracts.csproj
│ ├── IRequestHandler.cs
│ └── IRequest.cs
│ ├── VolleyM.Domain.Players
│ ├── PlayersConstants.cs
│ ├── PlayerAggregate
│ │ ├── PlayerFactory.cs
│ │ ├── PlayerId.cs
│ │ ├── PlayerFactoryDto.cs
│ │ ├── IPlayersRepository.cs
│ │ └── Player.cs
│ ├── VolleyM.Domain.Players.csproj
│ ├── PlayerDto.cs
│ ├── DomainPlayersMappingProfile.cs
│ ├── Events
│ │ ├── PlayerCreated.cs
│ │ └── PlayerNameCorrected.cs
│ ├── Handlers
│ │ ├── IPlayerNameRequest.cs
│ │ └── GetAll.cs
│ └── DomainPlayersAssemblyBootstrapper.cs
│ ├── VolleyM.Domain.Framework
│ ├── ReadMe.md
│ ├── Authorization
│ │ ├── CurrentUserContext.cs
│ │ ├── ICurrentUserManager.cs
│ │ ├── IRolesStore.cs
│ │ ├── ApplicationTrustOptions.cs
│ │ ├── IAuthorizationService.cs
│ │ └── CurrentUserProvider.cs
│ ├── EventBroker
│ │ ├── IEventPublisher.cs
│ │ └── NullEventPublisher.cs
│ ├── RandomIdGenerator.cs
│ ├── DomainFrameworkMappingProfile.cs
│ ├── HandlerMetadata
│ │ └── HandlerInfo.cs
│ ├── VolleyM.Domain.Framework.csproj
│ ├── CurrentUserScope.cs
│ ├── Logging
│ │ ├── LoggingRequestHandlerDecorator.cs
│ │ └── LoggingQueryObjectDecorator.cs
│ ├── VolleyMLifestyleSelectionBehavior.cs
│ ├── DecoratorBase.cs
│ ├── Validation
│ │ └── ValidationHandlerDecorator.cs
│ └── FrameworkDomainComponentDependencyRegistrar.cs
│ ├── VolleyM.Domain.IdentityAndAccess
│ ├── IdentityAndAccessConstants.cs
│ ├── RolesAggregate
│ │ ├── RoleId.cs
│ │ └── Role.cs
│ ├── UserAggregate
│ │ ├── IUserRepository.cs
│ │ ├── UserFactoryDto.cs
│ │ ├── UserFactory.cs
│ │ └── User.cs
│ ├── VolleyM.Domain.IdentityAndAccess.csproj
│ ├── Handlers
│ │ ├── GetUser.cs
│ │ └── CreateUser.cs
│ └── DomainIdentityAndAccessAssemblyBootstrapper.cs
│ └── VolleyM.Domain.Contributors
│ ├── ContributorDto.cs
│ ├── VolleyM.Domain.Contributors.csproj
│ ├── GetAll.cs
│ └── DomainContributorsAssemblyBootstrapper.cs
├── tools
└── VolleyM.Tools.MigrationTool
│ ├── appconfig.json
│ ├── Contracts
│ └── IMigrationTask.cs
│ └── VolleyM.Tools.MigrationTool.csproj
├── dev-env
├── AppSettingsSecrets-template.config
├── run-local-app.ps1
└── build-and-run-migrations.ps1
├── .dockerignore
├── cake.config
├── migrations
└── publish-azure-storage-migration.ps1
├── karate-tests.code-workspace
└── LICENSE.md
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @VolleyManagement/leads
--------------------------------------------------------------------------------
/docs/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-leap-day
--------------------------------------------------------------------------------
/tests/unit-tests/.artifactignore:
--------------------------------------------------------------------------------
1 | **/*
2 | !**/*test-run.log
--------------------------------------------------------------------------------
/tests/unit-tests/.gitignore:
--------------------------------------------------------------------------------
1 | # Specflow code behind
2 | *.feature.cs
--------------------------------------------------------------------------------
/global.json:
--------------------------------------------------------------------------------
1 | {
2 | "sdk": {
3 | "version": "8.0.100"
4 | }
5 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API.Contributors/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 |
3 | }
--------------------------------------------------------------------------------
/tools/VolleyM.Tools.MigrationTool/appconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "EnvironmentName": "Development"
3 | }
--------------------------------------------------------------------------------
/dev-env/AppSettingsSecrets-template.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/docs/logo/volley-mgmt-logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VolleyManagement/volley-management/HEAD/docs/logo/volley-mgmt-logo.ico
--------------------------------------------------------------------------------
/docs/logo/volley-mgmt-logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VolleyManagement/volley-management/HEAD/docs/logo/volley-mgmt-logo.jpg
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Framework.UnitTests/test-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "ApplicationTrust": {
3 | "Auth0ClientId": "someIdString"
4 | }
5 | }
--------------------------------------------------------------------------------
/tests/api-tests/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | "recommendations": [
3 | "kirkslota.karate-runner",
4 | "alexkrechik.cucumberautocomplete"
5 | ]
6 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/volley-mgmt-logo.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VolleyManagement/volley-management/HEAD/src/Client/VolleyM.API/volley-mgmt-logo.ico
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/test-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "ApplicationTrust": {
3 | "Auth0ClientId": "someIdString"
4 | }
5 | }
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.Players.AzureStorage/pluginsettings.Production.json:
--------------------------------------------------------------------------------
1 | {
2 | "PlayersContextTableStorageOptions": {
3 | "PlayersTable": "players"
4 | }
5 | }
--------------------------------------------------------------------------------
/dev-env/run-local-app.ps1:
--------------------------------------------------------------------------------
1 | docker build -t volleymanagement/api:local .
2 | docker run -d --rm --name vm-api -p 5000:80 --env ASPNETCORE_ENVIRONMENT=Development volleymanagement/api:local
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/CORS/CorsOptions.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.API.CORS
2 | {
3 | public class CorsOptions
4 | {
5 | public string AllowedOrigins { get; set; }
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/esquio.json:
--------------------------------------------------------------------------------
1 | {
2 | "Esquio": {
3 | // leave empty and allow each env specific config to define toggles to prevent mix ups between different files.
4 | }
5 | }
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.Players.AzureStorage/pluginsettings.Staging.json:
--------------------------------------------------------------------------------
1 | {
2 | "PlayersContextTableStorageOptions": {
3 | "PlayersTable": "players0staging"
4 | }
5 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Architecture.UnitTests/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using Xunit;
2 |
3 | // All tests in this assembly should be unit tests
4 | [assembly: AssemblyTrait("Category", "unit")]
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Framework.UnitTests/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using Xunit;
2 |
3 | // All tests in this assembly should be unit tests
4 | [assembly: AssemblyTrait("Category", "unit")]
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.IdentityAndAccess.AzureStorage/pluginsettings.Production.json:
--------------------------------------------------------------------------------
1 | {
2 | "IdentityContextTableStorageOptions": {
3 | "UsersTable": "users"
4 | }
5 | }
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.IdentityAndAccess.AzureStorage/pluginsettings.Staging.json:
--------------------------------------------------------------------------------
1 | {
2 | "IdentityContextTableStorageOptions": {
3 | "UsersTable": "users0staging"
4 | }
5 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using Xunit;
2 |
3 | // All tests in this assembly should be unit tests
4 | [assembly: AssemblyTrait("Category", "unit")]
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/Constants.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.API
2 | {
3 | internal static class Constants
4 | {
5 | internal const string VM_PLUGIN_PATH = "VM_PLUGIN_PATH_KEY";
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/Crosscutting/IRandomIdGenerator.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Contracts.Crosscutting
2 | {
3 | public interface IRandomIdGenerator
4 | {
5 | string GetRandomId();
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Players/PlayersConstants.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Players
2 | {
3 | public static class PlayersConstants
4 | {
5 | public static string Name { get; } = "Players";
6 | }
7 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Contributors.UnitTests/test-config.json:
--------------------------------------------------------------------------------
1 | {
2 | "TestTarget": "Unit",
3 | "TestLogName": "contributors-test-run.log",
4 | "ApplicationTrust": {
5 | "Auth0ClientId": "someIdString"
6 | }
7 | }
--------------------------------------------------------------------------------
/dev-env/build-and-run-migrations.ps1:
--------------------------------------------------------------------------------
1 | # Builds migration host and related task
2 | .\migrations\publish-azure-storage-migration.ps1
3 | cd .\migrations\azure-storage-migrations
4 | dotnet VolleyM.Tools.MigrationTool.dll
5 | cd ..\..
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | # Volley Management System
2 |
3 | This is GitHub pages test for VM. We hope it will grow more in future.
4 |
5 | ## Some useful links
6 |
7 | - [Lviv IT Voleyball League Spring 2018](tournaments/lviv-it-league-2018)
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/serilog.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Serilog": {
3 | "LevelSwitches": {
4 | "$appLogLevel": "Debug",
5 | "$msfLogLevel": "Information",
6 | "$sysLogLevel": "Error"
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.Players.AzureStorage/pluginsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "PlayersContextTableStorageOptions": {
3 | "ConnectionString": "UseDevelopmentStorage=true;",
4 | "PlayersTable": "players"
5 | }
6 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextA/EventA.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextA
2 | {
3 | public class EventA : EventBase
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextA/EventB.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextA
2 | {
3 | public class EventB : EventBase
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextA/EventC.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextA
2 | {
3 | public class EventC : EventBase
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextB/EventD.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextB
2 | {
3 | public class EventD : EventBase
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextB/EventF.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextB
2 | {
3 | public class EventF : EventBase
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextB/EventG.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextB
2 | {
3 | public class EventG : EventBase
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextB/EventH.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextB
2 | {
3 | public class EventH : EventBase
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextC/EventG.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextC
2 | {
3 | public class EventG : EventBase
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextC/EventI.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextC
2 | {
3 | public class EventI : EventBase
4 | {
5 | }
6 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.UnitTests.Framework/TestTarget.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.UnitTests.Framework
2 | {
3 | public enum TestTarget
4 | {
5 | Unit,
6 | AzureCloud,
7 | OnPremSql
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.IdentityAndAccess.AzureStorage/pluginsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "IdentityContextTableStorageOptions": {
3 | "ConnectionString": "UseDevelopmentStorage=true;",
4 | "UsersTable": "users"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Framework/ReadMe.md:
--------------------------------------------------------------------------------
1 | # VolleyM.Domain.Framework
2 |
3 | The purpose of this package is to handle and provide crosscutting domain concerns like authorization or logging.
4 | And implement some services defined in Domain.Contracts
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.Players.AzureStorage/pluginsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "PlayersContextTableStorageOptions": {
3 | "ConnectionString": "UseDevelopmentStorage=true;",
4 | "PlayersTable": "players0development"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/EventBroker/IEvent.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Contracts.EventBroker
2 | {
3 | ///
4 | /// Represents event
5 | ///
6 | public interface IEvent
7 | {
8 |
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/Authentication/Auth0Options.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.API.Authentication
2 | {
3 | public sealed class Auth0Options
4 | {
5 | public string Domain { get; set; }
6 | public string ApiIdentifier { get; set; }
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.IdentityAndAccess/IdentityAndAccessConstants.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.IdentityAndAccess
2 | {
3 | public static class IdentityAndAccessConstants
4 | {
5 | public static string Context => "IdentityAndAccess";
6 | }
7 | }
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.AzureStorage/AzureTableStorageOptions.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Infrastructure.AzureStorage
2 | {
3 | public class AzureTableStorageOptions
4 | {
5 | public string ConnectionString { get; set; }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.IdentityAndAccess.AzureStorage/pluginsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "IdentityContextTableStorageOptions": {
3 | "ConnectionString": "UseDevelopmentStorage=true;",
4 | "UsersTable": "users0development"
5 | }
6 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/EventBroker/ICanProduceEvent.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 |
3 | namespace VolleyM.Domain.Contracts.EventBroker
4 | {
5 | public interface ICanProduceEvent
6 | {
7 | List DomainEvents { get; }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Framework/Authorization/CurrentUserContext.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.IdentityAndAccess;
2 |
3 | namespace VolleyM.Domain.Framework.Authorization
4 | {
5 | public class CurrentUserContext
6 | {
7 | public User User { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/Authorization/DefaultVolleyMAuthorizationRequirement.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Authorization;
2 |
3 | namespace VolleyM.API.Authorization
4 | {
5 | public class DefaultVolleyMAuthorizationRequirement : IAuthorizationRequirement
6 | {
7 | }
8 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.UnitTests.Framework/TestFixture/ITenantTestFixture.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts;
2 |
3 | namespace VolleyM.Domain.UnitTests.Framework
4 | {
5 | public interface ITenantTestFixture : ITestFixture
6 | {
7 | TenantId CurrentTenant { get; }
8 | }
9 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Framework.UnitTests/Fixture/SampleEvent.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts.EventBroker;
2 |
3 | namespace VolleyM.Domain.IDomainFrameworkTestFixture
4 | {
5 | public class SampleEvent : IEvent
6 | {
7 | public string Data { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextA/EventD.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts.EventBroker;
2 |
3 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextA
4 | {
5 | public class EventD : EventBase, IPublicEvent
6 | {
7 | }
8 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextA/EventE.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts.EventBroker;
2 |
3 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextA
4 | {
5 | public class EventE : EventBase, IPublicEvent
6 | {
7 | }
8 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextA/EventF.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts.EventBroker;
2 |
3 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextA
4 | {
5 | public class EventF : EventBase, IPublicEvent
6 | {
7 | }
8 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextA/EventG.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts.EventBroker;
2 |
3 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextA
4 | {
5 | public class EventG : EventBase, IPublicEvent
6 | {
7 | }
8 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextA/EventH.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts.EventBroker;
2 |
3 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextA
4 | {
5 | public class EventH : EventBase, IPublicEvent
6 | {
7 | }
8 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/IEventBrokerTestFixture.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.UnitTests.Framework;
2 |
3 | namespace VolleyM.Infrastructure.EventBroker.UnitTests
4 | {
5 | public interface IEventBrokerTestFixture : ITestFixture
6 | {
7 |
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/Crosscutting/UserId.cs:
--------------------------------------------------------------------------------
1 | using Destructurama.Attributed;
2 |
3 | namespace VolleyM.Domain.Contracts
4 | {
5 | [LogAsScalar()]
6 | public class UserId : ImmutableBase
7 | {
8 | public UserId(string id) : base(id) { }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API.Players/Player.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.API.Players
2 | {
3 | public class Player
4 | {
5 | public string Tenant { get; set; }
6 |
7 | public string Id { get; set; }
8 |
9 | public string FirstName { get; set; }
10 |
11 | public string LastName { get; set; }
12 | }
13 | }
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | version: 2
2 | updates:
3 | - package-ecosystem: "docker"
4 | directory: "/"
5 | schedule:
6 | interval: "daily"
7 |
8 | - package-ecosystem: "nuget"
9 | directory: "/"
10 | schedule:
11 | interval: "daily"
12 | open-pull-requests-limit: 20
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.UnitTests.Framework/TestFixture/EntityId.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts;
2 |
3 | namespace VolleyM.Domain.UnitTests.Framework
4 | {
5 | public class EntityId : ImmutableBase
6 | {
7 | public EntityId(string value) : base(value)
8 | {
9 | }
10 | }
11 | }
--------------------------------------------------------------------------------
/tests/api-tests/publish-karate.azcli:
--------------------------------------------------------------------------------
1 | az devops login
2 |
3 | az artifacts universal publish --organization "https://dev.azure.com/VolleyManagement/" --feed "VolleyManagement" --name "karate" --version "0.9.6-rc2" --description "Karate Standalone" --path C:\Users\sdiac\Downloads\karate-0.9.6.RC2\karate-0.9.6.RC2\karate.jar
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.UnitTests.Framework/Transforms/ISpecFlowTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace VolleyM.Domain.UnitTests.Framework
4 | {
5 | public interface ISpecFlowTransform
6 | {
7 | Type TargetType { get; }
8 |
9 | object GetValue(object instance, string rawValue);
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API.Contributors/Contributor.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.API.Contributors
2 | {
3 | public class Contributor
4 | {
5 | public string FullName { get; set; }
6 |
7 | public string Team { get; set; }
8 |
9 | public string CourseDirection { get; set; }
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/EventBroker/IPublicEvent.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Contracts.EventBroker
2 | {
3 | ///
4 | /// arks event which should be routed outside of the bounded context
5 | ///
6 | public interface IPublicEvent : IEvent
7 | {
8 |
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Framework/Authorization/ICurrentUserManager.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Framework.Authorization
2 | {
3 | public interface ICurrentUserManager
4 | {
5 | CurrentUserContext Context { get; set; }
6 |
7 | CurrentUserScope BeginScope(CurrentUserContext userScope);
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.EventBroker/IEventHandlerWrapperCache.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace VolleyM.Infrastructure.EventBroker
4 | {
5 | public interface IEventHandlerWrapperCache
6 | {
7 | EventHandlerWrapper GetOrAdd(Type eventType, Func factory);
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contributors/ContributorDto.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Contributors
2 | {
3 | public class ContributorDto
4 | {
5 | public string FullName { get; set; }
6 |
7 | public string Team { get; set; }
8 |
9 | public string CourseDirection { get; set; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/Crosscutting/IApplicationInfo.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Contracts.Crosscutting
2 | {
3 |
4 | ///
5 | /// Provides information about the overall application
6 | ///
7 | public interface IApplicationInfo
8 | {
9 | bool IsRunningInProduction { get; }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Players/PlayerAggregate/PlayerFactory.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Players.PlayerAggregate
2 | {
3 | public sealed class PlayerFactory
4 | {
5 | public Player Create(PlayerFactoryDto dto)
6 | {
7 | return new Player(dto.Tenant,dto.Version, dto.Id, dto.FirstName, dto.LastName);
8 | }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Players/PlayerAggregate/PlayerId.cs:
--------------------------------------------------------------------------------
1 | using Destructurama.Attributed;
2 | using VolleyM.Domain.Contracts;
3 |
4 | namespace VolleyM.Domain.Players.PlayerAggregate
5 | {
6 | [LogAsScalar]
7 | public class PlayerId : ImmutableBase
8 | {
9 | public PlayerId(string id) : base(id) { }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/Crosscutting/IAuthorizationHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Security.Claims;
2 | using LanguageExt;
3 |
4 | namespace VolleyM.Domain.Contracts.Crosscutting
5 | {
6 | public interface IAuthorizationHandler
7 | {
8 | EitherAsync AuthorizeUser(ClaimsPrincipal user);
9 | }
10 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Contributors.UnitTests/GetAll/Contributors.feature:
--------------------------------------------------------------------------------
1 | Feature: Contributors
2 |
3 | All contributors should be recognized and returned
4 |
5 | @unit
6 | Scenario: Query all contributors
7 | Given several contributors exist
8 | When I query all contributors
9 | Then all contributors received
10 |
11 |
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextA/EventJ.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextA
2 | {
3 | public class EventJ : EventBase
4 | {
5 | public string RequestScope { get; set; }
6 |
7 | public string EventHandlerScope { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Framework/Authorization/IRolesStore.cs:
--------------------------------------------------------------------------------
1 | using LanguageExt;
2 | using VolleyM.Domain.Contracts;
3 | using VolleyM.Domain.IdentityAndAccess.RolesAggregate;
4 |
5 | namespace VolleyM.Domain.Framework.Authorization
6 | {
7 | public interface IRolesStore
8 | {
9 | EitherAsync Get(RoleId roleId);
10 | }
11 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/ContextA/EventI.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts.EventBroker;
2 |
3 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture.ContextA
4 | {
5 | public class EventI : EventBase, IPublicEvent
6 | {
7 | public string IgnoredProperty { get; set; }
8 | }
9 | }
--------------------------------------------------------------------------------
/tests/api-tests/set-dev-environment.ps1:
--------------------------------------------------------------------------------
1 | # It's ok to have this secret here as it cannot be leveraged against production environment
2 | $Auth0_Dev = "NKn65TQ-BhkYaIkPRG8iUruIMjwiTzN01xUc4CwM7ucNnyEeV4RXTOgLuxu97Emj"
3 | [Environment]::SetEnvironmentVariable("VM_KARATE_AUTH0_CLIENT_SECRET", $Auth0_Dev, "User")
4 | $Env:VM_KARATE_AUTH0_CLIENT_SECRET = $Auth0_Dev
5 |
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Architecture.UnitTests/TypesFixture.cs:
--------------------------------------------------------------------------------
1 | using NetArchTest.Rules;
2 |
3 | namespace VolleyM.Architecture.UnitTests
4 | {
5 | public class TypesFixture
6 | {
7 | internal static Types AllProjectTypes()
8 | {
9 | return Types.InAssemblies(AssembliesFixture.AllAssemblies);
10 | }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Framework/EventBroker/IEventPublisher.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using VolleyM.Domain.Contracts.EventBroker;
3 |
4 | namespace VolleyM.Domain.Framework.EventBroker
5 | {
6 | public interface IEventPublisher
7 | {
8 | Task PublishEvent(TEvent @event)
9 | where TEvent: IEvent;
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.IdentityAndAccess/RolesAggregate/RoleId.cs:
--------------------------------------------------------------------------------
1 | using Destructurama.Attributed;
2 | using VolleyM.Domain.Contracts;
3 |
4 | namespace VolleyM.Domain.IdentityAndAccess.RolesAggregate
5 | {
6 | [LogAsScalar]
7 | public class RoleId : ImmutableBase
8 | {
9 | public RoleId(string value) : base(value) { }
10 | }
11 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Players/VolleyM.Domain.Players.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.dockerignore:
--------------------------------------------------------------------------------
1 | **/.dockerignore
2 | **/.env
3 | **/.git
4 | **/.gitignore
5 | **/.vs
6 | **/.vscode
7 | **/*.*proj.user
8 | **/azds.yaml
9 | **/charts
10 | **/bin
11 | **/obj
12 | **/Dockerfile
13 | **/Dockerfile.develop
14 | **/docker-compose.yml
15 | **/docker-compose.*.yml
16 | **/*.dbmdl
17 | **/*.jfm
18 | **/secrets.dev.yaml
19 | **/values.dev.yaml
20 | **/.toolstarget
--------------------------------------------------------------------------------
/src/Client/VolleyM.API.Players/PlayersApiMappingProfile.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 |
3 | namespace VolleyM.API.Players
4 | {
5 | public class PlayersApiMappingProfile : Profile
6 | {
7 | public PlayersApiMappingProfile()
8 | {
9 | CreateMap();
10 | CreateMap();
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Framework/RandomIdGenerator.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using VolleyM.Domain.Contracts.Crosscutting;
3 |
4 | namespace VolleyM.Domain.Framework
5 | {
6 | public class RandomIdGenerator : IRandomIdGenerator
7 | {
8 | public string GetRandomId()
9 | {
10 | return Guid.NewGuid().ToString("N").Substring(0, 20).ToLower();
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/EventBase.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts.EventBroker;
2 |
3 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture
4 | {
5 | public abstract class EventBase : IEvent
6 | {
7 | public string SomeData { get; set; }
8 | public int RequestData { get; set; }
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/Version.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Contracts
2 | {
3 | public class Version : ImmutableBase
4 | {
5 | public Version(string value) : base(value)
6 | {
7 | }
8 |
9 | public static Version Initial = new Version("initial");
10 | // Object was deleted
11 | public static Version Deleted = new Version("deleted");
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/Crosscutting/ICurrentUserProvider.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Contracts.Crosscutting
2 | {
3 | ///
4 | /// Provides information about currently logged in user
5 | ///
6 | public interface ICurrentUserProvider
7 | {
8 | UserId UserId { get; }
9 |
10 | TenantId Tenant { get; }
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/esquio.Staging.json:
--------------------------------------------------------------------------------
1 | {
2 | "Esquio": {
3 | "Products": [
4 | {
5 | "Name": "Players",
6 | "Features": [
7 | {
8 | "Name": "GetAll",
9 | "Enabled": false,
10 | "Toggles": []
11 | },
12 | {
13 | "Name": "Create",
14 | "Enabled": true,
15 | "Toggles": []
16 | }
17 | ]
18 | }
19 | ]
20 | }
21 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Contributors.UnitTests/IContributorsTestFixture.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using VolleyM.Domain.UnitTests.Framework;
3 |
4 | namespace VolleyM.Domain.Contributors.UnitTests
5 | {
6 | public interface IContributorsTestFixture : ITestFixture
7 | {
8 | void MockSeveralContributorsExist(List testData);
9 | }
10 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/esquio.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Esquio": {
3 | "Products": [
4 | {
5 | "Name": "Players",
6 | "Features": [
7 | {
8 | "Name": "GetAll",
9 | "Enabled": true,
10 | "Toggles": []
11 | },
12 | {
13 | "Name": "Create",
14 | "Enabled": true,
15 | "Toggles": []
16 | }
17 | ]
18 | }
19 | ]
20 | }
21 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/esquio.Production.json:
--------------------------------------------------------------------------------
1 | {
2 | "Esquio": {
3 | "Products": [
4 | {
5 | "Name": "Players",
6 | "Features": [
7 | {
8 | "Name": "GetAll",
9 | "Enabled": false,
10 | "Toggles": []
11 | },
12 | {
13 | "Name": "Create",
14 | "Enabled": true,
15 | "Toggles": []
16 | }
17 | ]
18 | }
19 | ]
20 | }
21 | }
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.Players.AzureStorage/TableConfiguration/PlayersContextTableStorageOptions.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Infrastructure.AzureStorage;
2 |
3 | namespace VolleyM.Infrastructure.Players.AzureStorage.TableConfiguration
4 | {
5 | public class PlayersContextTableStorageOptions : AzureTableStorageOptions
6 | {
7 | public string PlayersTable { get; set; } = "players";
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API.Contributors/ContributorsApiMappingProfile.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using VolleyM.Domain.Contributors;
3 |
4 | namespace VolleyM.API.Contributors
5 | {
6 | public class ContributorsApiMappingProfile : Profile
7 | {
8 | public ContributorsApiMappingProfile()
9 | {
10 | CreateMap();
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.UnitTests.Framework/Transforms/NoOpSpecFlowTransform.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace VolleyM.Domain.UnitTests.Framework
4 | {
5 | internal class NoOpSpecFlowTransform : ISpecFlowTransform
6 | {
7 | public Type TargetType { get; } = typeof(object);
8 |
9 | public object GetValue(object instance, string rawValue)
10 | {
11 | return null;
12 | }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/VolleyMApiApplicationInfo.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts.Crosscutting;
2 |
3 | namespace VolleyM.API
4 | {
5 | public class VolleyMApiApplicationInfo : IApplicationInfo
6 | {
7 | public VolleyMApiApplicationInfo(bool isRunningInProduction)
8 | {
9 | IsRunningInProduction = isRunningInProduction;
10 | }
11 |
12 | public bool IsRunningInProduction { get; }
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/Crosscutting/TenantId.cs:
--------------------------------------------------------------------------------
1 | using Destructurama.Attributed;
2 |
3 | namespace VolleyM.Domain.Contracts
4 | {
5 | [LogAsScalar]
6 | public class TenantId : ImmutableBase
7 | {
8 | public TenantId(string id) : base(id) { }
9 |
10 | public static TenantId Default { get; } = new TenantId("V011EYMG-0D29-4E9C-BF36-0074DBFC192B");
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API.Contracts/VolleyM.API.Contracts.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 | Library
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Framework/Authorization/ApplicationTrustOptions.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Framework.Authorization
2 | {
3 | ///
4 | /// Specifies options for configuring special trust permissions.
5 | ///
6 | public class ApplicationTrustOptions
7 | {
8 | public static string ConfigKey = "ApplicationTrust";
9 |
10 | public string Auth0ClientId { get; set; }
11 | }
12 | }
--------------------------------------------------------------------------------
/cake.config:
--------------------------------------------------------------------------------
1 | ; This is the default configuration file for Cake.
2 | ; This file was downloaded from https://github.com/cake-build/resources
3 |
4 | [Nuget]
5 | Source=https://api.nuget.org/v3/index.json
6 | UseInProcessClient=true
7 | LoadDependencies=false
8 |
9 | [Paths]
10 | Tools=./build/tools
11 | Addins=./build/tools/Addins
12 | Modules=./build/tools/Modules
13 |
14 | [Settings]
15 | SkipVerification=false
16 |
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/FeatureManagement/IFeatureManager.cs:
--------------------------------------------------------------------------------
1 | using System.Threading;
2 | using System.Threading.Tasks;
3 |
4 | namespace VolleyM.Domain.Contracts.FeatureManagement
5 | {
6 | public interface IFeatureManager
7 | {
8 | Task IsEnabledAsync(
9 | string featureName,
10 | string contextName,
11 | CancellationToken cancellationToken = default(CancellationToken));
12 | }
13 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/IEventProducingRequest.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture
2 | {
3 | ///
4 | /// Simplifies test setup for event generating handlers. See usage for more details
5 | ///
6 | public interface IEventProducingRequest
7 | {
8 | public int EventData { get; set; }
9 | }
10 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.IdentityAndAccess.UnitTests/Users/GetUser.feature:
--------------------------------------------------------------------------------
1 | Feature: Get User by ID
2 | Retrieve user by ID
3 |
4 | @unit @azurecloud @ab:1026
5 | Scenario: User exist
6 | Given user exists
7 | When I get user
8 | Then user is returned
9 |
10 | @unit @azurecloud @ab:1026
11 | Scenario: User does not exist
12 | Given user does not exist
13 | When I get user
14 | Then NotFound error is returned
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.IdentityAndAccess.AzureStorage/TableConfiguration/IdentityContextTableStorageOptions.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Infrastructure.AzureStorage;
2 |
3 | namespace VolleyM.Infrastructure.IdentityAndAccess.AzureStorage.TableConfiguration
4 | {
5 | public class IdentityContextTableStorageOptions : AzureTableStorageOptions
6 | {
7 | public string UsersTable { get; set; } = "users";
8 | }
9 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.IdentityAndAccess/UserAggregate/IUserRepository.cs:
--------------------------------------------------------------------------------
1 | using LanguageExt;
2 | using VolleyM.Domain.Contracts;
3 |
4 | namespace VolleyM.Domain.IdentityAndAccess
5 | {
6 | public interface IUserRepository
7 | {
8 | EitherAsync Add(User user);
9 |
10 | EitherAsync Get(TenantId tenant, UserId id);
11 |
12 | EitherAsync Delete(TenantId tenant, UserId id);
13 | }
14 | }
--------------------------------------------------------------------------------
/tools/VolleyM.Tools.MigrationTool/Contracts/IMigrationTask.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using Microsoft.Extensions.Configuration;
3 |
4 | namespace VolleyM.Tools.MigrationTool.Contracts
5 | {
6 | ///
7 | /// Task to migrate data
8 | ///
9 | public interface IMigrationTask
10 | {
11 | Task Initialize(IConfiguration config);
12 |
13 | Task MigrateUp();
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/serilog.json:
--------------------------------------------------------------------------------
1 | {
2 | "Serilog": {
3 | "UseElastic": false,
4 | "LevelSwitches": {
5 | "$appLogLevel": "Debug",
6 | "$msfLogLevel": "Information",
7 | "$sysLogLevel": "Error"
8 | },
9 | "MinimumLevel": {
10 | "ControlledBy": "$appLogLevel",
11 | "Override": {
12 | "Microsoft": "$msfLogLevel",
13 | "System": "$sysLogLevel"
14 | }
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Framework/EventBroker/NullEventPublisher.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using VolleyM.Domain.Contracts.EventBroker;
3 |
4 | namespace VolleyM.Domain.Framework.EventBroker
5 | {
6 | public class NullEventPublisher : IEventPublisher
7 | {
8 | public Task PublishEvent(TEvent @event) where TEvent : IEvent
9 | {
10 | return Task.CompletedTask;
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Players/PlayerAggregate/PlayerFactoryDto.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts;
2 |
3 | namespace VolleyM.Domain.Players.PlayerAggregate
4 | {
5 | public class PlayerFactoryDto
6 | {
7 | public TenantId Tenant { get; set; }
8 |
9 | public Version Version { get; set; }
10 |
11 | public PlayerId Id { get; set; }
12 |
13 | public string FirstName { get; set; }
14 |
15 | public string LastName { get; set; }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/Error/ValidationError.cs:
--------------------------------------------------------------------------------
1 | using FluentValidation.Results;
2 |
3 | namespace VolleyM.Domain.Contracts
4 | {
5 | public class ValidationError : Error
6 | {
7 | public ValidationError(ValidationResult result)
8 | : base(ErrorType.ValidationFailed, "Validation failed")
9 | {
10 | Result = result;
11 | }
12 |
13 | public ValidationResult Result { get; }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/Error/ErrorType.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Contracts
2 | {
3 | public enum ErrorType
4 | {
5 | Unknown = 0,
6 | Conflict = 1,
7 | NotFound = 2,
8 | InternalError = 3,
9 | NotAuthorized = 4,
10 | NotAuthenticated = 5,
11 | ValidationFailed = 6,
12 | FeatureDisabled = 7,
13 | DesignViolation = 8,//internal framework error, usually should happen during development only
14 | ConcurrencyCheckFailed = 9,
15 | }
16 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Infrastructure.EventBroker.UnitTests/Fixture/EventInvocationSpy.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using VolleyM.Domain.Contracts.EventBroker;
3 |
4 | namespace VolleyM.Infrastructure.EventBroker.UnitTests.Fixture
5 | {
6 | public class EventInvocationSpy
7 | {
8 | public List Invocations { get; } = new List();
9 |
10 | public void RegisterInvocation(IEvent evt) => Invocations.Add(evt);
11 | }
12 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Framework/DomainFrameworkMappingProfile.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using VolleyM.Domain.Contracts;
3 |
4 | namespace VolleyM.Domain.Framework
5 | {
6 | public class DomainFrameworkMappingProfile : Profile
7 | {
8 | public DomainFrameworkMappingProfile()
9 | {
10 | CreateMap()
11 | .ConvertUsing(t => t.ToString());
12 |
13 | CreateMap()
14 | .ConvertUsing(t => new TenantId(t));
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Players/PlayerDto.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts;
2 | using VolleyM.Domain.Players.PlayerAggregate;
3 |
4 | namespace VolleyM.Domain.Players
5 | {
6 | public class PlayerDto
7 | {
8 | public TenantId Tenant { get; set; }
9 |
10 | public Version Version { get; set; }
11 |
12 | public PlayerId Id { get; set; }
13 |
14 | public string FirstName { get; set; }
15 |
16 | public string LastName { get; set; }
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Players/DomainPlayersMappingProfile.cs:
--------------------------------------------------------------------------------
1 | using AutoMapper;
2 | using VolleyM.Domain.Players.PlayerAggregate;
3 |
4 | namespace VolleyM.Domain.Players
5 | {
6 | public class DomainPlayersMappingProfile : Profile
7 | {
8 | public DomainPlayersMappingProfile()
9 | {
10 | CreateMap()
11 | .ConvertUsing(t => t.ToString());
12 |
13 | CreateMap()
14 | .ConvertUsing(t => new PlayerId(t));
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/EventBroker/IEventHandler.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 |
3 | namespace VolleyM.Domain.Contracts.EventBroker
4 | {
5 | public interface IEventHandler : IEventHandler
6 | where T : IEvent
7 | {
8 | Task Handle(T @event);
9 | }
10 |
11 | ///
12 | /// Represents non generic event handler to simplify event dispatching
13 | ///
14 | public interface IEventHandler
15 | {
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Contracts/IQuery.cs:
--------------------------------------------------------------------------------
1 | using LanguageExt;
2 |
3 | namespace VolleyM.Domain.Contracts
4 | {
5 | ///
6 | /// Represents Query object to be executed against persistence layer
7 | ///
8 | /// Query parameters
9 | /// Query result
10 | public interface IQuery
11 | where TResult : class
12 | {
13 | EitherAsync Execute(TParam param);
14 | }
15 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.UnitTests.Framework/Transforms/ISpecFlowTransformFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace VolleyM.Domain.UnitTests.Framework
4 | {
5 | ///
6 | /// SpecFlow does not do a good job in transforms for regular tables so this interface is a way to fix that.
7 | ///
8 | public interface ISpecFlowTransformFactory
9 | {
10 | ISpecFlowTransform GetTransform(Type targetType);
11 |
12 | void RegisterTransform(ISpecFlowTransform transform);
13 | }
14 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/appsettings.Production.json:
--------------------------------------------------------------------------------
1 | {
2 | "Auth0": {
3 | "Domain": "volley-mgmt.eu.auth0.com",
4 | "ApiIdentifier": "https://api.volley-mgmt.org.ua"
5 | },
6 | "CORS": {
7 | "AllowedOrigins": "https://volley-mgmt.org.ua"
8 | },
9 | "ApplicationTrust": {
10 | "Auth0ClientId": "ikfOsEbWxONYWLnt2gVPsqQXE5WGGxVy"
11 | },
12 | "IdentityContextTableStorageOptions": {
13 | "UsersTable": "users"
14 | },
15 | "PlayersContextTableStorageOptions": {
16 | "PlayersTable": "players"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.EventBroker/VolleyM.Infrastructure.EventBroker.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net8.0
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.IdentityAndAccess/UserAggregate/UserFactoryDto.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts;
2 | using VolleyM.Domain.IdentityAndAccess.RolesAggregate;
3 |
4 | namespace VolleyM.Domain.IdentityAndAccess
5 | {
6 | ///
7 | /// Data object to reconstruct User state from persistence
8 | ///
9 | public class UserFactoryDto
10 | {
11 | public UserId Id { get; set; }
12 | public TenantId Tenant { get; set; }
13 | public RoleId Role { get; set; }
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Infrastructure/VolleyM.Infrastructure.Bootstrap/IDomainComponentDependencyRegistrar.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Reflection;
3 | using SimpleInjector;
4 |
5 | namespace VolleyM.Infrastructure.Bootstrap
6 | {
7 | ///
8 | /// Provides logic for common registration of Domain Components
9 | ///
10 | public interface IDomainComponentDependencyRegistrar
11 | {
12 | void RegisterCommonDependencies(Container container, List domainComponentsAssemblies);
13 | }
14 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Framework.UnitTests/Fixture/MockedHandler.cs:
--------------------------------------------------------------------------------
1 | using LanguageExt;
2 | using VolleyM.Domain.Contracts;
3 |
4 | namespace VolleyM.Domain.Framework.UnitTests.Fixture
5 | {
6 | public class MockedHandler : IRequestHandler
7 | {
8 | public class Request : IRequest
9 | {
10 | public int A { get; set; }
11 |
12 | public int B { get; set; }
13 | }
14 |
15 | public EitherAsync Handle(Request request)
16 | {
17 | return Unit.Default;
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Players/Events/PlayerCreated.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts;
2 | using VolleyM.Domain.Contracts.EventBroker;
3 | using VolleyM.Domain.Players.PlayerAggregate;
4 |
5 | namespace VolleyM.Domain.Players.Events
6 | {
7 | public class PlayerCreated : IPublicEvent
8 | {
9 | public TenantId TenantId { get; set; }
10 |
11 | public Version Version { get; set; }
12 |
13 | public PlayerId PlayerId { get; set; }
14 |
15 | public string FirstName { get; set; }
16 |
17 | public string LastName { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Framework.UnitTests/Fixture/NotNestedHandler.cs:
--------------------------------------------------------------------------------
1 | using LanguageExt;
2 | using VolleyM.Domain.Contracts;
3 |
4 | namespace VolleyM.Domain.Framework.UnitTests.Fixture
5 | {
6 | public class NotNestedHandler : IRequestHandler
7 | {
8 | public class Request : IRequest
9 | {
10 | public int A { get; set; }
11 |
12 | public int B { get; set; }
13 | }
14 |
15 | public EitherAsync Handle(Request request)
16 | {
17 | return Unit.Default;
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Framework/Authorization/IAuthorizationService.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using VolleyM.Domain.IdentityAndAccess.RolesAggregate;
3 |
4 | namespace VolleyM.Domain.Framework.Authorization
5 | {
6 | public interface IAuthorizationService
7 | {
8 | ///
9 | /// Validates if current user has required permission
10 | ///
11 | ///
12 | ///
13 | Task CheckAccess(Permission permission);
14 | }
15 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Framework.UnitTests/Fixture/RootNsHandler.cs:
--------------------------------------------------------------------------------
1 | using LanguageExt;
2 | using VolleyM.Domain.Contracts;
3 |
4 | namespace RootNs
5 | {
6 | public class RootNsHandler
7 | {
8 | public class Request : IRequest
9 | {
10 | public int A { get; set; }
11 |
12 | public int B { get; set; }
13 | }
14 |
15 | public class Handler : IRequestHandler
16 | {
17 | public EitherAsync Handle(Request request)
18 | {
19 | return Unit.Default;
20 | }
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Framework/HandlerMetadata/HandlerInfo.cs:
--------------------------------------------------------------------------------
1 | namespace VolleyM.Domain.Framework.HandlerMetadata
2 | {
3 | public class HandlerInfo
4 | {
5 | public string Context { get; }
6 |
7 | public string Action { get; }
8 |
9 | public HandlerInfo(string context, string action)
10 | {
11 | Context = context;
12 | Action = action;
13 | }
14 |
15 | public override string ToString()
16 | {
17 | return $"{Context}:{Action}";
18 | }
19 | }
20 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.Players/Events/PlayerNameCorrected.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts;
2 | using VolleyM.Domain.Contracts.EventBroker;
3 | using VolleyM.Domain.Players.PlayerAggregate;
4 |
5 | namespace VolleyM.Domain.Players.Events
6 | {
7 | public class PlayerNameCorrected : IPublicEvent
8 | {
9 | public TenantId TenantId { get; set; }
10 |
11 | public PlayerId PlayerId { get; set; }
12 |
13 | public Version Version { get; set; }
14 |
15 | public string FirstName { get; set; }
16 |
17 | public string LastName { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Players.UnitTests/Fixture/TestPlayerDto.cs:
--------------------------------------------------------------------------------
1 | using VolleyM.Domain.Contracts;
2 | using VolleyM.Domain.Players.PlayerAggregate;
3 |
4 | namespace VolleyM.Domain.Players.UnitTests.Fixture
5 | {
6 | ///
7 | /// Represents player data to simplify creation of objects
8 | ///
9 | public class TestPlayerDto
10 | {
11 | public PlayerId Id { get; set; }
12 |
13 | public Version Version { get; set; }
14 |
15 | public string FirstName { get; set; }
16 |
17 | public string LastName { get; set; }
18 | }
19 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Players.UnitTests/EventAssertionStepsHook.cs:
--------------------------------------------------------------------------------
1 | using SimpleInjector;
2 | using VolleyM.Domain.UnitTests.Framework;
3 |
4 | namespace VolleyM.Domain.Players.UnitTests
5 | {
6 | ///
7 | /// SpecFlow is not great at reusing steps across assemblies.
8 | /// By having this class we make it think that it belongs to this assembly
9 | ///
10 | public class EventAssertionStepsHook : EventAssertionsSteps
11 | {
12 | public EventAssertionStepsHook(Container container)
13 | : base(container)
14 | {
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/src/Client/VolleyM.API/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "VolleyM.API": {
4 | "commandName": "Project",
5 | "launchBrowser": true,
6 | "environmentVariables": {
7 | "ASPNETCORE_ENVIRONMENT": "Development"
8 | },
9 | "applicationUrl": "http://localhost:5000;https://localhost:5001"
10 | },
11 | "Docker": {
12 | "commandName": "Docker",
13 | "launchUrl": "localhost:5001",
14 | "environmentVariables": {
15 | "ASPNETCORE_ENVIRONMENT": "Development"
16 | }
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.IdentityAndAccess.UnitTests/Fixture/IIdentityAndAccessFixture.cs:
--------------------------------------------------------------------------------
1 | using System.Threading.Tasks;
2 | using VolleyM.Domain.Contracts;
3 | using VolleyM.Domain.UnitTests.Framework;
4 |
5 | namespace VolleyM.Domain.IdentityAndAccess.UnitTests.Fixture
6 | {
7 | public interface IIdentityAndAccessFixture : ITestFixture
8 | {
9 | Task ConfigureUserExists(TenantId tenant, UserId id, User user);
10 |
11 | Task ConfigureUserDoesNotExist(TenantId tenant, UserId id);
12 |
13 | Task VerifyUserCreated(User user);
14 | }
15 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.UnitTests.Framework/TestFixture/IAuthFixture.cs:
--------------------------------------------------------------------------------
1 | using SimpleInjector;
2 | using VolleyM.Domain.Contracts;
3 |
4 | namespace VolleyM.Domain.UnitTests.Framework
5 | {
6 | ///
7 | /// Common fixture to handle authentication and authorization during test
8 | ///
9 | public interface IAuthFixture
10 | {
11 | void SetTestUserPermission(string context, string action);
12 | void ConfigureTestUserRole(Container container);
13 | void ConfigureTestUser(Container container, TenantId tenant);
14 | }
15 | }
--------------------------------------------------------------------------------
/src/Domain/VolleyM.Domain.IdentityAndAccess/UserAggregate/UserFactory.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace VolleyM.Domain.IdentityAndAccess
4 | {
5 | ///
6 | /// Creates user instances from persistent state
7 | ///
8 | public sealed class UserFactory
9 | {
10 | public User CreateUser(UserFactoryDto userDto)
11 | {
12 | if (userDto == null)
13 | {
14 | throw new ArgumentNullException(nameof(userDto));
15 | }
16 | return new User(userDto);
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Framework.UnitTests/Fixture/NoAttributeHandler.cs:
--------------------------------------------------------------------------------
1 | using LanguageExt;
2 | using VolleyM.Domain.Contracts;
3 |
4 | namespace VolleyM.Domain.Framework.UnitTests.Fixture
5 | {
6 | public class NoAttributeHandler
7 | {
8 | public class Request : IRequest
9 | {
10 | public int A { get; set; }
11 |
12 | public int B { get; set; }
13 | }
14 |
15 | public class Handler : IRequestHandler
16 | {
17 | public EitherAsync Handle(Request request)
18 | {
19 | return Unit.Default;
20 | }
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Framework.UnitTests/Fixture/NoEventSupportHandler.cs:
--------------------------------------------------------------------------------
1 | using LanguageExt;
2 | using VolleyM.Domain.Contracts;
3 |
4 | namespace VolleyM.Domain.IDomainFrameworkTestFixture
5 | {
6 | public class NoEventSupportHandler
7 | {
8 | public class Request : IRequest
9 | {
10 | public int A { get; set; }
11 |
12 | public int B { get; set; }
13 | }
14 |
15 | public class Handler : IRequestHandler
16 | {
17 | public EitherAsync Handle(Request request)
18 | {
19 | return Unit.Default;
20 | }
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Framework.UnitTests/Fixture/NoValidationHandler.cs:
--------------------------------------------------------------------------------
1 | using LanguageExt;
2 | using VolleyM.Domain.Contracts;
3 |
4 | namespace VolleyM.Domain.IDomainFrameworkTestFixture
5 | {
6 | public class NoValidationHandler
7 | {
8 | public class Request : IRequest
9 | {
10 | public int A { get; set; }
11 |
12 | public int B { get; set; }
13 | }
14 |
15 | public class Handler : IRequestHandler
16 | {
17 | public EitherAsync Handle(Request request)
18 | {
19 | return Unit.Default;
20 | }
21 | }
22 | }
23 | }
--------------------------------------------------------------------------------
/tests/unit-tests/VolleyM.Domain.Framework.UnitTests/Fixture/SpyEventListener.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using System.Threading.Tasks;
3 | using VolleyM.Domain.Contracts.EventBroker;
4 |
5 | namespace VolleyM.Domain.IDomainFrameworkTestFixture
6 | {
7 | public class SpyEventListener : IEventHandler
8 | {
9 | public Task Handle(SampleEvent @event)
10 | {
11 | Events.Add(@event);
12 | return Task.CompletedTask;
13 | }
14 |
15 | public List