Implement product multi-buys and variants system

Major restructuring of product variations:
- Renamed ProductVariation to ProductMultiBuy for quantity-based pricing (e.g., "3 for £25")
- Added new ProductVariant model for string-based options (colors, flavors)
- Complete separation of multi-buy pricing from variant selection

Features implemented:
- Multi-buy deals with automatic price-per-unit calculation
- Product variants for colors/flavors/sizes with stock tracking
- TeleBot checkout supports both multi-buys and variant selection
- Shopping cart correctly calculates multi-buy bundle prices
- Order system tracks selected variants and multi-buy choices
- Real-time bot activity monitoring with SignalR
- Public bot directory page with QR codes for Telegram launch
- Admin dashboard shows multi-buy and variant metrics

Technical changes:
- Updated all DTOs, services, and controllers
- Fixed cart total calculation for multi-buy bundles
- Comprehensive test coverage for new functionality
- All existing tests passing with new features

Database changes:
- Migrated ProductVariations to ProductMultiBuys
- Added ProductVariants table
- Updated OrderItems to track variants

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-21 00:30:12 +01:00
parent 7683b7dfe5
commit 034b8facee
46 changed files with 3190 additions and 332 deletions

View File

@@ -50,9 +50,10 @@ public class OrderItemDto
{
public Guid Id { get; set; }
public Guid ProductId { get; set; }
public Guid? ProductVariationId { get; set; }
public Guid? ProductMultiBuyId { get; set; }
public string ProductName { get; set; } = string.Empty;
public string? ProductVariationName { get; set; }
public string? ProductMultiBuyName { get; set; }
public string? SelectedVariant { get; set; }
public int Quantity { get; set; }
public decimal UnitPrice { get; set; }
public decimal TotalPrice { get; set; }
@@ -94,7 +95,9 @@ public class CreateOrderItemDto
[Required]
public Guid ProductId { get; set; }
public Guid? ProductVariationId { get; set; } // Optional: if specified, use variation pricing
public Guid? ProductMultiBuyId { get; set; } // Optional: if specified, use multi-buy pricing
public string? SelectedVariant { get; set; } // Optional: variant choice (color/flavor)
[Range(1, int.MaxValue)]
public int Quantity { get; set; }