feat: create message capture policies

This commit is contained in:
h
2026-05-29 16:47:02 +02:00
parent 62aac0bf32
commit 920a0235e2
15 changed files with 700 additions and 5 deletions
+53
View File
@@ -48,3 +48,56 @@ class Message(SQLModel, table=True):
deleted_at: datetime | None = Field(
default=None, sa_column=Column(DateTime(timezone=True))
)
class Folder(SQLModel, table=True):
__tablename__ = "folders"
account_id: int = Field(primary_key=True)
folder_id: int = Field(primary_key=True)
title: str
order_index: int
is_chatlist: bool = False
raw: dict[str, Any] = Field(
default_factory=dict, sa_column=Column(JSONB, nullable=False)
)
updated_at: datetime = Field(
sa_column=Column(
DateTime(timezone=True),
nullable=False,
server_default=func.now(),
onupdate=func.now(),
)
)
class CapturePolicy(SQLModel, table=True):
__tablename__ = "capture_policy"
id: int | None = Field(default=None, primary_key=True)
account_id: int | None = None
scope_type: str
scope_id: int | None = Field(default=None, sa_column=Column(BigInteger))
messages: bool = False
media: bool = False
self_destruct_media: bool = False
stt: bool = False
reactions: bool = False
track_edits_deletes: bool = False
profile_history: bool = False
stories: bool = False
presence: bool = False
backfill: bool = False
created_at: datetime = Field(
sa_column=Column(
DateTime(timezone=True), nullable=False, server_default=func.now()
)
)
updated_at: datetime = Field(
sa_column=Column(
DateTime(timezone=True),
nullable=False,
server_default=func.now(),
onupdate=func.now(),
)
)