mirror of
https://github.com/latinogino/dolibarr-mcp.git
synced 2026-05-01 05:45:35 +02:00
feat(search): add server-side search tools for products and customers (BLOCKER-1)
This commit is contained in:
@@ -272,6 +272,12 @@ class DolibarrClient:
|
||||
# CUSTOMER/THIRD PARTY MANAGEMENT
|
||||
# ============================================================================
|
||||
|
||||
async def search_customers(self, sqlfilters: str, limit: int = 20) -> List[Dict[str, Any]]:
|
||||
"""Search customers using SQL filters."""
|
||||
params = {"limit": limit, "sqlfilters": sqlfilters}
|
||||
result = await self.request("GET", "thirdparties", params=params)
|
||||
return result if isinstance(result, list) else []
|
||||
|
||||
async def get_customers(self, limit: int = 100, page: int = 1) -> List[Dict[str, Any]]:
|
||||
"""Get list of customers/third parties."""
|
||||
params = {"limit": limit}
|
||||
@@ -330,6 +336,12 @@ class DolibarrClient:
|
||||
# PRODUCT MANAGEMENT
|
||||
# ============================================================================
|
||||
|
||||
async def search_products(self, sqlfilters: str, limit: int = 20) -> List[Dict[str, Any]]:
|
||||
"""Search products using SQL filters."""
|
||||
params = {"limit": limit, "sqlfilters": sqlfilters}
|
||||
result = await self.request("GET", "products", params=params)
|
||||
return result if isinstance(result, list) else []
|
||||
|
||||
async def get_products(self, limit: int = 100) -> List[Dict[str, Any]]:
|
||||
"""Get list of products."""
|
||||
params = {"limit": limit}
|
||||
|
||||
Reference in New Issue
Block a user