ElektraInitiative/PermaplanT

CreateLayers: Backend Tasks

danielsteinkogler opened this issue · 2 comments

Currently we have Endpoints for creating and deleting layers. However, there are some tasks to do:

  • order index of layer within map has to be added to database
  • if a layer is deleted, it should only be a soft delete so that it can be easily restored (@markus2330 please correct us if this is not intended).
  • Change create layer: don't include map_id in the dto and in the path.

Endpoints and actions

  • Create action for creating layer
  • Create action for deleting layer
  • Create endpoint and action for renaming layer (PUT /maps/<map_id>/layers/<layer_id>/name)
  • Create endpoint and action for changing order of layer (PUT /maps/<map_id>/layers/order)

@markus2330 jannis and I discussed the needs for the backend concerning the create layers usecase and documented the tasks here in this issue.

@markus2330 since I'm touching layers in a migration, do we need is_alternative still?

We also talks a bit about soft deletion of layers, what do you think about

DELETE /maps/<map_id>/layers/<layer_id> sets a field marked_for_deletion: Date, which is set for 30 days in advance. Then a crone job deletes all marked layers after 30 days.

Thoughts for the future: Even building some UI for restoring would be possible. If you like the idea I'll write a usecase for soft-deletion of layers and maps.
image