Skip to content

Instantly share code, notes, and snippets.

@rafaels88
Created September 11, 2018 10:30
Show Gist options
  • Save rafaels88/a0de3e1b5154dd0063de83fb9e0631af to your computer and use it in GitHub Desktop.
Save rafaels88/a0de3e1b5154dd0063de83fb9e0631af to your computer and use it in GitHub Desktop.
Quiqup - Opus Step
defmodule Quiqup.DispatchOrderStagePipeline do
use Opus.Pipeline
step :assign_courier
step :next_stage
def assign_courier(%{order: order} = pipeline) do
put_in(pipeline, [:courier], order.courier)
end
def next_stage(%{order: order, courier: courier}) do
# ...
end
end
Quiqup.DispatchOrderStagePipeline.call(%{order: order})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment