feat: create message capture policies
This commit is contained in:
@@ -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(),
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user