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

🌱 Up script #19

Closed
wants to merge 26 commits into from
Closed

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.
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.
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.
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.
@danielmackay danielmackay deleted the up-script branch August 25, 2024 00:43
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