Current section
Files
Jump to
Current section
Files
lib/vtex_ws/apps/app.ex
defmodule VtexWs.Apps.App do
@moduledoc "App representa um record de um cliente no nosso banco de dados."
use Ecto.Schema
import Ecto.Changeset
alias VtexWs.Services.AppManager
schema "apps" do
field :vtex_url, :string
field :api_key, :string, default: ""
field :name, :string
field :slug, :string
field :app_id, :string
field :vtex_app_key, :string, default: ""
field :vtex_app_token, :string, default: ""
timestamps()
end
@doc false
def changeset(app, attrs) do
app
|> cast(attrs, [:name, :api_key, :vtex_url, :vtex_app_key, :vtex_app_token, :slug, :app_id])
|> validate_required([:name, :api_key, :vtex_url, :vtex_app_key, :vtex_app_token, :slug, :app_id])
end
end