Restructured create_letzshop_order to follow the "validate first, then write"
architecture pattern:
Phase 1 (Read-only validation):
- Check if order already exists
- Parse all inventory units and collect GTINs
- Batch query all products by GTIN (single query instead of N queries)
- Validate all products exist - raise ValidationException BEFORE any writes
Phase 2 (Database writes):
- Only after all validation passes, create customer, order, and items
This ensures if validation fails, no database modifications happen, so the
endpoint/task simply doesn't commit - no rollback needed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>