Open lukehesluke opened 3 years ago
For the case when the Order has already been cancelled, it should always appear in the feed, so perhaps we add a test Order delete following cancellation (as part of the cancellation tests?). This would guarantee that GoneError is returned. However that would require the cancellation feature to be enabled. Suggest this is therefore included in the seller-requested-cancellation feature.
To test as much as we can for booking systems without cancellation, option 2 sounds great.
perhaps we add a test Order delete following cancellation (as part of the cancellation tests?)
@nickevansuk sounds like the orders-updated-then-deleted
test, which is included as part of the order-deletion
feature. (This has been written but awaits https://github.com/openactive/OpenActive.Server.NET/issues/87 to be finished).
(Aside: You raise a good point that it should only run if the seller-requested-cancellation
AND order-deletion
features are enabled. Currently, it's in order-deletion
, but it is possible for a BS to support deletion but not cancellation. We have no other tests that require multiple features to be enabled, so perhaps we need to add something to support that. Not super-urgent, but it would become a problem if/when such a BS comes to use test suite)
Why does this guarantee that GoneError is returned? As I read the spec (https://openactive.io/open-booking-api/EditorsDraft/1.0CR3/#order-deletion), it looks like it could still be hard-deleted in the Booking System's orders database, say, but just persisted as a stub deleted
item in their Orders RPDE database
In the Open Booking API, Order deletion can be either a hard delete or soft delete
It suggests using a
GoneError
if accessing an Order which has been soft-deleted (https://openactive.io/open-booking-api/EditorsDraft/1.0CR3/#generic-errors).Some Booking Systems may implement soft deletes and some hard deletes. How then can we write a test that tests the GoneError? Some options:
Add a soft-deletes feature in which the GoneError tests are placed. A Booking System could then opt in to being tested in this way.
Con: Soft deletes are not greatly elaborated on in the spec. A Booking System could soft delete for a short while and then (at some later time) do a hard delete. Therefore, it's possible that a BS "supports" soft deletes, but may be set up in such a way that a
GoneError
test would fail (e.g. imagine a Booking System which does hard deletes on a cron job - say, every 24 hours. If the GoneError test runs on the margin of that 24 hour divide, an Order Deletion request may almost immediately end up in a hard delete, causing a test failure. It's a weird system, but is acceptable in the spec).Similarly, a system could support hard deletes in some cases and hard deletes in others. And then they would not have a clear setting for the feature.
I'm leaning towards option 2