- New models: WarrantyModel, WalletModel, SystemConfigModel - New schemas: WarrantySchema, RefundSchema, SystemConfig, CrmTaskCalendar, NotificationTemplate, NotificationGateway, RepairErp, ReviewModeration, InventoryPos, MultiDashboard, BillingFinance - New services: WarrantyService, RefundService, CrmService, CrmTaskCalendarService, DeliveryService, EmailTemplateService, InventoryPosService, MultiDashboardService, NotificationGatewayService, RepairErpService, ReviewModerationService, SystemConfigService, TemplateService, CreditService - Updated routers: AdminOrder, BillingFinance, Cart, Catalog, Checkout, Crm, InventoryPos, NotificationGateway, RolePermission, ServiceJob, Settings, Storefront, UserCreation - Updated models: Inventory, Notification, Order, Product, Service, Setting, SystemConfig, User - Updated core: database init, invoice generator, main app - Added WarrantyRouter with full CRUD and claim flow
46 lines
1.3 KiB
Python
46 lines
1.3 KiB
Python
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]
|