amazon-transcreation/backend/app/models/source.py
DJP 98fa16bfc3 feat: complete Phase 1-2 scaffold — backend, frontend, pipeline skeleton
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>
2026-04-10 12:31:43 -04:00

30 lines
1.2 KiB
Python

import uuid
from sqlalchemy import Boolean, ForeignKey, Integer, String, Text
from sqlalchemy.orm import Mapped, mapped_column, relationship
from app.models.base import Base, TimestampMixin, generate_uuid
class SourceLine(Base, TimestampMixin):
__tablename__ = "source_lines"
id: Mapped[uuid.UUID] = mapped_column(
primary_key=True, default=generate_uuid
)
job_id: Mapped[uuid.UUID] = mapped_column(
ForeignKey("jobs.id", ondelete="CASCADE"), nullable=False
)
row_order: Mapped[int] = mapped_column(Integer, nullable=False)
en_gb: Mapped[str] = mapped_column(Text, nullable=False)
copy_type: Mapped[str | None] = mapped_column(String(100), nullable=True)
creative_guidance: Mapped[str | None] = mapped_column(Text, nullable=True)
visual_ref: Mapped[str | None] = mapped_column(String(500), nullable=True)
char_limit: Mapped[str | None] = mapped_column(String(50), nullable=True)
is_display_format: Mapped[bool] = mapped_column(Boolean, default=False)
# Relationships
job = relationship("Job", back_populates="source_lines")
output_rows = relationship(
"OutputRow", back_populates="line", lazy="selectin", cascade="all, delete-orphan"
)