|
@@ -365,7 +365,6 @@ export const appRouter = router({
|
|
|
// 2. "my orders" / "recent orders" — needs customer CID on conversation
|
|
// 2. "my orders" / "recent orders" — needs customer CID on conversation
|
|
|
} else if (/\b(my orders?|recent orders?|order history|order status|help with my order|check.*order|view.*order|see.*order|show.*order)\b/.test(msgLower)) {
|
|
} else if (/\b(my orders?|recent orders?|order history|order status|help with my order|check.*order|view.*order|see.*order|show.*order)\b/.test(msgLower)) {
|
|
|
const cid = ctx.user?.erpContactCid ?? (conversation as any).customerId as string | undefined;
|
|
const cid = ctx.user?.erpContactCid ?? (conversation as any).customerId as string | undefined;
|
|
|
- console.log(`[ERP] intent=my_orders user=${ctx.user?.id ?? "anon"} role=${userCtx.role} cid=${cid ?? "none"}`);
|
|
|
|
|
if (cid) {
|
|
if (cid) {
|
|
|
erpContext = await lookupOrdersByCustomer(cid, 5, userCtx);
|
|
erpContext = await lookupOrdersByCustomer(cid, 5, userCtx);
|
|
|
} else {
|
|
} else {
|