To reduce referential integrity issues while maintaining the system simplicity and easy of use, resources should always be deleted in a "soft-delete" manner.
Resources should never be completely deleted. Instead, they should have a deletedDate property setting the date of deletion. Such resources should return a 410 Gone instead of a 404, with a body indicating how to access the deleted entity (e.g. sample/cf71a71e-2176-4d6f-9f17-a4c4f3dd104e?deleted=true).
Hard-delete should still be available for administrator to completely remove a resource if it was required (sensitive information).
Justification:
To reduce referential integrity issues while maintaining the system simplicity and easy of use, resources should always be deleted in a "soft-delete" manner.
Resources should never be completely deleted. Instead, they should have a
deletedDate
property setting the date of deletion. Such resources should return a 410 Gone instead of a 404, with a body indicating how to access the deleted entity (e.g. sample/cf71a71e-2176-4d6f-9f17-a4c4f3dd104e?deleted=true).Hard-delete should still be available for administrator to completely remove a resource if it was required (sensitive information).