Phase 1 (Foundation): - Project restructure (presenton-main → backend/ + frontend/) - Database schema (8 new models, Alembic config, seed script) - Auth (Azure AD SSO + dev bypass, JWT sessions, AuthMiddleware) - RBAC (access_service, rbac_middleware, admin routers) - Audit logging (fire-and-forget, AuditMiddleware, admin router) - i18n (react-i18next with 5 namespace files) Phase 2 (Admin Panel & Client Management): - Admin panel shell (sidebar layout, role guard, 12 pages) - Redux admin slice with 18 async thunks - User management (role changes, deactivation) - Client management (CRUD, brand config, team management) - Brand config editor (colors, fonts, logos, voice rules) - Master deck upload & parser (PPTX → HTML → React pipeline) - Audit log viewer with filters and CSV/JSON export Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
from datetime import datetime
|
|
from typing import Optional
|
|
import uuid
|
|
from sqlalchemy import DateTime, ForeignKey
|
|
from sqlmodel import Field, Column, JSON, SQLModel
|
|
|
|
|
|
class SlideModel(SQLModel, table=True):
|
|
__tablename__ = "slides"
|
|
|
|
id: uuid.UUID = Field(primary_key=True, default_factory=uuid.uuid4)
|
|
presentation: uuid.UUID = Field(
|
|
sa_column=Column(ForeignKey("presentations.id", ondelete="CASCADE"), index=True)
|
|
)
|
|
layout_group: str
|
|
layout: str
|
|
index: int
|
|
content: dict = Field(sa_column=Column(JSON))
|
|
html_content: Optional[str]
|
|
speaker_note: Optional[str] = None
|
|
properties: Optional[dict] = Field(sa_column=Column(JSON))
|
|
deleted_at: Optional[datetime] = Field(
|
|
sa_column=Column(DateTime(timezone=True), nullable=True), default=None
|
|
)
|
|
|
|
def get_new_slide(self, presentation: uuid.UUID, content: Optional[dict] = None):
|
|
return SlideModel(
|
|
id=uuid.uuid4(),
|
|
presentation=presentation,
|
|
layout_group=self.layout_group,
|
|
layout=self.layout,
|
|
index=self.index,
|
|
speaker_note=self.speaker_note,
|
|
content=content or self.content,
|
|
properties=self.properties,
|
|
)
|