Fred808 commited on
Commit
565ba8c
·
verified ·
1 Parent(s): 1e9924e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -29
app.py CHANGED
@@ -464,35 +464,7 @@ def process_order_flow(user_id: str, message: str) -> str:
464
  asyncio.create_task(log_order_tracking(order_id, "Order Placed", "Order placed and awaiting payment."))
465
 
466
 
467
- # Check if the message contains an order ID (e.g., "ord-123456789")
468
- order_id_match = re.search(r"ord-\d+", message.lower())
469
- if order_id_match:
470
- order_id = order_id_match.group(0)
471
- # Fetch order tracking details
472
- async def fetch_order_tracking():
473
- async with async_session() as session:
474
- result = await session.execute(
475
- select(OrderTracking)
476
- .where(OrderTracking.order_id == order_id)
477
- .order_by(OrderTracking.timestamp)
478
- )
479
- tracking_updates = result.scalars().all()
480
- if tracking_updates:
481
- return tracking_updates
482
- return None
483
-
484
- tracking_updates = await fetch_order_tracking()
485
- if tracking_updates:
486
- response = "📦 *Order Tracking Details:*\n"
487
- for update in tracking_updates:
488
- response += (
489
- f"• *Status:* {update.status}\n"
490
- f"• *Message:* {update.message or 'No additional details'}\n"
491
- f"• *Timestamp:* {update.timestamp}\n\n"
492
- )
493
- return response
494
- else:
495
- return f"⚠️ Sorry, we couldn't find tracking details for order ID: {order_id}."
496
 
497
  # Notify management of the new order via WhatsApp
498
  async def notify_management_order(order_details: dict):
 
464
  asyncio.create_task(log_order_tracking(order_id, "Order Placed", "Order placed and awaiting payment."))
465
 
466
 
467
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
 
469
  # Notify management of the new order via WhatsApp
470
  async def notify_management_order(order_details: dict):