template
This commit is contained in:
parent
8901d99dd2
commit
29d867438c
7 changed files with 645 additions and 5 deletions
|
|
@ -644,6 +644,34 @@ class WhatsAppMessageTemplate(Base):
|
|||
)
|
||||
|
||||
|
||||
class WhatsAppBroadcastJob(Base):
|
||||
"""A CSV broadcast that sends in paced batches and reports progress while it runs."""
|
||||
|
||||
__tablename__ = "whatsapp_broadcast_jobs"
|
||||
|
||||
id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
user_id: Mapped[uuid.UUID] = mapped_column(ForeignKey("user_accounts.id", ondelete="CASCADE"), index=True)
|
||||
account_id: Mapped[uuid.UUID] = mapped_column(
|
||||
ForeignKey("whatsapp_business_accounts.id", ondelete="CASCADE"), index=True
|
||||
)
|
||||
filename: Mapped[str] = mapped_column(String(200))
|
||||
country_code: Mapped[str] = mapped_column(String(8), default="91")
|
||||
template_name: Mapped[str] = mapped_column(String(512))
|
||||
template_language: Mapped[str] = mapped_column(String(16), default="en")
|
||||
product_policy: Mapped[str] = mapped_column(String(32), default="STRICT")
|
||||
use_sample_header: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
body_parameters: Mapped[list] = mapped_column(JSON, default=list)
|
||||
recipients: Mapped[list] = mapped_column(JSON, default=list)
|
||||
status: Mapped[str] = mapped_column(String(24), default="processing", index=True)
|
||||
total: Mapped[int] = mapped_column(default=0)
|
||||
sent_count: Mapped[int] = mapped_column(default=0)
|
||||
failed_count: Mapped[int] = mapped_column(default=0)
|
||||
next_index: Mapped[int] = mapped_column(default=0)
|
||||
last_error: Mapped[str | None] = mapped_column(String(500), nullable=True)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now(), index=True)
|
||||
completed_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)
|
||||
|
||||
|
||||
class WhatsAppConnectionAudit(Base):
|
||||
__tablename__ = "whatsapp_connection_audits"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue