Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ 1 auto register modules and endpoints #21

Conversation

danielmackay
Copy link
Member

No description provided.

* Create new warehouse module

* Moved Warehouse.Application to Warehouse.Module

* Tidied up shared kernel

* Moved domain into Warehouse module

* Move Warehouse Endpoints into Warehouse Module

* Move Warehouse Endpoints to Warehouse Module

* Remove Order Application project

* Move Order Domain to Order Module

* Move Orders Endpoints to Orders Module
…20)

Tidied up modules so that only module registration code is public
* Update product catalog and add product creation tests

Adjusted README to remove redundant price requirement. Refactored the Product and Category classes for better encapsulation and added unit tests for product creation in the Catalog module.

* Add unit tests for Category creation in Catalog module

Introduce tests to ensure Category creation throws exceptions for null, empty, and whitespace names. Also, verify correct Category creation with valid name.

* Refactor out validation method calls.

Replaced custom validation methods with built-in `ArgumentOutOfRangeException.ThrowIfNegativeOrZero` for better clarity and consistency. Also adjusted loop indices to start from 1 instead of 0 in `Bay` and `Aisle` class methods.
Refactored the Cart and CartItem classes to include methods for adding, removing, and updating items, along with maintaining the total price. Modified the warehouse middleware initialization to be synchronous, and added unit tests for CartItem.
Introduced a read-only property for cart items and extended the `UpdateTotal()` method to handle empty carts. Additionally, created unit tests covering add, remove, and update operations to ensure cart functionality works as expected.

#28
Introduced new Payment and PaymentType classes to handle order payments. Updated the Order class with comprehensive methods for handling subtotals, shipping, and tax. Reorganized the directory structure for better modularity and clarity.

#28
Implemented detailed unit tests for LineItem, Payment, and Order classes to ensure correct behavior and error handling. Also, updated OrderStatus enum and enhanced payment creation logic for improved validation.

#28
Improved validation by replacing custom `Throw().IfEmpty()` calls with standard library methods like `ArgumentException.ThrowIfNullOrWhiteSpace()`. Added invariants for the `Customer` class and made email and name update methods private, ensuring encapsulation. Updated the README for clarity and consistency.

#27
Made `UpdateName` and `UpdateEmail` methods public to facilitate testing. Added various tests for customer creation, name update, email update, and address update scenarios. Included new AddressTests to validate address initialization and error handling.
Merged the tests from `AisleTests.cs` into `ModelTests.cs` and renamed it to `Storage/AisleTests.cs` for better organization. Deleted the old `AisleTests.cs` file to avoid duplication.
* ✨ Add custom Aisle configuration and update database setup

Refactor database seeding to include new Aisle configurations and custom storage command. Moving the database initializer to a new tools project enhances modularity and clarity in database seeding procedures. Additionally, some configurations in existing entities and properties have been updated accordingly.

* ✨ Add StronglyTypedId support to warehouse module

Introduced StronglyTypedId conversion and configuration in the warehouse module. Updated entity creation methods and DbContext to use StronglyTypedId. Enhanced entity configurations and added Product DbSet to WarehouseDbContext.

* ✨ Enable product seeding and remove commented-out code

Re-enabled the `SeedProductsAsync` method to allow seeding products in the database. Removed commented-out code for clarity and maintainability. Simplified the aisle seeding logic for better readability.
Added necessary dependencies and configurations for integration testing in the Warehouse module. Implemented a new integration test for creating aisles, ensuring correct behavior and database interactions.

#29
Added `ICurrentUserService` and `EntitySaveChangesInterceptor` to enhance audit logging in the persistence layer. Integrated these into the application by updating dependencies and ensuring proper initialization in DI setup.
Updated MediatR behaviors to include `ResultValidationBehavior`, replaced `ValidationBehaviour`, and integrated the ErrorOr package across the solution. Added new tests for invalid requests and refactored existing classes to support the ErrorOr type.

#29
Refactored the product creation logic and moved endpoint mappings from the Products module to a new UseCases module. Removed unused repository and command files. Improved validation and error handling for product creation.
Implement methods for adding and removing stock in the `Product` class, returning an error when attempting to remove more stock than available. Add unit tests to ensure proper functionality and error handling, ensuring product initialization and stock adjustments are covered.

#30
Introduced a global error handler to improve error management across the application. Also, updated multiple dependencies to the latest versions and made minor adjustments to the database container initialization process for increased reliability.
Updated the GitHub Actions workflow file to use .NET version 9.0.x instead of 8.0.x. This ensures compatibility with new features and improvements in the latest .NET release.
Updated the GitHub Actions workflow to use the latest version of the setup-dotnet action. This ensures compatibility with the latest .NET 9.0.x features and improvements.
* Start using EF migrations

* Update test setup to use migrations and add retry to test container start.

* Add catalog back to Database project

* Fix async code in test container retry

* Add tests back in
* Started adding feature to orders module

* Fix build

* Added create cart integration test

* Got test working

* Added test for adding a product to an existing cart.

* Added validator tests
* Add in aspire projects

* Add API project reference

* Add in SQL server Aspire integration

* Added migration project for creating, migrating and seeding SQL data

* added catalog initializer to MigrationService

* Removed unneeded code

* Ensure seeding only happens in dev environment

* Tidy up

* Got DB Seeding for warehouse to work

* Removed docker compose and up script.

* Add aspire client package to catalog and warehouse modules

* Params in product search is now optional

* Temporarily remove DbContext.OnConfiguring() call

* Got API working with Aspire

* Fix DbContext pooling problem

* Remove Database project

* Add DbContextPooling for tests

* Refactor Migration initialization code

* Fixed DbContext Pooling issue with Customers and Orders

* Convert customers and orders to use Aspire

* Fixed up tests

* Add aspire workload to GitHub action

* Fix aspire command
# Conflicts:
#	src/Modules/Warehouse/Modules.Warehouse/WarehouseModule.cs
#	src/WebApi/Program.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant