Skip to content

Abstract service flows with Eventbrite events implementation

Anthony Shull requested to merge as/feat/906/eventbrite-service-flow into develop

ServiceFlows inherit from ServiceFlow. They are registered in the ServiceFlowRegistry. A ServiceFlowWorker exists that merely gets the service by id, instantiates a ServiceFlow with the given flow, then calls its get_data method.

To test:

You will first need to create an Eventbrite account and also create an event.

  1. reset the database bundle exec rails db:reset

  2. login with the created user and use their authorization header

  3. visit http://localhost:3001/api/auth/eventbrite?user_id=1&serviceable_type=space&serviceable_id=1

  4. agree to give JOGL access and you will be redirected to http://localhost:3000

  5. GET /api/services/1 to verify that a service was created

  6. PUT /api/services/1/flows/events should return a 201 and ServiceFlowData.count should now be 1

  7. GET /api/services/1/flows/events should return service flow data

  8. POST /api/services/1/flows/events should return a 201 and Activity.count should now be 1

  9. GET /api/spaces/1/activities returns activities and the first one matches the information from your Eventbrite event

Closes https://gitlab.com/JOGL/JOGL/-/issues/906

Other routes you can check-out:

GET /api/services/1/flows returns all the flows available for that service

Edited by Anthony Shull

Merge request reports