Proposal
Currently, booking requests allow a transition to be specified in both PUT and PATCH requests. This field is used to transition a newly created or existing booking, respectively.
This means that consumers can only create new bookings with an "initial" status and may not update a booking to a status that is not immediately available via a single transition. This may result in multiple requests from consumers to apply multiple transitions.
Example:
Draft bookings cannot be immediately marked as "approved" in EDD Bookings.
For reference, see the transition map in the EDD Bookings: booking logic module configuration.
Therefore, consumers would have to first submit the booking, which transitions it to pending, and then approve it.
Recommended Solution
Allow the transition field to contain multiple transitions, as a comma separated list.
PATCH /wp-json/eddbk/v1/bookings/156
{
"transition": "submit, approve"
}
Consumers are still advised to confirm that the chain of transitions that is given is indeed valid, to prevent the booking from only having the chain of transitions apply partially (failing at an nth transition).
Proposal
Currently, booking requests allow a
transitionto be specified in bothPUTandPATCHrequests. This field is used to transition a newly created or existing booking, respectively.This means that consumers can only create new bookings with an "initial" status and may not update a booking to a status that is not immediately available via a single transition. This may result in multiple requests from consumers to apply multiple transitions.
Example:
Draft bookings cannot be immediately marked as "approved" in EDD Bookings.
For reference, see the transition map in the EDD Bookings: booking logic module configuration.
Therefore, consumers would have to first
submitthe booking, which transitions it topending, and thenapproveit.Recommended Solution
Allow the
transitionfield to contain multiple transitions, as a comma separated list.Consumers are still advised to confirm that the chain of transitions that is given is indeed valid, to prevent the booking from only having the chain of transitions apply partially (failing at an nth transition).