Skip to content

Instantly share code, notes, and snippets.

@rafaels88
Created September 11, 2018 10:28
Show Gist options
  • Save rafaels88/9a4b66ce28839417996682629eaf09fc to your computer and use it in GitHub Desktop.
Save rafaels88/9a4b66ce28839417996682629eaf09fc to your computer and use it in GitHub Desktop.
Quiqup - Opus, the stages
defmodule Quiqup.DispatchOrderStagePipeline do
use Opus.Pipeline
check :validate_order
step :persist_stage
def validate_order(%{order: order} = pipeline) do
# validation code returns true or false
end
def persist_stage(%{order: order} = pipeline) do
# persist code ...
end
end
{:ok, _} = Quiqup.DispatchOrderStagePipeline.call(%{order: order})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment