Closed eborremans closed 10 months ago
Huh? Don't understand this one. When the /legs/{id}/events - FINISH is fired, the asset is returned. Independent on the booked arrival time.
@edwinvandenbelt I updated this request as per our discussion earlier today.
Added also actualDepartureTime
Use case - Early Asset Return
As a Transport Operator I want early returned assets to be available immediately for new bookings so that we can achieve optimal asset utilization.
EDIT: I changed
actualArrivalTime
toactualEndTime
as per my discussion with @edwinvandenbelt.However currently TOMP does not offer a way to indicate that an asset is available earlier than the
arrivalTime
on the booking. For this we suggest the following change to the booking structure:arrivalTime
from now on should be interpreted asplannedArrivalTime
(but we can leave the current name as it is)actualEndTime
is added to indicate the actual time a booking is set to, and considered FINISHEDOne could argue that as soon as all of a bookings legs have been reported FINISHED, the time of the last legs arrival, can be implicitly considered the
actualEndTime
. However, it is quite cumbersome to retrieve this information via the booking endpoint. The client would have to fetch all legs and inspect their individual arrivalTimes. A new booking fieldactualEndTime
would be much more convenient. In addition this allows for explicitly changing theactualEndTime
via thePUT /bookings/{id}
endpoint which may come in handy as support functionality.
Closely related to this is a feature that some operators want to be able to offer: free asset replacement (for instance because of malfunction).
Use case - In-leg Asset Replacement
As a Transport Operator offering bookings with late asset assignment, I want to enable customers to swap an asset as long as this happens before the bookings
arrivalTime
.For example when a bike turns out to have a flat tire or breaks down during the leg, the customer can easily swap it without having to create a new booking (provided assets are available).
EDIT: TOMP already supports asset replacement. For this we can use the trip execution ASSIGN_ASSET event instead of the SET_IN_USE. The sequence diagram has been updated to reflect this.
We can easily implement this use case by adding an additional trip execution event REPLACE_ASSET. This event can be used instead of the FINISH event to indicate that the booking is not FINISHED and the customer intends to swap the asset for a new one.Because ASSIGN_ASSET is intended to be possible without payment consequences for the end customer, we suggest the current leg is reused. We may want to consider maintaining a history of assets used per leg for administration/auditing purposes.As a side node and possible future extension, some TOs may want to offer swapping to an up(or down)graded asset, in which case a new leg (with its own pricing) may need to be inserted. At this point I cannot oversee the implications of dynamically inserting legs to a booking to provide this functionality because I do not know if a bookings list of legs should be considered immutable. In addition, this would produce a new leg Id that is NOT(!) known to the client. So for this to work we'd need additional changes in the API to communicate this information with the client in a useful way since they'd need a way to know to which booking this new leg belongs.
Note that in combination with the new
actualEndTime
field, the trip execution behavior could change as follows:POST /legs/{id}/events FINISH
-> sets theactualEndTime
tonow()
POST /legs/{id}/events ASSIGN_ASSET
-> does not change theactualEndTime
Of course the TO is free to use the
actualEndTime
how they see fit. They can even choose not to use it at all. But at least it offers useful information about the actual trip to both the TO and the MP, while retaining the original booking info.In case the customer somehow fails to replace the asset after returning it with the intention to replace it, the booking will automatically end when the
(planned)arrivalTime
passes or when theactualEndTime
is explicitly set via thePUT /bookings/{id}
endpoint.
Furthermore we'd advise the client to always call
GET /bookings/{id}
after receiving a trip execution event, to ensure they have up to date booking info.Urgency
Quite urgent as optimal asset utilization is important to our customer TOs.
Additional context
I am currently not aware of possible existing ways to (easily) publish the actual booking end time.