feat: add data collection mode to projects with UI updates and migration script

This commit is contained in:
2026-03-05 21:50:41 +00:00
parent ef8c046f31
commit 015ce0a254
6 changed files with 181 additions and 4 deletions

View File

@@ -613,6 +613,7 @@ async def get_project(project_id: str, db: Session = Depends(get_db)):
"site_coordinates": project.site_coordinates,
"start_date": project.start_date.isoformat() if project.start_date else None,
"end_date": project.end_date.isoformat() if project.end_date else None,
"data_collection_mode": project.data_collection_mode or "manual",
"created_at": project.created_at.isoformat(),
"updated_at": project.updated_at.isoformat(),
}
@@ -659,6 +660,8 @@ async def update_project(
project.start_date = datetime.fromisoformat(data["start_date"]) if data["start_date"] else None
if "end_date" in data:
project.end_date = datetime.fromisoformat(data["end_date"]) if data["end_date"] else None
if "data_collection_mode" in data and data["data_collection_mode"] in ("remote", "manual"):
project.data_collection_mode = data["data_collection_mode"]
project.updated_at = datetime.utcnow()