openactive / open-booking-api

Repository for the Open Booking API specification
Other
2 stars 3 forks source link

Order Deletion is idempotent #149

Open nickevansuk opened 4 years ago

nickevansuk commented 4 years ago

https://openactive.io/open-booking-api/EditorsDraft/#order-deletion

As specified elsewhere in the specification, Order Deletion is idempotent, so UnknownOrderError should only occur if that UUID has never existed, otherwise the endpoint should return a 204 response.

Clarification 1

hard delete it as though it had not been created in the first place (with only a stub deleted record remaining, for the Orders feed, if necessary)

should be replaced with

hard delete it as though it had not been created in the first place, with only a stub deleted record remaining, for the Orders feed, and to ensure that this endpoint is idempotent

Clarification 2

An Order Deletion request must simply return a 204 success status when an Order is successfully deleted.

should be replaced with

An Order Deletion request must simply return a 204 success status when an Order is successfully deleted. This endpoint is idempotent, so subsequent Order Deletion requests with the same UUID MUST also return the same 204 success status response.

nathansalter commented 4 years ago

This seems like a reasonable clarification, but I do have a question. This seems to imply that ALL requests to delete an Order should return a 204 No Content response, even if the Order never existed. Simply because depending on the data retention rules, orders may no longer be in the database, so a request to DELETE /orders/<valid uuid> would return the same as DELETE /orders/<invalid uuid>.