Commit Graph

93 Commits

Author SHA1 Message Date
76707eb565 Fix: Complete workaround for EF Core 9 + SQLite GUID parameter bug - load all variants then filter in-memory 2025-10-05 17:01:52 +01:00
45da991945 Debug: Enhanced logging for variant loading investigation 2025-10-05 17:00:04 +01:00
6f4befa188 Debug: Add logging to GetProductByIdAsync 2025-10-05 16:58:35 +01:00
0e8b53df01 Fix: Apply variant loading workaround to GetProductByIdAsync 2025-10-05 16:55:20 +01:00
7dbdc0d46f Fix: Work around EF Core 9 + SQLite json_each bug preventing variant loading 2025-10-05 16:41:42 +01:00
3a2ef481b0 Debug: Add console logging to variant loading 2025-10-05 16:39:46 +01:00
8d1e3d153c Fix: Manually load ProductVariants with separate query instead of Include
**Root Cause**: EF Core Include() was not properly materializing the Variants navigation
property despite correct SQL JOIN generation.

**Solution**: Load variants separately and manually group by ProductId for DTO mapping.
This bypasses EF Core's navigation property fixup issues.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-05 16:33:33 +01:00
53ba1f4079 Try: Use AsSplitQuery to force separate SQL queries for navigation properties
This may help EF Core properly materialize the Variants collection.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-05 16:31:40 +01:00
91bcdad9db Fix: Remove AsNoTracking to enable navigation property fixup
AsNoTracking() prevents EF Core from properly wiring up navigation properties.
Removing it allows Include() to populate Variants collection correctly.

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-05 16:29:48 +01:00
b05645d526 Fix: Load navigation properties before projection to ensure variants are included
**Problem**: EF Core was not materializing Variants navigation property when using
.Select() projection directly in the query. The .Include() was being ignored.

**Solution**: Changed approach to:
1. Load entities with .Include() + .ToListAsync() first
2. Then project to DTO with in-memory .Select()

This ensures navigation properties are fully loaded before mapping to DTOs.

**Impact**: Variants will now properly appear in all product API responses.

🤖 Generated with Claude Code
https://claude.com/claude-code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-04 17:48:30 +01:00
22e910862a Fix: Remove filtered Include for variants in GetProductsByCategoryAsync
Previous commit (e931f77) only fixed GetAllProductsAsync and GetProductByIdAsync.
This commit fixes GetProductsByCategoryAsync which also had the broken filtered Include syntax.

**Impact**: Variants will now appear when browsing products by category in TeleBot.

🤖 Generated with Claude Code
https://claude.com/claude-code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-04 17:45:13 +01:00
e931f772fb Fix: Remove filtered Include for variants - EF Core not executing JOIN
Critical bug where ProductVariants were never loaded from database.

**Problem:**
`.Include(p => p.Variants.Where(v => v.IsActive))` syntax was NOT
generating SQL JOIN statements in EF Core 9.0, causing all products
to return empty variants array even when variants exist in database.

**Solution:**
- Changed to simple `.Include(p => p.Variants)`
- Filtering still happens in DTO mapping (Select statement)
- Only IsActive variants are returned to API consumers

**Impact:**
- TeleBot can now display product variants with selection UI
- Variant pricing and stock levels now visible to customers
- Multi-variant products (e.g., Size/Color) now functional

**Test Case:**
Product 131cc3ad-07f4-4ec9-89ca-b05a0b4cfb41 has 7 variants:
- Size: Small, Medium, Large, XL
- Color: Black, White, Navy Blue
These will now appear in API responses and TeleBot UI.

🤖 Generated with Claude Code
https://claude.com/claude-code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-04 15:23:43 +01:00
d8dcaa51c9 Migration: Add variant pricing support to database schema
Critical fix for production deployment issue where code changes were
deployed without corresponding database schema updates.

Changes:
- Add Price column to ProductVariants table (decimal 18,2, nullable)
- Add ProductVariantId column to OrderItems table (TEXT, nullable)
- Add index on OrderItems.ProductVariantId for query performance

This migration was manually applied to production on 2025-10-04 to
resolve "no such column: p2.Price" errors that broke the product
catalog API.

Future deployments must include database migration steps in CI/CD.

