feat: add API routers for network, tasks, calendar, and services

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-15 09:05:38 +00:00
parent 2bd7cd9102
commit 0fbfe7e89d
5 changed files with 131 additions and 3 deletions

View File

@@ -0,0 +1,15 @@
from datetime import datetime, timedelta
from fastapi import APIRouter, Query
router = APIRouter(prefix="/api/calendar", tags=["calendar"])
@router.get("/events")
async def get_events(
days: int = Query(default=7, ge=1, le=30),
):
from main import odoo_client
today = datetime.now().strftime("%Y-%m-%d")
end = (datetime.now() + timedelta(days=days)).strftime("%Y-%m-%d")
events = await odoo_client.get_calendar_events(date_from=today, date_to=end)
return {"events": events, "date_from": today, "date_to": end}