Updates to implementation details based on today's call –
-
On an update call, make the client send a "snapshot" of the current record, along with the incoming
UPDATEpayload and save these to cache. Let's call thisv1. -
Generate the UPDATE query, execute it, and return the updated payload as usual, along with a unique
undo_id. Additionally, save these to cache as well. Let's call thisv2. -
Now if the API consumer needs an undo, they need to send the
undo_id, with which we should be able to look up both thev1record, thev2record, do a diff and execute a newUPDATEquery that rolls backv2tov1.