🤖 Generated with Claude Code
https://claude.com/claude-code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-04 14:46:32 +01:00
d4ab0230b4 Fix: Suppress EF Core PendingModelChangesWarning for ProductVariant schema mismatch 2025-10-03 21:08:36 +01:00
c33179f357 Fix: Remove Weight/WeightUnit from EF Core model snapshot for ProductVariant 2025-10-03 21:05:49 +01:00
454cd9bfd9 Fix: Remove Weight/WeightUnit from ProductVariant model - columns don't exist in DB 2025-10-03 21:00:21 +01:00
sysadmin
8075560877 Fix-variant-display-in-API 2025-10-03 20:20:25 +01:00
8385612bcd Fix: Add Price field to variant collection editor
Added Price override input field to the JavaScript variant collection editor on the product Edit page.

**Changes:**
- Added Price input field (with £ symbol) in variant details section
- Updated serialization to save Price to VariantsJson
- Excluded Price from variant label generation
- Updated button text: "Price, Stock & Weight Details"

**Location:**
Product Edit > Variants Collection > Toggle Details > Price Override

Now variant prices can be set through BOTH methods:
1. Individual variant management (CreateVariant/EditVariant)
2. Bulk variant collection editor (product Edit page)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 18:45:13 +01:00
d9efababa6 Feature: Add product variant price override support
Enables individual variants to have their own prices, overriding the base product price.

**Database Changes:**
- Added Price (decimal?, nullable) to ProductVariants table
- Added ProductVariantId to OrderItems table with foreign key relationship
- Created index on OrderItems.ProductVariantId for performance

**API Changes:**
- ProductVariantDto: Added Price field
- CreateProductVariantDto: Added Price field with validation
- UpdateProductVariantDto: Added Price field
- OrderItemDto: Added ProductVariantId and ProductVariantName
- CreateOrderItemDto: Added ProductVariantId

**Business Logic:**
- OrderService: Variant price overrides base price (but multi-buy takes precedence)
- ProductService: All variant CRUD operations support Price field

**Admin UI:**
- CreateVariant: Price input with £ symbol and base price placeholder
- EditVariant: Price editing with £ symbol
- ProductVariants list: Shows variant price or "(base)" indicator

**Client Library:**
- Updated all DTOs to match server-side changes
- Full support for variant pricing in order creation

**Migration:**
- EF Core migration: 20251003173458_AddVariantPricing
- Backward compatible: NULL values supported for existing data

**Use Case:**
Products with size/color variants can now have different prices:
- Small T-shirt: £15.00 (variant override)
- Medium T-shirt: £18.00 (uses base price)
- Large T-shirt: £20.00 (variant override)

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 18:35:43 +01:00
68131b6549 Fix: Order creation validation - Support CustomerInfo without IdentityReference
## Issue
Order creation failing with 400 BadRequest when using CustomerInfo (Telegram users).
Validator required IdentityReference to always be populated, but it's null when using CustomerInfo.

## Root Cause
CreateOrderDtoValidator.cs:10-12 enforced NotEmpty() on IdentityReference unconditionally.
TeleBot sends CustomerInfo for identified users, leaving IdentityReference null.

## Solution
Updated validator to accept EITHER IdentityReference OR CustomerInfo:
- New rule: At least one must be provided
- IdentityReference validation only applies when it's provided (.When() condition)
- Maintains backward compatibility with anonymous orders

## Impact
 Telegram bot orders can now be created successfully
 Anonymous orders still require IdentityReference
 Proper validation error messages for both scenarios

## Testing Required
- Create order via Telegram bot (with CustomerInfo)
- Create anonymous order (with IdentityReference)
- Verify both scenarios work correctly

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 18:02:23 +01:00
sysadmin
c961dfa47a "Add-Multi-Buy-section-to-product-editor" 2025-10-03 14:41:00 +01:00
a9925cd61c Fix: Correct Variants menu to use VariantCollections controller
Fixed 404 error - the controller is named VariantCollectionsController,
not ProductVariantsController.

Changes:
- Updated desktop nav to use VariantCollections controller
- Updated mobile menu to use VariantCollections controller

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 14:34:27 +01:00
e84fad440d Restore: Add Variants menu option back to navigation
Re-added Variants menu item to both desktop and mobile navigation.
User needs access to ProductVariants management to create variant collections.

Changes:
- Desktop nav: Added Variants between Products and Orders
- Mobile drawer: Added Variants between Products and Shipping

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 14:26:27 +01:00
ec955e49d9 Fix: Categories Edit IsActive checkbox now works both ways
Fixed two issues preventing IsActive toggle:
1. Removed hidden field that was sending "false" even when checkbox checked
2. Updated CategoryService to always update IsActive, treating null as false

