diff --git a/backend/app/schemas/webhook.py b/backend/app/schemas/webhook.py new file mode 100644 index 0000000..399178c --- /dev/null +++ b/backend/app/schemas/webhook.py @@ -0,0 +1,24 @@ +"""Webhook schemas.""" +from pydantic import BaseModel, Field +from typing import Optional, List +from datetime import datetime + + +class WebhookCreate(BaseModel): + url: str = Field(..., min_length=1, max_length=500) + events: str = '["task_completed","review_pending","budget_alert"]' + secret: Optional[str] = None + project_id: Optional[int] = None + + +class WebhookResponse(BaseModel): + id: int + project_id: Optional[int] = None + url: str + events: str + secret: Optional[str] = None + is_active: bool + tenant_id: int + created_at: datetime + + model_config = {"from_attributes": True}