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>
31 lines
1.6 KiB
C#
31 lines
1.6 KiB
C#
using LittleShop.DTOs;
|
|
|
|
namespace LittleShop.Services;
|
|
|
|
public interface IProductService
|
|
{
|
|
Task<IEnumerable<ProductDto>> GetAllProductsAsync();
|
|
Task<IEnumerable<ProductDto>> GetProductsByCategoryAsync(Guid categoryId);
|
|
Task<ProductDto?> GetProductByIdAsync(Guid id);
|
|
Task<ProductDto> CreateProductAsync(CreateProductDto createProductDto);
|
|
Task<bool> UpdateProductAsync(Guid id, UpdateProductDto updateProductDto);
|
|
Task<bool> DeleteProductAsync(Guid id);
|
|
Task<bool> AddProductPhotoAsync(Guid productId, IFormFile file, string? altText = null);
|
|
Task<ProductPhotoDto?> AddProductPhotoAsync(CreateProductPhotoDto photoDto);
|
|
Task<bool> RemoveProductPhotoAsync(Guid productId, Guid photoId);
|
|
Task<IEnumerable<ProductDto>> SearchProductsAsync(string searchTerm);
|
|
|
|
// Product Multi-Buys
|
|
Task<ProductMultiBuyDto> CreateProductMultiBuyAsync(CreateProductMultiBuyDto createMultiBuyDto);
|
|
Task<bool> UpdateProductMultiBuyAsync(Guid id, UpdateProductMultiBuyDto updateMultiBuyDto);
|
|
Task<bool> DeleteProductMultiBuyAsync(Guid id);
|
|
Task<IEnumerable<ProductMultiBuyDto>> GetProductMultiBuysAsync(Guid productId);
|
|
Task<ProductMultiBuyDto?> GetProductMultiBuyByIdAsync(Guid id);
|
|
|
|
// Product Variants
|
|
Task<ProductVariantDto> CreateProductVariantAsync(CreateProductVariantDto createVariantDto);
|
|
Task<bool> UpdateProductVariantAsync(Guid id, UpdateProductVariantDto updateVariantDto);
|
|
Task<bool> DeleteProductVariantAsync(Guid id);
|
|
Task<IEnumerable<ProductVariantDto>> GetProductVariantsAsync(Guid productId);
|
|
Task<ProductVariantDto?> GetProductVariantByIdAsync(Guid id);
|
|
} |