Last active
March 14, 2018 23:22
-
-
Save desmondmonster/4cd2429047838b635b92a293ed70062d to your computer and use it in GitHub Desktop.
CRM Interface Module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule YourApp.CRM do | |
def create_user(user) do | |
crm_data = | |
user | |
|> fetch_crm_data() | |
|> parse() | |
user | |
|> YourApp.User.crm_changeset(crm_data) | |
|> YourApp.Repo.update!() | |
end | |
defp fetch_crm_data(user) do | |
# your code here | |
end | |
defp parse(data) do | |
# you will probably want to parse results for use in a changeset | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment