Phase 1C: Frontend unified contact UI

This commit is contained in:
Agent Zero
2026-07-23 17:17:32 +02:00
parent a8331fbc2b
commit 879106c4eb
62 changed files with 552 additions and 1276 deletions
+1 -1
View File
@@ -142,7 +142,7 @@ async def deep_analysis(
# All mails for company
mail_result = await db.execute(
select(Mail)
.where(Mail.company_id == eid)
.where(Mail.contact_id == eid)
.where(Mail.tenant_id == tid)
.order_by(Mail.received_at.desc())
.limit(30)
@@ -260,10 +260,10 @@ async def gather_context(
)
context["thread"] = [_serialize_row(m) for m in thread_result.scalars().all()]
if mail and mail.company_id:
if mail and mail.contact_id:
comp_result = await db.execute(
select(Company)
.where(Company.id == mail.company_id)
.where(Company.id == mail.contact_id)
.where(Company.tenant_id == tenant_id)
.limit(1)
)
@@ -307,7 +307,7 @@ async def gather_context(
mail_result = await db.execute(
select(Mail)
.where(Mail.company_id == entity_id)
.where(Mail.contact_id == entity_id)
.where(Mail.tenant_id == tenant_id)
.order_by(Mail.received_at.desc())
.limit(10)
@@ -321,7 +321,7 @@ async def gather_context(
event_result = await db.execute(
select(CalendarEntry)
.join(CalendarEntryLink, CalendarEntryLink.entry_id == CalendarEntry.id)
.where(CalendarEntryLink.entity_type == "company")
.where(CalendarEntryLink.entity_type == "contact")
.where(CalendarEntryLink.entity_id == entity_id)
.where(CalendarEntry.tenant_id == tenant_id)
.where(CalendarEntry.start_at > now)