├── .gitattributes
├── .github
└── workflows
│ ├── build.cqrs_flow.dotnet.yml
│ ├── build.cqrs_flow.java.aggregates.yml
│ ├── build.cqrs_flow.java.simple.yml
│ └── build.crypto_shredding.dotnet.yml
├── .gitignore
├── CONTRIBUTING.md
├── CQRS_Flow
├── Dotnet
│ ├── .editorconfig
│ ├── Carts
│ │ ├── Carts.Api.Tests
│ │ │ ├── Carts.Api.Tests.csproj
│ │ │ ├── Carts
│ │ │ │ ├── AddingProduct
│ │ │ │ │ └── AddProductTests.cs
│ │ │ │ ├── Confirming
│ │ │ │ │ └── ConfirmShoppingCartTests.cs
│ │ │ │ ├── InitializingCart
│ │ │ │ │ └── InitializeCartTests.cs
│ │ │ │ └── RemovingProduct
│ │ │ │ │ └── RemoveProductTests.cs
│ │ │ └── Settings.cs
│ │ ├── Carts.Api
│ │ │ ├── Carts.Api.csproj
│ │ │ ├── Controllers
│ │ │ │ └── CartsController.cs
│ │ │ ├── Program.cs
│ │ │ ├── Properties
│ │ │ │ └── launchSettings.json
│ │ │ ├── Requests
│ │ │ │ └── Carts
│ │ │ │ │ ├── AddProductRequest.cs
│ │ │ │ │ ├── InitializeCartRequest.cs
│ │ │ │ │ ├── PricedProductItemRequest.cs
│ │ │ │ │ ├── ProductItemRequest.cs
│ │ │ │ │ └── RemoveProduct.cs
│ │ │ ├── Startup.cs
│ │ │ ├── appsettings.Development.json
│ │ │ └── appsettings.json
│ │ ├── Carts.Tests
│ │ │ ├── Builders
│ │ │ │ └── CartBuilder.cs
│ │ │ ├── Carts.Tests.csproj
│ │ │ ├── Carts
│ │ │ │ ├── ConfirmingCart
│ │ │ │ │ └── ConfirmCartTests.cs
│ │ │ │ └── InitializingCart
│ │ │ │ │ ├── InitializeCartCommandHandlerTests.cs
│ │ │ │ │ └── InitializeCartTests.cs
│ │ │ ├── Extensions
│ │ │ │ └── Reservations
│ │ │ │ │ └── CartExtensions.cs
│ │ │ └── Stubs
│ │ │ │ └── Products
│ │ │ │ └── FakeProductPriceCalculator.cs
│ │ └── Carts
│ │ │ ├── Carts.csproj
│ │ │ ├── Carts
│ │ │ ├── AddingProduct
│ │ │ │ ├── AddProduct.cs
│ │ │ │ └── ProductAdded.cs
│ │ │ ├── Cart.cs
│ │ │ ├── CartStatus.cs
│ │ │ ├── Config.cs
│ │ │ ├── ConfirmingCart
│ │ │ │ ├── CartConfirmed.cs
│ │ │ │ └── ConfirmCart.cs
│ │ │ ├── GettingCartAtVersion
│ │ │ │ └── GetCartAtVersion.cs
│ │ │ ├── GettingCartById
│ │ │ │ ├── CartDetails.cs
│ │ │ │ └── GetCartById.cs
│ │ │ ├── GettingCartHistory
│ │ │ │ ├── CartHistory.cs
│ │ │ │ └── GetCartHistory.cs
│ │ │ ├── GettingCarts
│ │ │ │ ├── CartShortInfo.cs
│ │ │ │ └── GetCarts.cs
│ │ │ ├── InitializingCart
│ │ │ │ ├── CartInitialized.cs
│ │ │ │ └── InitializeCart.cs
│ │ │ ├── Products
│ │ │ │ ├── PricedProductItem.cs
│ │ │ │ └── ProductItem.cs
│ │ │ └── RemovingProduct
│ │ │ │ ├── ProductRemoved.cs
│ │ │ │ └── RemoveProduct.cs
│ │ │ ├── Config.cs
│ │ │ └── Pricing
│ │ │ ├── IProductPriceCalculator.cs
│ │ │ └── RandomProductPriceCalculator.cs
│ ├── Core
│ │ ├── Core.ElasticSearch
│ │ │ ├── Config.cs
│ │ │ ├── Core.ElasticSearch.csproj
│ │ │ ├── Indices
│ │ │ │ └── IndexNameMapper.cs
│ │ │ ├── Projections
│ │ │ │ └── ElasticSearchProjection.cs
│ │ │ └── Repository
│ │ │ │ └── ElasticSearchRepository.cs
│ │ ├── Core.EventStoreDB
│ │ │ ├── Config.cs
│ │ │ ├── Core.EventStoreDB.csproj
│ │ │ ├── Events
│ │ │ │ ├── AggregateStreamExtensions.cs
│ │ │ │ └── StreamEventExtensions.cs
│ │ │ ├── Repository
│ │ │ │ └── EventStoreDBRepository.cs
│ │ │ ├── Serialization
│ │ │ │ └── EventStoreDBSerializer.cs
│ │ │ └── Subscriptions
│ │ │ │ ├── EventStoreDBSubscriptionCheckpointRepository.cs
│ │ │ │ ├── EventStoreDBSubscriptionToAll.cs
│ │ │ │ ├── ISubscriptionCheckpointRepository.cs
│ │ │ │ └── InMemorySubscriptionCheckpointRepository.cs
│ │ ├── Core.Testing
│ │ │ ├── AggregateExtensions.cs
│ │ │ ├── ApiFixture.cs
│ │ │ ├── Core.Testing.csproj
│ │ │ ├── FakeIdGenerator.cs
│ │ │ ├── FakeRepository.cs
│ │ │ ├── ResponseExtensions.cs
│ │ │ ├── SerializationExtensions.cs
│ │ │ ├── TestContext.cs
│ │ │ └── TestWebHostBuilder.cs
│ │ ├── Core.WebApi
│ │ │ ├── Core.WebApi.csproj
│ │ │ └── Middlewares
│ │ │ │ └── ExceptionHandling
│ │ │ │ ├── ExceptionHandlingMiddleware.cs
│ │ │ │ ├── ExceptionToHttpStatusMapper.cs
│ │ │ │ └── HttpExceptionWrapper.cs
│ │ └── Core
│ │ │ ├── Aggregates
│ │ │ ├── Aggregate.cs
│ │ │ └── IAggregate.cs
│ │ │ ├── BackgroundWorkers
│ │ │ └── BackgroundWorker.cs
│ │ │ ├── Commands
│ │ │ ├── CommandBus.cs
│ │ │ ├── Config.cs
│ │ │ ├── ICommandBus.cs
│ │ │ └── ICommandHandler.cs
│ │ │ ├── Config.cs
│ │ │ ├── Core.csproj
│ │ │ ├── Events
│ │ │ ├── Config.cs
│ │ │ ├── EventBus.cs
│ │ │ ├── EventTypeMapper.cs
│ │ │ ├── IEventBus.cs
│ │ │ ├── IEventHandler.cs
│ │ │ ├── StreamEvent.cs
│ │ │ └── StreamNameMapper.cs
│ │ │ ├── Exceptions
│ │ │ └── AggregateNotFoundException.cs
│ │ │ ├── Extensions
│ │ │ └── ListExtensions.cs
│ │ │ ├── Ids
│ │ │ ├── IIdGenerator.cs
│ │ │ └── NulloIdGenerator.cs
│ │ │ ├── Projections
│ │ │ └── IProjection.cs
│ │ │ ├── Queries
│ │ │ ├── Config.cs
│ │ │ ├── IQueryBus.cs
│ │ │ ├── IQueryHandler.cs
│ │ │ └── QueryBus.cs
│ │ │ ├── Reflection
│ │ │ └── TypeProvider.cs
│ │ │ ├── Repositories
│ │ │ ├── IRepository.cs
│ │ │ └── RepositoryExtensions.cs
│ │ │ └── Threading
│ │ │ └── NoSynchronizationContextScope.cs
│ ├── ECommerce.run.xml
│ ├── ECommerce.sln
│ ├── README.md
│ └── docker-compose.yml
└── Java
│ ├── .gitignore
│ ├── event-sourcing-esdb-aggregates
│ ├── .editorconfig
│ ├── .gitignore
│ ├── README.md
│ ├── build.gradle
│ ├── docker-compose.yml
│ ├── gradle
│ │ └── wrapper
│ │ │ ├── gradle-wrapper.jar
│ │ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── settings.gradle
│ └── src
│ │ ├── main
│ │ ├── java
│ │ │ └── io
│ │ │ │ └── eventdriven
│ │ │ │ └── ecommerce
│ │ │ │ ├── ECommerceApplication.java
│ │ │ │ ├── api
│ │ │ │ ├── backgroundworkers
│ │ │ │ │ └── EventStoreDBSubscriptionBackgroundWorker.java
│ │ │ │ ├── controller
│ │ │ │ │ └── ShoppingCartsController.java
│ │ │ │ └── requests
│ │ │ │ │ └── ShoppingCartsRequests.java
│ │ │ │ ├── core
│ │ │ │ ├── aggregates
│ │ │ │ │ ├── AbstractAggregate.java
│ │ │ │ │ ├── Aggregate.java
│ │ │ │ │ └── AggregateStore.java
│ │ │ │ ├── config
│ │ │ │ │ ├── CoreConfig.java
│ │ │ │ │ └── EventStoreDBConfig.java
│ │ │ │ ├── events
│ │ │ │ │ ├── EventBus.java
│ │ │ │ │ ├── EventEnvelope.java
│ │ │ │ │ ├── EventForwarder.java
│ │ │ │ │ ├── EventMetadata.java
│ │ │ │ │ └── EventTypeMapper.java
│ │ │ │ ├── http
│ │ │ │ │ ├── ETag.java
│ │ │ │ │ └── GlobalExceptionHandler.java
│ │ │ │ ├── projections
│ │ │ │ │ └── JPAProjection.java
│ │ │ │ ├── serialization
│ │ │ │ │ └── EventSerializer.java
│ │ │ │ ├── subscriptions
│ │ │ │ │ ├── CheckpointStored.java
│ │ │ │ │ ├── EventStoreDBSubscriptionCheckpointRepository.java
│ │ │ │ │ ├── EventStoreDBSubscriptionToAll.java
│ │ │ │ │ ├── EventStoreDBSubscriptionToAllOptions.java
│ │ │ │ │ └── SubscriptionCheckpointRepository.java
│ │ │ │ └── views
│ │ │ │ │ └── VersionedView.java
│ │ │ │ ├── package-info.java
│ │ │ │ ├── pricing
│ │ │ │ ├── PricingConfig.java
│ │ │ │ ├── ProductPriceCalculator.java
│ │ │ │ └── RandomProductPriceCalculator.java
│ │ │ │ └── shoppingcarts
│ │ │ │ ├── ShoppingCart.java
│ │ │ │ ├── ShoppingCartEvent.java
│ │ │ │ ├── ShoppingCartService.java
│ │ │ │ ├── ShoppingCartStatus.java
│ │ │ │ ├── ShoppingCartsConfig.java
│ │ │ │ ├── gettingbyid
│ │ │ │ ├── GetShoppingCartById.java
│ │ │ │ ├── ShoppingCartDetails.java
│ │ │ │ ├── ShoppingCartDetailsProductItem.java
│ │ │ │ ├── ShoppingCartDetailsProjection.java
│ │ │ │ └── ShoppingCartDetailsRepository.java
│ │ │ │ ├── gettingcarts
│ │ │ │ ├── GetShoppingCarts.java
│ │ │ │ ├── ShoppingCartShortInfo.java
│ │ │ │ ├── ShoppingCartShortInfoProjection.java
│ │ │ │ └── ShoppingCartShortInfoRepository.java
│ │ │ │ └── productitems
│ │ │ │ ├── PricedProductItem.java
│ │ │ │ ├── ProductItem.java
│ │ │ │ └── ProductItems.java
│ │ └── resources
│ │ │ ├── application.properties
│ │ │ ├── log4j2.xml
│ │ │ └── schema-postgres.sql
│ │ └── test
│ │ └── java
│ │ └── io
│ │ └── eventdriven
│ │ └── ecommerce
│ │ ├── api
│ │ └── controller
│ │ │ ├── AddProductItemToShoppingCartTests.java
│ │ │ ├── CancelShoppingCartTests.java
│ │ │ ├── ConfirmShoppingCartTests.java
│ │ │ ├── OpenShoppingCartTests.java
│ │ │ ├── RemoveProductItemFromShoppingCartTests.java
│ │ │ └── builders
│ │ │ └── ShoppingCartRestBuilder.java
│ │ ├── shoppingcarts
│ │ └── ShoppingCartTests.java
│ │ └── testing
│ │ ├── ApiSpecification.java
│ │ └── HttpEntityUtils.java
│ └── event-sourcing-esdb-simple
│ ├── .editorconfig
│ ├── .gitignore
│ ├── README.md
│ ├── build.gradle
│ ├── docker-compose.yml
│ ├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── settings.gradle
│ └── src
│ ├── main
│ ├── java
│ │ └── io
│ │ │ └── eventdriven
│ │ │ └── ecommerce
│ │ │ ├── ECommerceApplication.java
│ │ │ ├── api
│ │ │ ├── backgroundworkers
│ │ │ │ └── EventStoreDBSubscriptionBackgroundWorker.java
│ │ │ ├── controller
│ │ │ │ └── ShoppingCartsController.java
│ │ │ └── requests
│ │ │ │ └── ShoppingCartsRequests.java
│ │ │ ├── core
│ │ │ ├── config
│ │ │ │ ├── CoreConfig.java
│ │ │ │ └── EventStoreDBConfig.java
│ │ │ ├── entities
│ │ │ │ └── EntityStore.java
│ │ │ ├── events
│ │ │ │ ├── EventBus.java
│ │ │ │ ├── EventEnvelope.java
│ │ │ │ ├── EventForwarder.java
│ │ │ │ ├── EventMetadata.java
│ │ │ │ └── EventTypeMapper.java
│ │ │ ├── http
│ │ │ │ ├── ETag.java
│ │ │ │ └── GlobalExceptionHandler.java
│ │ │ ├── projections
│ │ │ │ └── JPAProjection.java
│ │ │ ├── serialization
│ │ │ │ └── EventSerializer.java
│ │ │ ├── subscriptions
│ │ │ │ ├── CheckpointStored.java
│ │ │ │ ├── EventStoreDBSubscriptionCheckpointRepository.java
│ │ │ │ ├── EventStoreDBSubscriptionToAll.java
│ │ │ │ ├── EventStoreDBSubscriptionToAllOptions.java
│ │ │ │ └── SubscriptionCheckpointRepository.java
│ │ │ └── views
│ │ │ │ └── VersionedView.java
│ │ │ ├── package-info.java
│ │ │ ├── pricing
│ │ │ ├── PricingConfig.java
│ │ │ ├── ProductPriceCalculator.java
│ │ │ └── RandomProductPriceCalculator.java
│ │ │ └── shoppingcarts
│ │ │ ├── ShoppingCart.java
│ │ │ ├── ShoppingCartEvent.java
│ │ │ ├── ShoppingCartService.java
│ │ │ ├── ShoppingCartsConfig.java
│ │ │ ├── addingproductitem
│ │ │ └── AddProductItemToShoppingCart.java
│ │ │ ├── canceling
│ │ │ └── CancelShoppingCart.java
│ │ │ ├── confirming
│ │ │ └── ConfirmShoppingCart.java
│ │ │ ├── gettingbyid
│ │ │ ├── GetShoppingCartById.java
│ │ │ ├── ShoppingCartDetails.java
│ │ │ ├── ShoppingCartDetailsProductItem.java
│ │ │ ├── ShoppingCartDetailsProjection.java
│ │ │ └── ShoppingCartDetailsRepository.java
│ │ │ ├── gettingcarts
│ │ │ ├── GetShoppingCarts.java
│ │ │ ├── ShoppingCartShortInfo.java
│ │ │ ├── ShoppingCartShortInfoProjection.java
│ │ │ └── ShoppingCartShortInfoRepository.java
│ │ │ ├── opening
│ │ │ └── OpenShoppingCart.java
│ │ │ ├── productitems
│ │ │ ├── PricedProductItem.java
│ │ │ ├── ProductItem.java
│ │ │ └── ProductItems.java
│ │ │ └── removingproductitem
│ │ │ └── RemoveProductItemFromShoppingCart.java
│ └── resources
│ │ ├── application.properties
│ │ ├── log4j2.xml
│ │ └── schema-postgres.sql
│ └── test
│ └── java
│ └── io
│ └── eventdriven
│ └── ecommerce
│ ├── api
│ └── controller
│ │ ├── AddProductItemToShoppingCartTests.java
│ │ ├── CancelShoppingCartTests.java
│ │ ├── ConfirmShoppingCartTests.java
│ │ ├── OpenShoppingCartTests.java
│ │ ├── RemoveProductItemFromShoppingCartTests.java
│ │ └── builders
│ │ └── ShoppingCartRestBuilder.java
│ ├── shoppingcarts
│ └── ShoppingCartTests.java
│ └── testing
│ ├── ApiSpecification.java
│ └── HttpEntityUtils.java
├── Crypto_Shredding
└── Dotnet
│ ├── .gitignore
│ ├── CryptoShredding.sln
│ ├── CryptoShredding.sln.DotSettings
│ ├── README.md
│ ├── docker-compose.yml
│ └── src
│ ├── CryptoShredding.IntegrationTests
│ ├── CryptoShredding.IntegrationTests.csproj
│ ├── EventStoreTests
│ │ └── GetEventsTests.cs
│ └── TestSupport
│ │ └── Given_When_Then.cs
│ └── CryptoShredding
│ ├── Attributes
│ ├── DataSubjectIdAttribute.cs
│ └── PersonalDataAttribute.cs
│ ├── Contracts
│ └── IEvent.cs
│ ├── CryptoShredding.csproj
│ ├── EventConverter.cs
│ ├── EventStore.cs
│ ├── Repository
│ ├── CryptoRepository.cs
│ └── EncryptionKey.cs
│ └── Serialization
│ ├── ContractResolvers
│ ├── DeserializationContractResolver.cs
│ └── SerializationContractResolver.cs
│ ├── EncryptorDecryptor.cs
│ ├── JsonConverters
│ ├── DecryptionJsonConverter.cs
│ ├── EncryptionJsonConverter.cs
│ └── FieldEncryptionDecryption.cs
│ ├── JsonSerializer.cs
│ ├── JsonSerializerSettingsFactory.cs
│ └── SerializedEvent.cs
├── LICENSE
├── LoanApplication
├── Python
│ ├── CreditCheck.py
│ ├── LoanDecider.py
│ ├── LoanRequestor-commandLine.py
│ ├── LoanRequestor-testCases.py
│ ├── Projection-LoansApprovedDenied.js
│ ├── Projection-LoansByCountryName.js
│ ├── README.md
│ ├── Underwriting.py
│ ├── config.py
│ ├── create_projections.sh
│ └── utils.py
├── README.md
├── docker-compose.yaml
└── images
│ ├── image1.png
│ ├── image10x.png
│ ├── image11.png
│ ├── image11x.png
│ ├── image12x.png
│ ├── image13.png
│ ├── image14.png
│ ├── image15.png
│ ├── image16.png
│ ├── image17.png
│ ├── image18.png
│ ├── image2.png
│ ├── image3.png
│ ├── image4.png
│ ├── image5.png
│ ├── image6x.png
│ ├── image7x.png
│ ├── image8x.png
│ └── image9x.png
├── Logging
└── Elastic
│ ├── Filebeat
│ ├── README.md
│ ├── docker-compose.yml
│ ├── filebeat.yml
│ └── logs
│ │ └── .gitignore
│ ├── FilebeatWithLogstash
│ ├── README.md
│ ├── docker-compose.yml
│ ├── filebeat.yml
│ ├── logs
│ │ └── .gitignore
│ └── logstash.conf
│ ├── Logstash
│ ├── README.md
│ ├── docker-compose.yml
│ ├── logs
│ │ └── .gitignore
│ └── logstash.conf
│ └── README.md
├── Quickstart
├── Dotnet
│ └── esdb-sample-dotnet
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── EventStoreDB.Dotnet.Sample.csproj
│ │ ├── EventStoreDB.Dotnet.Sample.sln
│ │ ├── Program.cs
│ │ ├── Properties
│ │ └── launchSettings.json
│ │ ├── README.md
│ │ ├── appsettings.json
│ │ └── docker-compose.yml
├── Go
│ └── esdb-sample-go
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── docker-compose.yml
│ │ ├── go.mod
│ │ ├── go.sum
│ │ └── main.go
├── Java
│ └── esdb-sample-springboot
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── build.gradle
│ │ ├── docker-compose.yml
│ │ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ │ ├── gradlew
│ │ ├── gradlew.bat
│ │ ├── mvnw.cmd
│ │ ├── mvnw.txt
│ │ ├── pom.xml
│ │ ├── settings.gradle
│ │ └── src
│ │ └── main
│ │ ├── java
│ │ └── com
│ │ │ └── example
│ │ │ └── esdbsamplespringboot
│ │ │ ├── EventStoreDBConfiguration.java
│ │ │ ├── HelloWorldApplication.java
│ │ │ └── HelloWorldController.java
│ │ └── resources
│ │ ├── application.properties
│ │ └── log4j.properties
├── Nodejs
│ └── esdb-sample-nodejs
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── app.js
│ │ ├── docker-compose.yml
│ │ ├── package-lock.json
│ │ └── package.json
├── Python
│ └── esdb-sample-python
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── README.md
│ │ ├── docker-compose.yml
│ │ ├── main.py
│ │ └── requirements.txt
└── Rust
│ └── esdb-sample-rust
│ ├── .dockerignore
│ ├── Cargo.lock
│ ├── Cargo.toml
│ ├── Dockerfile
│ ├── README.md
│ ├── Rocket.toml
│ ├── docker-compose.yml
│ └── src
│ └── main.rs
└── README.md
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto eol=lf
2 | *.png binary
3 | *.ttf binary
4 | *.jpg binary
5 | *.jpeg binary
6 | *.pdf binary
--------------------------------------------------------------------------------
/.github/workflows/build.cqrs_flow.dotnet.yml:
--------------------------------------------------------------------------------
1 | name: Build CQRS Flow .NET
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | pull_request:
8 |
9 | defaults:
10 | run:
11 | working-directory: ./CQRS_Flow/Dotnet/
12 |
13 | jobs:
14 | build:
15 | runs-on: ubuntu-latest
16 |
17 | steps:
18 | - name: Check Out Repo
19 | uses: actions/checkout@v1
20 |
21 | - name: Start containers
22 | run: docker-compose -f "docker-compose.yml" up -d
23 |
24 | - name: Setup .NET Core
25 | uses: actions/setup-dotnet@v1
26 | with:
27 | dotnet-version: "6.0.x"
28 |
29 | - name: Restore NuGet packages
30 | run: dotnet restore
31 |
32 | - name: Build
33 | run: dotnet build --configuration Release --no-restore
34 |
35 | - name: Run tests
36 | run: dotnet test --configuration Release --no-build --logger "trx;LogFileName=test-results.trx"
37 |
38 | - name: Stop containers
39 | if: always()
40 | run: docker-compose -f "docker-compose.yml" down
41 |
--------------------------------------------------------------------------------
/.github/workflows/build.cqrs_flow.java.aggregates.yml:
--------------------------------------------------------------------------------
1 | name: Build CQRS Flow Java - Aggregates
2 |
3 | on:
4 | # run it on push to the default repository branch
5 | push:
6 | branches: [main]
7 | # run it during pull request
8 | pull_request:
9 |
10 | defaults:
11 | run:
12 | working-directory: ./CQRS_Flow/Java/event-sourcing-esdb-aggregates
13 |
14 | jobs:
15 | build-and-test-code:
16 | name: Build and test
17 | runs-on: ubuntu-latest
18 |
19 | steps:
20 | - name: Check Out Repo
21 | uses: actions/checkout@v2
22 |
23 | - name: Start containers
24 | run: docker-compose up -d
25 |
26 | - name: Set up JDK 17
27 | uses: actions/setup-java@v2
28 | with:
29 | java-version: 17
30 | distribution: "adopt"
31 | cache: gradle
32 |
33 | - uses: gradle/gradle-build-action@v2
34 | with:
35 | arguments: build
36 | gradle-version: wrapper
37 | build-root-directory: ./CQRS_Flow/Java/event-sourcing-esdb-aggregates
38 |
39 | - name: Archive test report
40 | uses: actions/upload-artifact@v2
41 | if: always()
42 | with:
43 | name: Test report
44 | path: ./CQRS_Flow/Java/event-sourcing-esdb-aggregates/build/test-results/test
45 |
46 | - name: Stop containers
47 | if: always()
48 | run: docker-compose down
49 |
--------------------------------------------------------------------------------
/.github/workflows/build.cqrs_flow.java.simple.yml:
--------------------------------------------------------------------------------
1 | name: Build CQRS Flow Java - Simple
2 |
3 | on:
4 | # run it on push to the default repository branch
5 | push:
6 | branches: [main]
7 | # run it during pull request
8 | pull_request:
9 |
10 | defaults:
11 | run:
12 | working-directory: ./CQRS_Flow/Java/event-sourcing-esdb-simple
13 |
14 | jobs:
15 | build-and-test-code:
16 | name: Build and test
17 | runs-on: ubuntu-latest
18 |
19 | steps:
20 | - name: Check Out Repo
21 | uses: actions/checkout@v2
22 |
23 | - name: Start containers
24 | run: docker-compose up -d
25 |
26 | - name: Set up JDK 17
27 | uses: actions/setup-java@v2
28 | with:
29 | java-version: 17
30 | distribution: "adopt"
31 | cache: gradle
32 |
33 | - uses: gradle/gradle-build-action@v2
34 | with:
35 | arguments: build
36 | gradle-version: wrapper
37 | build-root-directory: ./CQRS_Flow/Java/event-sourcing-esdb-simple
38 |
39 | - name: Archive test report
40 | uses: actions/upload-artifact@v2
41 | if: always()
42 | with:
43 | name: Test report
44 | path: ./CQRS_Flow/Java/event-sourcing-esdb-simple/build/test-results/test
45 |
46 | - name: Stop containers
47 | if: always()
48 | run: docker-compose down
49 |
--------------------------------------------------------------------------------
/.github/workflows/build.crypto_shredding.dotnet.yml:
--------------------------------------------------------------------------------
1 | name: Build Crypto Shredding .NET
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | pull_request:
8 |
9 | defaults:
10 | run:
11 | working-directory: ./Crypto_Shredding/Dotnet
12 |
13 | jobs:
14 | build:
15 | runs-on: ubuntu-latest
16 |
17 | steps:
18 | - name: Check Out Repo
19 | uses: actions/checkout@v1
20 |
21 | - name: Start containers
22 | run: docker-compose -f "docker-compose.yml" up -d
23 |
24 | - name: Setup .NET Core
25 | uses: actions/setup-dotnet@v1
26 | with:
27 | dotnet-version: "6.0.x"
28 |
29 | - name: Restore NuGet packages
30 | run: dotnet restore
31 |
32 | - name: Build
33 | run: dotnet build --configuration Release --no-restore
34 |
35 | - name: Run tests
36 | run: dotnet test --configuration Release --no-build --logger "trx;LogFileName=test-results.trx"
37 |
38 | - name: Stop containers
39 | if: always()
40 | run: docker-compose -f "docker-compose.yml" down
41 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to EventStoreDB samples
2 |
3 | ## Before you submit a Pull Request (PR)
4 |
5 | 1. Contact us via a [GitHub Issue](https://github.com/EventStore/samples/issues/new) and please include a proposed solution with details
6 | 2. Make sure your code runs as intended and all tests pass
7 |
8 | ## Once you've submitted a PR
9 |
10 | 1. Your PR will be merged once approved by at least 2 reviewers.
11 |
12 | ## Working with Git
13 |
14 | `main` is just that: the main branch. Releases are tagged from main.
15 |
16 | We attempt to do our best to ensure that the history is preserved and to do so, we generally ask contributors to squash their commits into a single logical commit.
17 |
18 | To contribute to EventStoreDB samples:
19 |
20 | 1. Fork the repository
21 | 2. Create a feature branch from the `main` (or release) branch
22 | 3. We recommend you use a rebase strategy for feature branches (see more in [Git documentation](https://git-scm.com/book/en/v2/Git-Branching-Rebasing)). Please use clear commit messages. Commits should also represent a single unit of change
23 | 4. Before sending a PR, please make sure you got the latest source branch from the main repository
24 | 5. When ready, create a [Pull Request on GitHub](https://github.com/EventStore/samples/compare)
25 |
26 | ## Code style
27 |
28 | Coding rules are set up in the project files to be automatically applied (e.g. with `.editorconfig` or `.prettierrc.json`). Unless you disabled it manually, it should be automatically applied by your IDE after opening the project. We also recommend turning automatic formatting on saving so all rules are applied.
29 |
30 | ## Licensing and legal rights
31 |
32 | By contributing to EventStoreDB:
33 |
34 | 1. You assert that the contribution is your original work.
35 | 2. You assert that you have the right to assign the copyright for the work.
36 | 3. You accept the [License](LICENSE.md).
37 |
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api.Tests/Carts.Api.Tests.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | true
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | all
21 | runtime; build; native; contentfiles; analyzers; buildtransitive
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api.Tests/Settings.cs:
--------------------------------------------------------------------------------
1 | using Xunit;
2 |
3 | [assembly: CollectionBehavior(DisableTestParallelization = true)]
4 |
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api/Carts.Api.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net6.0
5 | enable
6 | true
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api/Program.cs:
--------------------------------------------------------------------------------
1 | using Microsoft.AspNetCore.Hosting;
2 | using Microsoft.Extensions.Hosting;
3 | using Microsoft.Extensions.Logging;
4 |
5 | namespace Carts.Api;
6 |
7 | public class Program
8 | {
9 | public static void Main(string[] args)
10 | {
11 | CreateHostBuilder(args).Build().Run();
12 | }
13 |
14 | public static IHostBuilder CreateHostBuilder(string[] args) =>
15 | Host.CreateDefaultBuilder(args)
16 | .ConfigureWebHostDefaults(webBuilder =>
17 | {
18 | webBuilder.UseStartup();
19 | })
20 | .ConfigureLogging(logging =>
21 | {
22 | logging.ClearProviders();
23 | logging.AddConsole();
24 | });
25 | }
26 |
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "iisSettings": {
3 | "windowsAuthentication": false,
4 | "anonymousAuthentication": true,
5 | "iisExpress": {
6 | "applicationUrl": "http://localhost:38471",
7 | "sslPort": 44357
8 | }
9 | },
10 | "profiles": {
11 | "CartsApi": {
12 | "commandName": "Project",
13 | "launchBrowser": true,
14 | "launchUrl": "http://localhost:5500",
15 | "environmentVariables": {
16 | "ASPNETCORE_ENVIRONMENT": "Development"
17 | }
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api/Requests/Carts/AddProductRequest.cs:
--------------------------------------------------------------------------------
1 | namespace Carts.Api.Requests.Carts;
2 |
3 | public record AddProductRequest(
4 | ProductItemRequest? ProductItem
5 | );
6 |
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api/Requests/Carts/InitializeCartRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Carts.Api.Requests.Carts;
4 |
5 | public record InitializeCartRequest(
6 | Guid? ClientId
7 | );
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api/Requests/Carts/PricedProductItemRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Carts.Api.Requests.Carts;
4 |
5 | public record PricedProductItemRequest(
6 | Guid? ProductId,
7 | int? Quantity,
8 | decimal? UnitPrice
9 | );
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api/Requests/Carts/ProductItemRequest.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Carts.Api.Requests.Carts;
4 |
5 | public record ProductItemRequest(
6 | Guid? ProductId,
7 | int? Quantity
8 | );
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api/Requests/Carts/RemoveProduct.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace Carts.Api.Requests.Carts;
4 |
5 | public record RemoveProductRequest(
6 | Guid? CartId,
7 | PricedProductItemRequest? ProductItem
8 | );
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api/Startup.cs:
--------------------------------------------------------------------------------
1 | using Core;
2 | using Core.EventStoreDB;
3 | using Core.WebApi.Middlewares.ExceptionHandling;
4 | using Microsoft.AspNetCore.Builder;
5 | using Microsoft.AspNetCore.Hosting;
6 | using Microsoft.Extensions.Configuration;
7 | using Microsoft.Extensions.DependencyInjection;
8 | using Microsoft.Extensions.Hosting;
9 | using Microsoft.OpenApi.Models;
10 | using Newtonsoft.Json.Converters;
11 |
12 | namespace Carts.Api;
13 |
14 | public class Startup
15 | {
16 | private readonly IConfiguration config;
17 |
18 | public Startup(IConfiguration config)
19 | {
20 | this.config = config;
21 | }
22 |
23 | public void ConfigureServices(IServiceCollection services)
24 | {
25 | services.AddMvc()
26 | .AddNewtonsoftJson(opt => opt.SerializerSettings.Converters.Add(new StringEnumConverter()));
27 |
28 | services.AddControllers();
29 |
30 | services.AddSwaggerGen(c =>
31 | {
32 | c.SwaggerDoc("v1", new OpenApiInfo {Title = "Carts", Version = "v1"});
33 | });
34 |
35 | services
36 | .AddCoreServices()
37 | .AddEventStoreDBSubscriptionToAll()
38 | .AddCartsModule(config);
39 | }
40 |
41 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
42 | {
43 | if (env.IsDevelopment())
44 | {
45 | app.UseDeveloperExceptionPage();
46 | }
47 |
48 | app.UseMiddleware(typeof(ExceptionHandlingMiddleware));
49 |
50 | app.UseRouting();
51 |
52 | app.UseAuthorization();
53 |
54 | app.UseEndpoints(endpoints =>
55 | {
56 | endpoints.MapControllers();
57 | });
58 |
59 | app.UseSwagger();
60 |
61 | app.UseSwaggerUI(c =>
62 | {
63 | c.SwaggerEndpoint("/swagger/v1/swagger.json", "Carts V1");
64 | c.RoutePrefix = string.Empty;
65 | });
66 | }
67 | }
68 |
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api/appsettings.Development.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "LogLevel": {
4 | "Default": "Information",
5 | "Microsoft": "Warning",
6 | "Microsoft.Hosting.Lifetime": "Information"
7 | }
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Api/appsettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "Logging": {
3 | "IncludeScopes": false,
4 | "LogLevel": {
5 | "Default": "Debug",
6 | "System": "Information",
7 | "Microsoft": "Information"
8 | }
9 | },
10 | "AllowedHosts": "*",
11 | "EventStore": {
12 | "ConnectionString": "esdb://localhost:2113?tls=false"
13 | },
14 | "Elasticsearch": {
15 | "DefaultIndex": "carts-default",
16 | "Url": "http://localhost:9200/"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/CQRS_Flow/Dotnet/Carts/Carts.Tests/Builders/CartBuilder.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Carts.Carts;
4 | using Carts.Carts.InitializingCart;
5 |
6 | namespace Carts.Tests.Builders;
7 |
8 | internal class CartBuilder
9 | {
10 | private readonly Queue