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
View File
@@ -141,7 +141,6 @@ class Mail(Base, TenantMixin):
received_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)
sent_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)
contact_id: Mapped[uuid.UUID | None] = mapped_column(PGUUID(as_uuid=True), nullable=True)
company_id: Mapped[uuid.UUID | None] = mapped_column(PGUUID(as_uuid=True), nullable=True)
deleted_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)
-3
View File
@@ -1451,13 +1451,10 @@ async def link_mail(
await _check_delegate_access(db, account, user_id, "write")
if data.contact_id:
mail.contact_id = _parse_uuid(data.contact_id, "contact_id")
if data.company_id:
mail.company_id = _parse_uuid(data.company_id, "company_id")
await db.flush()
return {
"linked": True,
"contact_id": str(mail.contact_id) if mail.contact_id else None,
"company_id": str(mail.company_id) if mail.company_id else None,
}
-2
View File
@@ -176,7 +176,6 @@ class MailResponse(BaseModel):
received_at: datetime | None = None
sent_at: datetime | None = None
contact_id: str | None = None
company_id: str | None = None
attachments: list[dict] = Field(default_factory=list)
labels: list[dict] = Field(default_factory=list)
@@ -190,7 +189,6 @@ class MailListResponse(BaseModel):
class MailLinkRequest(BaseModel):
contact_id: str | None = None
company_id: str | None = None
class MailMoveRequest(BaseModel):
-1
View File
@@ -2032,7 +2032,6 @@ def mail_to_response(
"received_at": mail.received_at,
"sent_at": mail.sent_at,
"contact_id": str(mail.contact_id) if mail.contact_id else None,
"company_id": str(mail.company_id) if mail.company_id else None,
"attachments": [],
"labels": [],
}