FEATURES IMPLEMENTED: 1. Product Multi-Buys (renamed from Variations for clarity) - Quantity-based pricing deals (e.g., 1 for £10, 3 for £25) - Renamed UI to "Multi-Buys" with tags icon for better understanding 2. Product Variants (NEW) - Support for colors, flavors, sizes, and other product options - Separate from multi-buys - these are the actual variations customers choose - Admin UI for managing variants per product - Updated OrderItem model to store selected variants as JSON array 3. Live Bot Activity Dashboard - Real-time view of customer interactions across all bots - Shows active users (last 5 minutes) - Live activity feed with user actions - Statistics including today's activities and trending products - Auto-refreshes every 5 seconds for live updates - Accessible via "Live Activity" menu item TECHNICAL CHANGES: - Modified OrderItem.SelectedVariant to SelectedVariants (JSON array) - Added BotActivityController for dashboard endpoints - Created views for variant management (ProductVariants, CreateVariant, EditVariant) - Updated Products Index to show separate buttons for Multi-Buys and Variants - Fixed duplicate DTO definitions (removed duplicate files) - Fixed ApplicationDbContext reference (changed to LittleShopContext) UI IMPROVEMENTS: - Multi-Buys: Tags icon, labeled as "pricing deals" - Variants: Palette icon, labeled as "colors/flavors" - Live dashboard with animated activity feed - Visual indicators for active users and trending products - Mobile-responsive dashboard layout This update provides the foundation for: - Customers selecting variants during checkout - Real-time monitoring of bot usage patterns - Better understanding of popular products and user behavior Next steps: Implement variant selection in TeleBot checkout flow 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
32 lines
947 B
C#
32 lines
947 B
C#
using System.ComponentModel.DataAnnotations;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace LittleShop.Models;
|
|
|
|
public class OrderItem
|
|
{
|
|
[Key]
|
|
public Guid Id { get; set; }
|
|
|
|
public Guid OrderId { get; set; }
|
|
|
|
public Guid ProductId { get; set; }
|
|
|
|
public Guid? ProductMultiBuyId { get; set; } // Nullable for backward compatibility
|
|
|
|
[StringLength(500)]
|
|
public string? SelectedVariants { get; set; } // JSON array of variants chosen (e.g., ["Red", "Blue", "Green"] for multi-buy)
|
|
|
|
public int Quantity { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,2)")]
|
|
public decimal UnitPrice { get; set; }
|
|
|
|
[Column(TypeName = "decimal(18,2)")]
|
|
public decimal TotalPrice { get; set; }
|
|
|
|
// Navigation properties
|
|
public virtual Order Order { get; set; } = null!;
|
|
public virtual Product Product { get; set; } = null!;
|
|
public virtual ProductMultiBuy? ProductMultiBuy { get; set; }
|
|
} |