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>
60 lines
2 KiB
Python
60 lines
2 KiB
Python
import enum
|
|
import uuid
|
|
|
|
from sqlalchemy import Enum, ForeignKey, String
|
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
|
|
from app.models.base import Base, TimestampMixin, generate_uuid
|
|
|
|
|
|
class UserRole(str, enum.Enum):
|
|
admin = "admin"
|
|
tm_manager = "tm_manager"
|
|
reviewer = "reviewer"
|
|
|
|
|
|
class UserStatus(str, enum.Enum):
|
|
active = "active"
|
|
inactive = "inactive"
|
|
|
|
|
|
class User(Base, TimestampMixin):
|
|
__tablename__ = "users"
|
|
|
|
id: Mapped[uuid.UUID] = mapped_column(
|
|
primary_key=True, default=generate_uuid
|
|
)
|
|
email: Mapped[str] = mapped_column(String(255), unique=True, nullable=False)
|
|
name: Mapped[str] = mapped_column(String(255), nullable=False)
|
|
password_hash: Mapped[str] = mapped_column(String(255), nullable=False)
|
|
role: Mapped[UserRole] = mapped_column(
|
|
Enum(UserRole, name="user_role", create_constraint=True),
|
|
nullable=False,
|
|
)
|
|
status: Mapped[UserStatus] = mapped_column(
|
|
Enum(UserStatus, name="user_status", create_constraint=True),
|
|
default=UserStatus.active,
|
|
nullable=False,
|
|
)
|
|
|
|
# Relationships
|
|
user_clients = relationship("UserClient", back_populates="user", lazy="selectin")
|
|
jobs_created = relationship("Job", back_populates="creator", lazy="selectin")
|
|
feedback = relationship("Feedback", back_populates="user", lazy="selectin")
|
|
audit_logs = relationship("AuditLog", back_populates="user", lazy="selectin")
|
|
|
|
|
|
class UserClient(Base):
|
|
__tablename__ = "user_clients"
|
|
|
|
user_id: Mapped[uuid.UUID] = mapped_column(
|
|
ForeignKey("users.id", ondelete="CASCADE"), primary_key=True
|
|
)
|
|
client_id: Mapped[uuid.UUID] = mapped_column(
|
|
ForeignKey("clients.id", ondelete="CASCADE"), primary_key=True
|
|
)
|
|
role_override: Mapped[str | None] = mapped_column(String(50), nullable=True)
|
|
|
|
# Relationships
|
|
user = relationship("User", back_populates="user_clients")
|
|
client = relationship("Client", back_populates="user_clients")
|