Data manager API endpoint to accept and handle "valid_at" timestamp
Description
API calls from account-data-manager contain a valid_at timestamp. This should be checked against the API's database record for the user and ignored if earlier than the currently stored last updated date.
Records are needed for deleted users (even if yet to receive a create event) so that a last updated date can be recorded against them. Thus deletion events should cause soft-deletion of users.
Task list
-
Add a deletedboolean to user records -
Add a valid_attimestamp to user records -
Add updated_atandcreated_atauto-time fields -
Update create, update and delete API endpoints to compare valid_atwithvalid_atstored in database -
Ignore changes earlier than those already applied -
Log these events
-
-
Delete API calls soft delete users instead of removing them from DB -
All (not ignored) API calls update the valid_atwith thevalid_attimestamp from the event
Acceptance criteria
-
Out of order calls to API result in a consistent/appropriate state stored in DB (with tests to demonstrate different scenarios)
Links/references
Edited by Mike Knee