masadonline commited on
Commit
72f0f38
·
verified ·
1 Parent(s): 1b1cf2b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -158,7 +158,7 @@ def get_latest_whatsapp_conversation_sid(client):
158
 
159
  # ---------------- Load Orders ----------------
160
  def load_orders():
161
- orders_path = "docs/orders.json"
162
  try:
163
  with open(orders_path, "r", encoding="utf-8") as f:
164
  return json.load(f)
@@ -167,10 +167,10 @@ def load_orders():
167
  return {}
168
 
169
  def extract_order_id(text):
170
- pattern = r"\bORD\d{3,}\b"
171
  match = re.search(pattern, text, re.IGNORECASE)
172
  if match:
173
- return match.group(0).upper()
174
  return None
175
 
176
  def format_order_response(order_id, order_data):
 
158
 
159
  # ---------------- Load Orders ----------------
160
  def load_orders():
161
+ orders_path = "docs/CustomersOrder.json"
162
  try:
163
  with open(orders_path, "r", encoding="utf-8") as f:
164
  return json.load(f)
 
167
  return {}
168
 
169
  def extract_order_id(text):
170
+ pattern = r"(order_id\s+\d+)"
171
  match = re.search(pattern, text, re.IGNORECASE)
172
  if match:
173
+ return match.group(1).lower()
174
  return None
175
 
176
  def format_order_response(order_id, order_data):