feat(bot): overhaul quote review card template with Jalali dates and DB-aligned validations

This commit is contained in:
2026-09-29 01:30:26 +03:30
parent 1b5fc589fd
commit 17458d8697
4 changed files with 258 additions and 63 deletions
+13 -1
View File
@@ -91,7 +91,19 @@ class Resolver:
async def suppliers(self, q: str | None = None) -> list[Candidate]:
rows = await self._api.list_suppliers(q=q, page_size=20)
items = [Candidate(id=str(s["id"]), name=s.get("name") or str(s["id"])) for s in rows]
items = [
Candidate(
id=str(s["id"]),
name=s.get("name") or str(s["id"]),
extra={
"location": s.get("location"),
"phone": s.get("phone"),
"contact_person": s.get("contact_person"),
"category_name": (s.get("category") or {}).get("name") if isinstance(s.get("category"), dict) else None,
},
)
for s in rows
]
return _rank(q, items) if q else items
async def materials(self, q: str | None = None) -> list[Candidate]: