- endpointy /workdays/add, is-workday, next, previous, between - /holidays, /countries (filtr eu), /markets, /health, /version - data svatku z knihovny holidays 0.109, vsech 27 zemi EU vcetne regionu - vychozi zeme CZ a cestina pres DEFAULT_COUNTRY a DEFAULT_LANGUAGE - vlastni vikend, extra_holidays a extra_workdays v requestu - testy logiky, API a testy proti realnym kalendarum - CLAUDE.md s povinnym overenim vysledku proti realite - dokumentace ve slozce documentation - .gitignore: vyjimka pro app/lib
36 lines
980 B
Python
36 lines
980 B
Python
"""Health and version endpoints required by AppFactory."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from fastapi import APIRouter
|
|
|
|
from ..config import get_settings
|
|
from ..models import HealthResponse
|
|
from ..services.calendars import library_version
|
|
|
|
router = APIRouter(tags=["service"])
|
|
|
|
|
|
@router.get("/health", response_model=HealthResponse, summary="Stav sluzby")
|
|
def health() -> HealthResponse:
|
|
settings = get_settings()
|
|
return HealthResponse(
|
|
status="ok",
|
|
app=settings.app_name,
|
|
version=settings.app_version,
|
|
holidays_library=library_version(),
|
|
default_country=settings.default_country,
|
|
)
|
|
|
|
|
|
@router.get("/version", summary="Verze a zakladni informace o sluzbe")
|
|
def version() -> dict:
|
|
settings = get_settings()
|
|
return {
|
|
"app": settings.app_name,
|
|
"version": settings.app_version,
|
|
"language": "python",
|
|
"root_path": settings.root_path,
|
|
"holidays_library": library_version(),
|
|
}
|