feat(retry): allow retry for MALFORMED orders

MALFORMED is now a valid retry source alongside ERROR / SKIPPED /
DELETED_IN_ROA. The next sync will re-run validate_structural and
either reclassify or keep the MALFORMED tag — either way, operators
get the same "Retry" button they have for other failure paths
without needing a separate UI affordance.

278 unit + 33 e2e green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-04-22 09:16:16 +00:00
parent bb6f3a3b87
commit 7e30523242

View File

@@ -159,8 +159,10 @@ async def retry_single_order(order_number: str, app_settings: dict) -> dict:
order_data = detail["order"]
status = order_data.get("status", "")
if status not in (OrderStatus.ERROR.value, OrderStatus.SKIPPED.value, OrderStatus.DELETED_IN_ROA.value):
return {"success": False, "message": f"Retry permis doar pentru ERROR/SKIPPED/DELETED_IN_ROA (status actual: {status})"}
if status not in (OrderStatus.ERROR.value, OrderStatus.SKIPPED.value,
OrderStatus.DELETED_IN_ROA.value, OrderStatus.MALFORMED.value):
return {"success": False,
"message": f"Retry permis doar pentru ERROR/SKIPPED/DELETED_IN_ROA/MALFORMED (status actual: {status})"}
order_date_str = order_data.get("order_date", "")
customer_name = order_data.get("customer_name", "")