Files
phoenix-ausblick/lib/outlook/translators/deepl_account.ex
2023-01-10 20:06:54 +01:00

24 lines
672 B
Elixir

defmodule Outlook.Translators.DeeplAccount do
use Ecto.Schema
import Ecto.Changeset
schema "deepl_accounts" do
field :auth_key, :string
field :character_count, :integer, default: 0
field :character_limit, :integer
field :description, :string
field :name, :string
field :our_character_count, :integer
belongs_to :user, Outlook.Accounts.User
timestamps()
end
@doc false
def changeset(deepl_account, attrs) do
deepl_account
|> cast(attrs, [:name, :description, :auth_key, :character_limit, :character_count, :our_character_count, :user_id])
|> validate_required([:name, :description, :auth_key, :user_id])
end
end