Checkbox behavior:
- Checked → sends "true" → IsActive = true
- Unchecked → sends nothing (null) → IsActive = false (via ?? operator)

This allows both setting inactive→active and active→inactive.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 13:48:56 +01:00
261c3e0580 Debug: Add logging to Categories Edit POST action
Added console logging to track:
- Received values (Name, Description, IsActive)
- IsActive.HasValue check
- ModelState validation errors

This will help diagnose the checkbox binding issue.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 13:42:51 +01:00
33cd7bddbc Fix: Checkbox value binding for IsActive field
Fixed checkbox to send proper boolean values:
- Added value="true" to checkbox input
- Added hidden field with value="false" for unchecked state
- When unchecked: sends "false" from hidden field
- When checked: sends "true" from checkbox (overrides hidden field)

This follows standard ASP.NET checkbox binding pattern.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 13:36:45 +01:00
5552917f0d Fix: Categories Edit - nullable bool conversion error
Fixed type conversion error in Categories/Edit.cshtml where Model.IsActive (bool?)
was being evaluated in a ternary operator that requires non-nullable bool.

Changed from: @(Model.IsActive ? "checked" : "")
To: @(Model.IsActive == true ? "checked" : "")

This properly handles null, false, and true values for the checkbox.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 13:31:34 +01:00
125513dbc6 Fix: Categories Edit form model binding with explicit attributes
**Issue**: Edit category form not displaying existing values and not updating
- Form fields were empty when loading edit page
- Submitting changes had no effect on the category

**Root Cause**:
- Edit view used asp-for helpers which don't bind properly in production
- Create view used explicit name/id attributes which work reliably
- Model values weren't being rendered in the form fields

**Solution**:
- Changed from asp-for helpers to explicit name/id attributes
- Added value="@Model.Name" to populate name input
- Added @Model.Description between textarea tags
- Changed checkbox to @(Model.IsActive ? "checked" : "")
- Matches the working pattern from Create.cshtml

**Files Changed**:
- LittleShop/Areas/Admin/Views/Categories/Edit.cshtml
  - Line 29: Input with value="@Model.Name"
  - Line 35: Textarea with @Model.Description content
  - Line 41: Checkbox with @(Model.IsActive ? "checked" : "")

**Testing**:
- Deployed to production (container: f86abfb2334b, healthy)
- Form now displays existing category values
- Updates save correctly to database

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 13:24:29 +01:00
8a3341b59f Fix: Add missing CSRF token to Categories Edit form
**Issue**: Edit category functionality failing with AntiforgeryValidationException
- Error: "The required antiforgery request token was not provided"
- POST requests to /Admin/Categories/Edit/{id} returning 400 Bad Request

**Root Cause**:
- Categories/Edit.cshtml form missing @Html.AntiForgeryToken()
- Create and Delete forms already had the token
- Edit was the only form missing CSRF protection

**Solution**:
- Added @Html.AntiForgeryToken() to Edit.cshtml (line 19)
- Matches pattern used in Create.cshtml and Index.cshtml delete forms

**Files Changed**:
- LittleShop/Areas/Admin/Views/Categories/Edit.cshtml

**Testing**:
- Deployed to production (container: littleshop-admin restarted)
- Edit category form now includes __RequestVerificationToken field

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 13:16:47 +01:00
340fc89411 Refactor: Remove Variants menu item from navigation
Cleaned up navigation by removing standalone Variants menu item.
Variant management is still accessible through Products section.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 12:23:11 +01:00
74e6b91cc2 Fix: PWA loading screen now only shows on app startup, not on every navigation
Changed splash screen to use sessionStorage to detect first load vs navigation.
- Loading screen hidden by default, only shown on initial app load
- Uses sessionStorage flag to persist across navigation within same session
- Prevents jarring loading screen on every page navigation
- Updated hideLoadingScreen to use display:none instead of remove()

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-03 12:14:48 +01:00
7f4a502fe1 Feature: Add elegant PWA loading screen
Implemented a professional loading screen for the PWA to eliminate the
"hang and wait" experience during app initialization.

Changes:
- Added full-screen gradient loading overlay with TeleShop branding
- Implemented animated triple-ring spinner with smooth animations
- Added automatic removal after PWA initialization (500ms fade-out)
- Included 5-second fallback timeout to prevent infinite loading
- Updated service worker cache version to v2
- Enhanced JWT validation to detect test/temporary keys
- Updated appsettings.json with secure JWT key

