feat: Fix nutrition service and add location-based alerts
All checks were successful
continuous-integration/drone/push Build is passing

Changes:
- Fix nutrition service: add is_active column and Pydantic validation for UUID/datetime
- Add location-based alerts feature: users can now see alerts within 1km radius
- Fix CORS and response serialization in nutrition service
- Add getCurrentLocation() and loadAlertsNearby() functions
- Improve UI for nearby alerts display with distance and response count
This commit is contained in:
2025-12-13 16:34:50 +09:00
parent 3050e084fa
commit cfc93cb99a
34 changed files with 7016 additions and 17 deletions

View File

@@ -62,6 +62,14 @@ async def health_check():
return {"status": "healthy", "service": "user_service"}
@app.get("/users")
async def get_all_users(db: AsyncSession = Depends(get_db)):
"""Get all users (public endpoint for testing)"""
result = await db.execute(select(User).limit(100))
users = result.scalars().all()
return [UserResponse.model_validate(user) for user in users] if users else []
@app.post("/api/v1/auth/register", response_model=UserResponse)
@app.post("/api/v1/users/register", response_model=UserResponse)
async def register_user(user_data: UserCreate, db: AsyncSession = Depends(get_db)):