Files
orion/app
Samir Boulahtit e0a0da85f8 fix: validate products before creating order to follow architecture rules
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>
2025-12-19 21:59:18 +01:00
..