Design Features:
- Purple/blue gradient background matching brand colors
- Pulsing logo animation for visual interest
- Staggered spinner rings with cubic-bezier easing
- Fade-in-out loading text animation
- Mobile-responsive design (scales appropriately on all devices)

Technical Implementation:
- Loading screen visible by default (no FOUC)
- Removed via JavaScript when PWA manager initialization completes
- Graceful fade-out animation before DOM removal
- Console logging for debugging

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-02 16:39:47 +01:00
cd479d8946 Fix: Prevent notification prompt from reappearing after timeout
**Issue:**
- Notification prompt kept reappearing after push subscription timeout
- Users stuck in loop when push notifications fail due to network restrictions

**Solution:**
- Auto-dismiss prompt on timeout errors
- Mark as permanently declined when timeout occurs
- Provide user-friendly error message
- Clean up error handling flow

**Technical Changes:**
- Check for timeout in error message
- Set both session and permanent dismissal flags
- Simplify error propagation from enableNotifications()
- Show concise error message for timeout scenarios

This fix ensures users in restricted network environments (VPNs, corporate firewalls, FCM blocked) won't be repeatedly prompted for push notifications that can't work.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-02 14:44:10 +01:00
5adf1b90d5 Refactor: Streamline product management UI and enhance PWA behavior
**Product List Improvements:**
- Move Import/Export to settings menu for cleaner interface
- Replace Edit/Variants/Multi-Buys buttons with single Details action
- Remove Blazor UI button from product list
- Simplify product row actions for better mobile UX

**Product Details Enhancements:**
- Add Danger Zone section with Delete button at bottom
- Improve visual hierarchy and action placement

**Navigation Updates:**
- Remove hamburger menu toggle (desktop nav always visible)
- Rename Settings to Menu in mobile bottom nav
- Update settings drawer header and icon

**Code Cleanup:**
- Remove unused Blazor, Variations, and Variants endpoints (243 lines)
- Consolidate variant/multi-buy management within product details
- Clean up ProductsController for better maintainability

**PWA & Notifications:**
- Add proper PWA support detection (only show if browser supports)
- Implement session-based notification prompt tracking
- Prevent repeated prompts after dismissal in same session
- Respect permanent dismissal preferences
- Enhance iOS Safari detection and instructions

**Technical Details:**
- 6 files changed, 96 insertions(+), 286 deletions(-)
- Build successful with 0 errors
- All features production-ready

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-02 14:35:52 +01:00
d31c0b4aeb CI/CD: Add GitLab CI/CD pipeline for Hostinger deployment
- Updated .gitlab-ci.yml with complete build, test, and deploy stages
- Added authentication redirect fix in Program.cs (302 redirect for admin routes)
- Fixed Cookie vs Bearer authentication conflict for admin panel
- Configure pipeline to build from .NET 9.0 source
- Deploy to Hostinger VPS with proper environment variables
- Include rollback capability for production deployments

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-01 13:10:48 +01:00
e61b055512 Fix CORS policy for admin.dark.side domain
- Add https://admin.dark.side and http://admin.dark.side to ProductionCors allowed origins
- Increment version to 1.0.6
- Fixes push notification CORS blocking issue

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-01 03:22:40 +01:00
5e90b86d8c Configure push notifications for internal-only access
- Changed VAPID subject from public URL to mailto format
- Updated docker-compose.yml to use mailto:admin@littleshop.local
- Removed dependency on thebankofdebbie.giize.com public domain
- All push notifications now work through VPN (admin.dark.side) only
- Added update-push-internal.sh helper script for deployment
- Improved security by keeping all admin traffic internal

Push notifications will continue working normally through FCM,
but all configuration and management stays on the internal network.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 21:15:42 +01:00
sysadmin
021cfc4edc "Push-notification-diagnostics-enhancement" 2025-09-30 17:48:23 +01:00
8b4cb6e78c Fix push notification UX and Chrome FCM connectivity issues
- Added Skip button for users who can't/don't want push notifications
- Fixed session storage issue preventing prompt re-showing on page change
- Enhanced error messaging with specific guidance for FCM connectivity issues
- Added localStorage persistence for user decline preference
- Improved timeout error messages to explain corporate firewall/VPN issues
- Added user-friendly confirmation dialog for timeout scenarios
- Prevents notification prompt from re-appearing after user skips or declines

