Sometimes it's relevant to keep storing the history/snapshot of an entity as backup that may be used latter to rollback unwanted changes.
For that a pre_update (and pre_delete) operation must be created that intercepts the storage operation and that retrieves a snapshot of the current state storing it on a different collection.
There should be a proper UI for retrieval (and inspection) of a different snapshot (snapshots collection).
Description
Sometimes it's relevant to keep storing the history/snapshot of an entity as backup that may be used latter to rollback unwanted changes.
For that a
pre_update
(andpre_delete
) operation must be created that intercepts the storage operation and that retrieves a snapshot of the current state storing it on a different collection.There should be a proper UI for retrieval (and inspection) of a different snapshot (snapshots collection).