Ordering
This microservice is a service that will support the customer ordering flow, it'll serve all order-related logic.
Prerequisites
Familiarity with C# and .NET
Familiarity with DDD and CQRS
Getting Started
Clone the repository:
git clone https://versioning.advans-group.com/owneat/owneat.gitInstall dependencies:
dotnet restoreCreate a local database and run the schema migration scripts located in the
Infrastructure/MigrationsdirectorySet the necessary configuration values in the
appsettings.jsonandappsettings.Development.jsonfiles, including the connection string for the database.Run the microservice:
dotnet run.
Architecture
The Ordering microservice is built using Domain-Driven Design (DDD) principles and follows a Command-Query Responsibility Segregation (CQRS) pattern.
The Ordering microservice is built with C# and .NET, and follows a microservices architecture. It uses a database to store ordering data.
The CQRS handlers in the Ordering microservice have their own test classes, which use xUnit, Fluent Assertion, and the Handle_ShouldDo_when pattern for testing. Each CQRS handler has its own test file.
The Ordering microservice uses the IOptions<> pattern to retrieve data from the appsettings.json and appsettings.json.development files.
Testing
To run the test suite, use the following command: dotnet test This microservice uses MOQ to mock the database and all the dependencies e.g.: repositories.
This allows us to test the behavior of the service without actually interacting with the database.