## 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>
1.8 KiB
1.8 KiB