feat: add data collection mode to projects with UI updates and migration script
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user