Skip to content
This repository was archived by the owner on Aug 10, 2022. It is now read-only.
This repository was archived by the owner on Aug 10, 2022. It is now read-only.

Allow multiple transitions in booking requests #10

@mecha

Description

@mecha

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions