perf: optimize reconciliation candidate lookup
This commit is contained in:
@@ -529,7 +529,6 @@ def add_document_lines(document_id: str, lines: Iterable[Dict[str, Any]]) -> Non
|
||||
|
||||
|
||||
def list_commercial_documents(opportunity_id: Optional[str] = None, customer_id: Optional[str] = None, limit: int = 100) -> List[Dict[str, Any]]:
|
||||
ensure_commercial_schema()
|
||||
if opportunity_id:
|
||||
from app.document_reconciliation_service import resolve_document_links
|
||||
# Canonical resolver owns the only group-complete rollout fallback.
|
||||
@@ -832,7 +831,6 @@ def unlink_customer_from_opportunity(opportunity_id: str) -> None:
|
||||
|
||||
|
||||
def get_customer_for_opportunity(opportunity_id: str) -> Optional[Dict[str, Any]]:
|
||||
ensure_commercial_schema()
|
||||
with engine.begin() as conn:
|
||||
row = conn.execute(text("""
|
||||
SELECT c.id::text, c.name, c.tax_id, c.email, c.phone, c.street_name,
|
||||
|
||||
Reference in New Issue
Block a user