- Initialize project with uv, FastAPI, and libsql-client for Turso persistence - Implement local SQLite fallback (`file:local.db`) for zero-friction development and testing - Create schema and seeder with 9 therapy services from Armonía del Ser flyer - Implement POST /bookings with automatic WhatsApp deep-link generation and SPEI instructions - Implement POST /payments/verify 1-tap admin acknowledgment flow - Add automated test suite with 5 passing tests and verification gates (ruff, pyright, pytest)
25 lines
645 B
Python
25 lines
645 B
Python
from __future__ import annotations
|
|
|
|
from fastapi import APIRouter, status
|
|
|
|
from app.db.database import get_db
|
|
|
|
router = APIRouter(prefix="/health", tags=["Health"])
|
|
|
|
|
|
@router.get("", status_code=status.HTTP_200_OK)
|
|
async def health_check():
|
|
"""Health check endpoint confirming service and database connectivity."""
|
|
db_status = "ok"
|
|
try:
|
|
async with get_db() as client:
|
|
await client.execute("SELECT 1;")
|
|
except Exception as e:
|
|
db_status = f"unhealthy: {e}"
|
|
|
|
return {
|
|
"status": "ok" if db_status == "ok" else "degraded",
|
|
"database": db_status,
|
|
"service": "armonia-api",
|
|
}
|