Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

high-level design for legacy project imports [MARXAN-1220] #1051

Merged

Conversation

hotzevzl
Copy link
Member

No description provided.

@vercel
Copy link

vercel bot commented May 10, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
marxan ✅ Ready (Inspect) Visit Preview Jun 28, 2022 at 6:18PM (UTC)
marxan-storybook ✅ Ready (Inspect) Visit Preview Jun 28, 2022 at 6:18PM (UTC)

Comment on lines +5 to +47
## Workflow overview

From an API consumer point of view, importing a legacy project is performed
through three main steps and related endpoints.

### Preparation of project import process

`POST /api/v1/projects/import/legacy`

This step will prepare an empty project shell, as well as an empty scenario
shell, both of which will be populated later in the import process, unless
errors are raised while validating user-uploaded data.

The `projectId` of the project being created will be returned, so that the next
steps can reference the project.

### Data upload

`POST /api/v1/projects/import/legacy/:projectId/data-file`

API clients will need to use this endpoint to upload each of the files that
users provide.

Each upload will include the actual file alongside a small JSON metadata snippet
through which the API is informed about which kind of file this is, alongside
any other metadata needed to import it.

A unique `dataFileId` is returned for each file uploaded successfully.

As API clients send requests to this endpoint, the API keeps the uploaded files
in a temporary storage area, from which they will be later read and processed.

If a specific kind of file (for example, a planning grid shapefile) is uploaded
more than once, any previously uploaded copy is discarded and replaced with the
latest file uploaded. This would be sufficient if a user accidentally uploads
the wrong file.

In case an uploaded file needs to be fully removed from the set of uploaded
files (for example, if a user accidentally uploads a `puvspr.dat` file _as if it
was_ an `output.zip` file), a `DELETE` endpoint is provided, which can be used
with the `dataFileId` returned on upload:

`DELETE /api/v1/projects/import/legacy/:projectId/data-file/:dataFileId`
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbarrenechea does this workflow sound ok/complete from the point of view of the app?

hotzevzl added 2 commits June 28, 2022 18:48
Backport from version to be used in UI; clarify which combinations of
inputs are not supported in the Marxan Cloud platform.
@hotzevzl hotzevzl marked this pull request as ready for review June 28, 2022 18:15
@hotzevzl hotzevzl merged commit e2e7693 into develop Jun 28, 2022
@hotzevzl hotzevzl deleted the docs/MARXAN-1220_legacy-project-import_development-plan branch June 28, 2022 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant