feat(bot,wizard): smart message filtering, encrypted standalone wizard, and file persistence

This commit is contained in:
2026-09-30 00:49:04 +03:30
parent 0a7db5ebe9
commit 07643dbdf5
13 changed files with 750 additions and 56 deletions
+13
View File
@@ -135,3 +135,16 @@ class ErpClient:
return (await self._request(
"PATCH", f"/quotes/{quote_id}/reject", json={"reason": reason} if reason else None, actor_id=actor_id
)).get("data") or {}
async def upload_quote_file(self, quote_id: str, kind: str, file_name: str, content: bytes,
mime_type: str = "application/pdf", actor_id: str | None = None) -> dict:
url = f"{self._base}/quotes/{quote_id}/{kind}"
files = {"file": (file_name, content, mime_type)}
async with httpx.AsyncClient(timeout=self._timeout) as client:
try:
resp = await client.post(url, files=files, headers=self._actor_headers(actor_id, None))
if resp.status_code in (200, 201):
return resp.json()
except Exception as e:
logger.warning("Failed to upload quote attachment to ERP: %s", e)
return {}