from typing import Optional, List, Dict, Any from pydantic import BaseModel, Field class NotificationTemplateBase(BaseModel): event_key: str = Field(..., max_length=50) name: str = Field(..., max_length=100) channel: str = Field(..., max_length=20) subject: Optional[str] = Field(None, max_length=255) body_content: str is_active: bool = True class NotificationTemplateCreate(NotificationTemplateBase): pass class NotificationTemplateUpdate(BaseModel): name: Optional[str] = Field(None, max_length=100) subject: Optional[str] = Field(None, max_length=255) body_content: Optional[str] = None is_active: Optional[bool] = None class NotificationTemplateResponse(NotificationTemplateBase): template_id: str tenant_id: str variables: List[str] created_at: Any updated_at: Any class Config: from_attributes = True class NotificationTemplatePreviewRequest(BaseModel): context: Dict[str, Any] class NotificationTemplatePreviewResponse(BaseModel): subject: Optional[str] body: str class EventVariableSchema(BaseModel): name: str description: str example: str class EventRegistryResponse(BaseModel): event_key: str description: str variables: List[EventVariableSchema]