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

@@ -39,6 +39,17 @@ async def health_check():
"""Health check endpoint"""
return {"status": "healthy", "service": "calendar_service"}
@app.get("/api/v1/events")
async def get_events_public(db: AsyncSession = Depends(get_db)):
"""Get calendar events (public endpoint for testing)"""
result = await db.execute(
select(CalendarEntry)
.order_by(CalendarEntry.created_at.desc())
.limit(50)
)
entries = result.scalars().all()
return [schemas.CalendarEntryResponse.model_validate(entry) for entry in entries] if entries else []
@app.get("/debug/entries")
async def debug_entries(db: AsyncSession = Depends(get_db)):
"""Debug endpoint for entries without auth"""
@@ -598,13 +609,6 @@ async def delete_calendar_entry(
return {"message": "Entry deleted successfully"}
@app.get("/api/v1/health")
async def health_check():
"""Health check endpoint"""
return {"status": "healthy", "service": "calendar-service"}
# Новый эндпоинт для мобильного приложения
@app.post("/api/v1/calendar/entry", response_model=schemas.CalendarEvent, status_code=201)
async def create_mobile_calendar_entry(