implementando openAI y busqueda de productos en woo

This commit is contained in:
Lucas Tettamanti
2026-01-05 11:15:56 -03:00
parent 829823ac3d
commit dab52492b4
9 changed files with 570 additions and 48 deletions

13
src/handlers/products.js Normal file
View File

@@ -0,0 +1,13 @@
import { searchProducts } from "../services/wooProducts.js";
export async function handleSearchProducts({ tenantId, q = "", limit = "10", forceWoo = "0" }) {
const { items, source } = await searchProducts({
tenantId,
q,
limit: parseInt(limit, 10) || 10,
forceWoo: String(forceWoo) === "1" || String(forceWoo).toLowerCase() === "true",
});
return { items, source };
}