Skip to content

Instantly share code, notes, and snippets.

@skimi
Last active September 7, 2017 14:57
Show Gist options
  • Save skimi/f2a4975fea0acc4800977766db6301cd to your computer and use it in GitHub Desktop.
Save skimi/f2a4975fea0acc4800977766db6301cd to your computer and use it in GitHub Desktop.
Workflow conflict management

Close a service

  • In reservation list click on "close service"
  • We close a service by creating a new service with parentUuid of the service we want to close (with empty tags)
post /restaurants/{restaurantId}/services 
  => tags: []
  => dateRanges : {
    start: closedDate,
    end: closedDate,
  }

Will post /restaurants/{restaurantId}/services return conflicts?

  • With the returned reservations conflict we generate a conflict resolution page
  • Every change on a reservation is saved "live" (no draft stage). When a save occur we post /restaurants/{restaurantId}/services with the VALIDATE header.
  • When post /restaurants/{restaurantId}/services has no more conflict we go to the next page
  • On that page the user can click Publish on we post /restaurants/{restaurantId}/services without the validate header.
  • If no conflict go back to booking list OR go back to conflict management page

Remove service

  • We DELETE the service
  • The DELETE route sends us conflicting reservations ⚠️ API seems to not do that
  • Resolve conflicts like close then DELETE again

How do we close conflicting service? Is it params in the POST/PUT service request? Does the POST/PUT service request handle closing services?

Logically we can't handle closing services on our side because closing a service would be rejected by 409 conflicting orphan reservations.

Create a service

  • After editing "TimeRanges", "DateRanges" & "recurrences" we validate with the API CONFLICT: VALIDATE (header)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment