feat: add board webhook configuration and payload models
This commit is contained in:
26
backend/app/models/board_webhooks.py
Normal file
26
backend/app/models/board_webhooks.py
Normal file
@@ -0,0 +1,26 @@
|
||||
"""Board webhook configuration model."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from uuid import UUID, uuid4
|
||||
|
||||
from sqlmodel import Field
|
||||
|
||||
from app.core.time import utcnow
|
||||
from app.models.base import QueryModel
|
||||
|
||||
RUNTIME_ANNOTATION_TYPES = (datetime,)
|
||||
|
||||
|
||||
class BoardWebhook(QueryModel, table=True):
|
||||
"""Inbound webhook endpoint configuration for a board."""
|
||||
|
||||
__tablename__ = "board_webhooks" # pyright: ignore[reportAssignmentType]
|
||||
|
||||
id: UUID = Field(default_factory=uuid4, primary_key=True)
|
||||
board_id: UUID = Field(foreign_key="boards.id", index=True)
|
||||
description: str
|
||||
enabled: bool = Field(default=True, index=True)
|
||||
created_at: datetime = Field(default_factory=utcnow)
|
||||
updated_at: datetime = Field(default_factory=utcnow)
|
||||
Reference in New Issue
Block a user