Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

We'd like to have a consistent and safe way for study designers (almost always the implementers, so people with the DEVELOPER role) to delete and remove things as they set up a study. Often out deletes actually remove things from the database, and so those calls are only accessible to administrators for test clean-up.

...

  • should be able change the deleted flag if you can update the object

Tests

  • If item is deleted and update is deleted, then throw an EntityNotFoundException
  • If item is deleted and update is not deleted, this is allowed and the resulting item is not deleted
  • If item is not deleted and update is not deleted, this is allowed and the resulting item is not deleted
  • If item is not deleted and update is deleted, this is allowed and resulting item is deleted (no need to prevent this)If item is deleted and update is deleted, then throw an EntityNotFoundException

DELETE /apples/id or DELETE /apples?id=x

...

  • If item is already logically deleted, throw an EntityNotFoundException
  • If item is not marked deleted, mark it as deleted

...

  • If item is not in database, throw an EntityNotFoundException
  • If item is in database but logically deleted, this should physically delete the item

...