Full-stack Amazon AI Transcreation Platform with: - FastAPI backend (async, PostgreSQL, Redis, Celery) with 11 DB tables - JWT auth (SSO-ready abstract provider pattern) - 6-agent pipeline orchestrator with deterministic modules - Next.js 14 frontend with Amazon branding (Ember fonts, orange/dark theme) - Job wizard, monitoring HUD, output review, admin screens - 154 TM/reference files imported, 12 locales configured - Docker Compose for all services Agents 2-5 (TM retrieval, ranker, transcreator, compliance) are stubs pending Phase 3 LLM integration. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
89 lines
3.1 KiB
Python
89 lines
3.1 KiB
Python
import enum
|
|
import uuid
|
|
from datetime import datetime
|
|
|
|
from sqlalchemy import DateTime, Enum, ForeignKey, Integer, String, func
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
|
|
from app.models.base import Base, generate_uuid
|
|
|
|
|
|
class ReferenceFileType(str, enum.Enum):
|
|
glossary = "glossary"
|
|
blacklist = "blacklist"
|
|
tov_global = "tov_global"
|
|
tov_supplement = "tov_supplement"
|
|
locale_considerations = "locale_considerations"
|
|
date_pct_formats = "date_pct_formats"
|
|
|
|
|
|
class TMFileRegistry(Base):
|
|
__tablename__ = "tm_file_registry"
|
|
|
|
id: Mapped[uuid.UUID] = mapped_column(
|
|
primary_key=True, default=generate_uuid
|
|
)
|
|
client_id: Mapped[uuid.UUID] = mapped_column(
|
|
ForeignKey("clients.id", ondelete="CASCADE"), nullable=False
|
|
)
|
|
locale_code: Mapped[str] = mapped_column(String(10), nullable=False)
|
|
channel: Mapped[str] = mapped_column(String(100), nullable=False)
|
|
filename: Mapped[str] = mapped_column(String(255), nullable=False)
|
|
file_path: Mapped[str] = mapped_column(String(500), nullable=False)
|
|
segment_count: Mapped[int] = mapped_column(Integer, default=0)
|
|
uploaded_by: Mapped[uuid.UUID | None] = mapped_column(
|
|
ForeignKey("users.id"), nullable=True
|
|
)
|
|
uploaded_at: Mapped[datetime] = mapped_column(
|
|
DateTime(timezone=True),
|
|
server_default=func.now(),
|
|
nullable=False,
|
|
)
|
|
last_updated_at: Mapped[datetime] = mapped_column(
|
|
DateTime(timezone=True),
|
|
server_default=func.now(),
|
|
onupdate=func.now(),
|
|
nullable=False,
|
|
)
|
|
version: Mapped[int] = mapped_column(Integer, default=1)
|
|
|
|
# Relationships
|
|
client = relationship("Client", back_populates="tm_files")
|
|
uploader = relationship("User", foreign_keys=[uploaded_by])
|
|
|
|
|
|
class ReferenceFile(Base):
|
|
__tablename__ = "reference_files"
|
|
|
|
id: Mapped[uuid.UUID] = mapped_column(
|
|
primary_key=True, default=generate_uuid
|
|
)
|
|
client_id: Mapped[uuid.UUID] = mapped_column(
|
|
ForeignKey("clients.id", ondelete="CASCADE"), nullable=False
|
|
)
|
|
file_type: Mapped[ReferenceFileType] = mapped_column(
|
|
Enum(ReferenceFileType, name="reference_file_type", create_constraint=True),
|
|
nullable=False,
|
|
)
|
|
locale_scope: Mapped[str] = mapped_column(String(10), nullable=False)
|
|
filename: Mapped[str] = mapped_column(String(255), nullable=False)
|
|
file_path: Mapped[str] = mapped_column(String(500), nullable=False)
|
|
uploaded_by: Mapped[uuid.UUID | None] = mapped_column(
|
|
ForeignKey("users.id"), nullable=True
|
|
)
|
|
uploaded_at: Mapped[datetime] = mapped_column(
|
|
DateTime(timezone=True),
|
|
server_default=func.now(),
|
|
nullable=False,
|
|
)
|
|
last_updated_at: Mapped[datetime] = mapped_column(
|
|
DateTime(timezone=True),
|
|
server_default=func.now(),
|
|
onupdate=func.now(),
|
|
nullable=False,
|
|
)
|
|
version: Mapped[int] = mapped_column(Integer, default=1)
|
|
|
|
# Relationships
|
|
client = relationship("Client", back_populates="reference_files")
|
|
uploader = relationship("User", foreign_keys=[uploaded_by])
|