gendesign/tradein-mvp/backend/app/api/v1/version.py
lekss361 8423af5dd5
All checks were successful
Deploy Trade-In / changes (push) Successful in 11s
Deploy Trade-In / build-browser (push) Successful in 36s
Deploy Trade-In / build-frontend (push) Successful in 2m23s
Deploy Trade-In / test (push) Successful in 3m14s
Deploy Trade-In / build-backend (push) Successful in 4m19s
Deploy Trade-In / deploy (push) Successful in 1m44s
feat(tradein): версионирование продукта — единый источник, подвал, PDF, /versions (#2824)
2026-08-10 16:00:54 +00:00

20 lines
875 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"""GET /api/v1/trade-in/version — build metadata (product version + short SHA +
build date), source `app/core/version.py`.
Публичный (без авторизации, см. `app/core/rbac.py::_PUBLIC_PATHS`) — это не
секрет, а быстрая справка для клиента/поддержки/смоук-теста, читающая только
process env / уже загруженные при импорте константы (без похода в БД)."""
from __future__ import annotations
from fastapi import APIRouter
from app.core.version import APP_VERSION, BUILD_DATE, BUILD_SHA
router = APIRouter()
@router.get("/version")
def get_version() -> dict[str, str]:
"""{"version": "1.0.0", "sha": "a1b2c3d", "built_at": "2026-08-10T12:00:00Z"}."""
return {"version": APP_VERSION, "sha": BUILD_SHA, "built_at": BUILD_DATE}