Automated Action 609e7fb237 Implement retail management and payment API with FastAPI
This API provides endpoints for:
- Product and inventory management
- Customer management
- Order processing
- Payment processing with Stripe integration
- User authentication

generated with BackendIM... (backend.im)
2025-05-12 12:00:19 +00:00

31 lines
697 B
Python

from typing import Any, Dict
from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session
from app.api import deps
from app.db.session import SessionLocal
router = APIRouter()
@router.get("/health", response_model=Dict[str, Any])
def health_check(db: Session = Depends(deps.get_db)) -> Any:
"""
Check API health status
"""
# Check database connection
db_status = "healthy"
try:
# Execute a simple query
db.execute("SELECT 1")
except Exception as e:
db_status = f"unhealthy: {str(e)}"
return {
"status": "ok",
"components": {
"database": db_status
},
"version": "0.1.0"
}