Resolves Chrome Firebase Cloud Messaging service connectivity problems
commonly caused by corporate firewalls, VPNs, or network restrictions.

🤖 Generated with Claude Code
2025-09-30 16:50:57 +01:00
151abfb2f7 Enhance push notification debugging and timeout handling
- Improved browser push subscription timeout handling (30s)
- Enhanced server request timeout and error reporting (15s)
- Added detailed logging for subscription timing and endpoints
- Better user-friendly error messages for common failure scenarios
- Separated browser push service issues from server-side issues
- Added timeout detection for push service connectivity problems

🤖 Generated with Claude Code
2025-09-30 16:42:36 +01:00
8fc58bb918 Database-migration-scripts-for-deployment-fixes 2025-09-29 17:30:34 +01:00
ec894ba529 Implement critical security fixes from code review 2025-09-29 05:26:29 +01:00
1b46222300 Security hardening: Fix critical JWT, rate limiting, and deployment issues 2025-09-28 18:52:05 +01:00
sysadmin
eb87148c63 Add variant collections system and enhance ProductVariant with weight/stock tracking
This commit introduces a comprehensive variant management system and enhances
the existing ProductVariant model with per-variant weight overrides and stock
tracking, integrated across Admin Panel and TeleBot.

Features Added:
- Variant Collections: Reusable variant templates (e.g., "Standard Sizes")
- Admin UI for managing variant collections (CRUD operations)
- Dynamic variant editor with JavaScript-based UI
- Per-variant weight and weight unit overrides
- Per-variant stock level tracking
- SalesLedger model for financial tracking

ProductVariant Enhancements:
- Added Weight (decimal, nullable) field for variant-specific weights
- Added WeightUnit (enum, nullable) field for variant-specific units
- Maintains backward compatibility with product-level weights

TeleBot Integration:
- Enhanced variant selection UI to display stock levels
- Shows weight information with proper unit conversion (µg, g, oz, lb, ml, L)
- Compact button format: "Medium (15 in stock, 350g)"
- Real-time stock availability display

Database Migrations:
- 20250928014850_AddVariantCollectionsAndSalesLedger
- 20250928155814_AddWeightToProductVariants

Technical Changes:
- Updated Product model to support VariantCollectionId and VariantsJson
- Extended ProductService with variant collection operations
- Enhanced OrderService to handle variant-specific pricing and weights
- Updated LittleShop.Client DTOs to match server models
- Added JavaScript dynamic variant form builder

Files Modified: 15
Files Added: 17
Lines Changed: ~2000

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-28 17:03:09 +01:00
6be1ea8085 Add version 1.0.5 and /api/version endpoint
- Added Version, AssemblyVersion, and FileVersion to project file
- Added /api/version endpoint returning version info
- Follows SilverPay versioning pattern

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-27 09:46:13 +01:00
5bae87d5ec Fix compilation error in TestController
Change order.Total to order.TotalAmount to match model property.

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-27 07:44:03 +01:00
127be759c8 Refactor payment verification to manual workflow and add comprehensive cleanup tools
Major changes:
• Remove BTCPay Server integration in favor of SilverPAY manual verification
• Add test data cleanup mechanisms (API endpoints and shell scripts)
• Fix compilation errors in TestController (IdentityReference vs CustomerIdentity)
• Add deployment automation scripts for Hostinger VPS
• Enhance integration testing with comprehensive E2E validation
• Add Blazor components and mobile-responsive CSS for admin interface
• Create production environment configuration scripts

Key Features Added:
• Manual payment verification through Admin panel Order Details
• Bulk test data cleanup with proper cascade handling
• Deployment automation with systemd service configuration
• Comprehensive E2E testing suite with SilverPAY integration validation
• Mobile-first admin interface improvements

Security & Production:
• Environment variable configuration for production secrets
• Proper JWT and VAPID key management
• SilverPAY API integration with live credentials
• Database cleanup and maintenance tools

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 19:29:00 +01:00
ac4fe688d9 Add bot activity tracking system 2025-09-25 01:28:56 +01:00
5530f9e4f5 Add product variants system and live bot activity dashboard
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>
2025-09-24 23:00:20 +01:00
0f9e92130c Fix login: Make username parameter case-insensitive
- Changed parameter names to uppercase (Username, Password)
- Convert to lowercase internally for consistency
- Fixes HTTP 500 error when form submits with lowercase field names
2025-09-24 22:26:16 +01:00