feat(gateway): add Slack external chat platform

This commit is contained in:
Anish Sarkar 2026-06-01 12:35:52 +05:30
parent 389a51d494
commit b0b0f3517b
2 changed files with 115 additions and 1 deletions

View file

@ -577,6 +577,7 @@ class ChatVisibility(StrEnum):
class ExternalChatPlatform(StrEnum):
TELEGRAM = "telegram"
WHATSAPP = "whatsapp"
SLACK = "slack"
SIGNAL = "signal"
@ -888,7 +889,18 @@ class ExternalChatAccount(Base, TimestampMixin):
"uq_external_chat_accounts_system_platform",
"platform",
unique=True,
postgresql_where=text("is_system_account = true"),
postgresql_where=text(
"is_system_account = true AND NOT (cursor_state ? 'team_id')"
),
),
Index(
"uq_external_chat_accounts_slack_team",
"platform",
text("(cursor_state ->> 'team_id')"),
unique=True,
postgresql_where=text(
"is_system_account = true AND cursor_state ? 'team_id'"
),
),
Index(
"uq_external_chat_accounts_webhook_secret",