littleshop/LittleShop/Validators
SysAdmin 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
..
CreateOrderDtoValidator.cs Fix: Order creation validation - Support CustomerInfo without IdentityReference 2025-10-03 18:02:23 +01:00
CreateProductDtoValidator.cs Implement complete e-commerce functionality with shipping and order management 2025-08-20 17:37:24 +01:00
LoginDtoValidator.cs Implement complete e-commerce functionality with shipping and order management 2025-08-20 17:37:24 +01:00