Bright.Checkout is a flexible and extensible supermarket checkout system implemented in C#. It handles product pricing, including special offers, and provides a simple command-line interface for scanning items and calculating totals.
Troughout development, notes on thought process and design decisions were included in BrightCheckout\Notes.txt
- Product management of SKU items(Add or Update)
- Support for multibuy offers on products with flexible pricing rules that can be updated for each checkout transaction
- Scanning of items in any order for basket
- Dependency injection used extensively throughout (mostly through primary constructor injection)
- Clone the repository
- Open the solution in your IDE
- Restore nuget packages (dotnet restore)
- Build the solution
- Run the tests to ensure everything is working correctly
- Run solution in console
-
Bright.Checkout/
: Main project directoryContracts/
: Interfaces for core functionality and servicesCore/
: Core business logic handlersData/
: Data access layerExtensions/
: Extension methods for various classesHelpers/
: Helper classes for common operationsModel/
: Data modelsServices/
: Service implementations
-
Bright.Checkout.Tests/
: Test project directoryUnit/
: Unit tests for various components
├─ Bright.Checkout
│ ├─ Contracts
│ │ ├─ Core
│ │ │ ├─ ICheckoutHandler.cs
│ │ │ ├─ ICustomProductHandler.cs
│ │ │ ├─ IPricingRuleHandler.cs
│ │ ├─ Data
│ │ │ ├─ IProductRepository.cs
│ │ ├─ Services
│ │ │ ├─ ICheckoutService.cs
│ │ │ ├─ IProductService.cs
│ ├─ Core
│ │ ├─ CheckoutHandler.cs
│ │ ├─ CustomProductHandler.cs
│ │ ├─ PricingRuleHandler.cs
│ ├─ Data
│ │ ├─ ProductRepository.cs
│ ├─ Extensions
│ │ ├─ BasketItemExtensions.cs
│ │ ├─ ConsoleExtensions.cs
│ │ ├─ ProductExtensions.cs
│ ├─ Helpers
│ │ ├─ DefaultProductHelper.cs
│ │ ├─ PricingRuleHelper.cs
│ │ ├─ ProductHelper.cs
│ ├─ Model
│ │ ├─ BasketItem.cs
│ │ ├─ PricingRule.cs
│ │ ├─ Product.cs
│ ├─ Services
│ │ ├─ CheckoutService.cs
│ │ ├─ ProductService.cs
│ ├─ Application.cs
│ ├─ Dockerfile
│ ├─ Program.cs
├─ Bright.Checkout.Tests
│ ├─ Unit
│ │ ├─ Data
│ │ │ ├─ ProductRepositoryTests.cs
│ │ ├─ Extensions
│ │ │ ├─ BasketItemExtensionsTests.cs
│ │ ├─ Helpers
│ │ │ ├─ PricingRuleHelperTests.cs
│ │ │ ├─ ProductHelperTests.cs
│ │ ├─ Services
│ │ │ ├─ CheckoutServiceTests.cs