mirror of
https://github.com/idrainformatica/PecFlow.git
synced 2026-06-16 12:45:42 +02:00
Modifiche varie
This commit is contained in:
@@ -11,6 +11,27 @@ from pydantic import BaseModel, model_validator
|
||||
from app.schemas.label import LabelResponse
|
||||
|
||||
|
||||
# ─── Search match info ────────────────────────────────────────────────────────
|
||||
|
||||
class AttachmentMatchInfo(BaseModel):
|
||||
"""Allegato in cui e' stato trovato il termine cercato."""
|
||||
id: uuid.UUID
|
||||
filename: str
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
class SearchMatchInfo(BaseModel):
|
||||
"""Indica dove e' stato trovato il termine di ricerca in un messaggio."""
|
||||
in_subject: bool = False
|
||||
in_body: bool = False
|
||||
in_attachments: list[AttachmentMatchInfo] = []
|
||||
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
|
||||
# ─── Attachment ───────────────────────────────────────────────────────────────
|
||||
|
||||
class AttachmentResponse(BaseModel):
|
||||
id: uuid.UUID
|
||||
message_id: uuid.UUID
|
||||
@@ -59,6 +80,8 @@ class MessageResponse(BaseModel):
|
||||
created_at: datetime
|
||||
updated_at: datetime
|
||||
labels: list[LabelResponse] = []
|
||||
# Popolato solo nelle risposte di ricerca full-text
|
||||
search_match: Optional[SearchMatchInfo] = None
|
||||
|
||||
@model_validator(mode="before")
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user