As an offline user, I want to be warned if my requisition data entry has a conflict when I re-connect to the network so that I can resolve any conflict and ensure my data is stored into OpenLMIS.
A requisition that has been worked on offline will be considered void and overwritten by the server version, if the local version's `date_modified` timestamp no longer matches server version's `date_modified` timestamp. This functionality best reflects option C from the attached conflict handling document.
To compare the date_modified timestamps, the requisition endpoint should be modified to check if the post data object contains a `date_modified` attribute. The behavior of the requisition endpoint should work like this:
- if there is no `date_modified` timestamp in the post object the requisition object is updated
- if there is a `date_modified` timestamp, and the timestamps match, the requisition object is updated
- if there is a `date_modified` timestamp, and the timestamps don't match, the http request fails with a 409 status code and returns a message reading "The requisition has a newer version than what was posted"
- If an offline requisition is attempting to sync with the server version of the requisition, and the requisition `date_modified` timestamps of the don't match, THEN the offline requisition is removed from the browser and replaced by the server version.
- When the server version replaces the offline version, an alert is shown to the user that reads "This requisition has a newer version on the server; the server version will be used, and you will need to remake your changes."
- If the offline requisition's `date_modified` timestamp matches the server requisition's `date_modified` timestamp — then the offline requisition updates the server requisition
NOTE: There is a second ticket to handle warning a user if they are going to overwrite another user's changes ( OLMIS-1657 Dead )