So, imagine I have a status of an entity. I want to change that status and then change it back after a certain period of time. For instance, I want to rent something for 5 hours, so I make a request to create a new rent order entry and, say, update the status of an item to InRent
. Therefore, after 5 hours I want the status to be automatically changed to InStock
.
I know, it can be implemented on a GET
request, the next time someone is trying to fetch the data, regarding these statuses. But is there a better approach? Thanks in advance:)
UPD: The second and the third options in Zhi Lv's answer are what I was asking for. Thank you:)