fmtm
fmtm copied to clipboard
Progressively create a project instead of everything on submit
Is your feature request related to a problem? Please describe.
Follow on from https://github.com/hotosm/fmtm/issues/1291 Also related to Entity creation in https://github.com/hotosm/fmtm/issues/1653
- If we first create a stub (incomplete) project entry first, then fill it out progressively.
- Then we can call each endpoint once the section is filled out for project creation.
Describe the solution you'd like
- Project Details --> have an endpoint to check if the project name already exists + validation based on that.
- Upload Area --> POST
/projects
to create a new project (relax constrains to create a stub).- Here we have most details such as name, description, AOI geom, etc.
- Select Category --> endpoint to upload XLSForm, or link XLSForm to existing project.
- Map Features --> endpoint to create new Entity list from uploaded GeoJSON.
- In theory we could upload as many Entity lists (geometry sets) as we need here by calling the endpoint multiple times.
- Split Tasks --> we already do a separate endpoint call here 👍
Additional considerations
- If project creation is cancelled / exited / failed, then the project stub should be deleted by calling the DELETE /projects endpoint.
- This is already in place if the project creation fails, but in theory with this rework of the flow it shouldn't be possible for creation to fail (as each step has it's own validation before moving to the next step).
- We should only delete the project if the user explicitly cancels / exits the project creation flow.