16 lines
697 B
Python
16 lines
697 B
Python
"""Webhook config model."""
|
|
from sqlalchemy import Column, String, Integer, Text, Boolean, ForeignKey
|
|
from app.models.base import Base, TimestampMixin, TenantMixin
|
|
|
|
|
|
class WebhookConfig(Base, TimestampMixin, TenantMixin):
|
|
"""Webhook subscription for external integrations."""
|
|
__tablename__ = "webhook_configs"
|
|
|
|
id = Column(Integer, primary_key=True, autoincrement=True)
|
|
project_id = Column(Integer, ForeignKey("projects.id"), nullable=True)
|
|
url = Column(String(500), nullable=False)
|
|
events = Column(Text, default="[]") # JSON: ["task_completed","review_pending","budget_alert"]
|
|
secret = Column(String(200), nullable=True)
|
|
is_active = Column(Boolean, default=True)
|