privacy policy and business integration
This commit is contained in:
parent
141ca9fda3
commit
cd3751219d
16 changed files with 1592 additions and 30 deletions
|
|
@ -1,7 +1,7 @@
|
|||
import uuid
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Boolean, DateTime, ForeignKey, Numeric, String, UniqueConstraint, func
|
||||
from sqlalchemy import Boolean, DateTime, ForeignKey, Numeric, String, Text, UniqueConstraint, func
|
||||
from sqlalchemy.dialects.postgresql import JSON, UUID
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
|
|
@ -508,3 +508,32 @@ class WhatsAppWebhookEvent(Base):
|
|||
status: Mapped[str | None] = mapped_column(String(32), nullable=True)
|
||||
payload: Mapped[dict] = mapped_column(JSON)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now(), index=True)
|
||||
|
||||
|
||||
class WhatsAppMessage(Base):
|
||||
"""Inbound and outbound WhatsApp messages for Urmi's business number."""
|
||||
|
||||
__tablename__ = "whatsapp_messages"
|
||||
|
||||
id: Mapped[uuid.UUID] = mapped_column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
direction: Mapped[str] = mapped_column(String(16), index=True)
|
||||
wa_message_id: Mapped[str | None] = mapped_column(String(128), nullable=True, index=True)
|
||||
from_number: Mapped[str] = mapped_column(String(32), index=True)
|
||||
to_number: Mapped[str] = mapped_column(String(32), index=True)
|
||||
body: Mapped[str | None] = mapped_column(String(4096), nullable=True)
|
||||
message_type: Mapped[str] = mapped_column(String(24), default="text")
|
||||
status: Mapped[str] = mapped_column(String(24), default="received", index=True)
|
||||
payload: Mapped[dict | None] = mapped_column(JSON, nullable=True)
|
||||
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), server_default=func.now(), index=True)
|
||||
|
||||
|
||||
class PlatformSetting(Base):
|
||||
"""Runtime overrides for platform credentials (admin-editable)."""
|
||||
|
||||
__tablename__ = "platform_settings"
|
||||
|
||||
key: Mapped[str] = mapped_column(String(64), primary_key=True)
|
||||
value: Mapped[str] = mapped_column(Text, default="")
|
||||
updated_at: Mapped[datetime] = mapped_column(
|
||||
DateTime(timezone=True), server_default=func.now(), onupdate=func.now()
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue