- Frontend: Next.js 14 with TypeScript - Backend: FastAPI with SQLAlchemy - Agent: Carmodoo sync agent - Deployment: Docker Compose based staging/production setup - Scripts: Automated deployment with rollback support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
53 lines
1.2 KiB
Python
53 lines
1.2 KiB
Python
from pydantic import BaseModel
|
|
from typing import Optional, List
|
|
from datetime import datetime
|
|
|
|
|
|
class TranslationCreate(BaseModel):
|
|
source_text: str
|
|
category: str
|
|
text_en: Optional[str] = None
|
|
text_mn: Optional[str] = None
|
|
text_ru: Optional[str] = None
|
|
|
|
|
|
class TranslationUpdate(BaseModel):
|
|
source_text: Optional[str] = None
|
|
category: Optional[str] = None
|
|
text_en: Optional[str] = None
|
|
text_mn: Optional[str] = None
|
|
text_ru: Optional[str] = None
|
|
|
|
|
|
class TranslationResponse(BaseModel):
|
|
id: int
|
|
source_text: str
|
|
category: str
|
|
text_en: Optional[str] = None
|
|
text_mn: Optional[str] = None
|
|
text_ru: Optional[str] = None
|
|
created_at: datetime
|
|
updated_at: datetime
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
|
|
|
|
class TranslationListResponse(BaseModel):
|
|
total: int
|
|
page: int
|
|
page_size: int
|
|
translations: List[TranslationResponse]
|
|
|
|
|
|
class TranslationBulkRequest(BaseModel):
|
|
"""Bulk translation lookup request"""
|
|
texts: List[str]
|
|
category: Optional[str] = None
|
|
lang: str = "en"
|
|
|
|
|
|
class TranslationBulkResponse(BaseModel):
|
|
"""Returns a dictionary mapping source text to translated text"""
|
|
translations: dict # {source_text: translated_text}
|