Add Translators/deepl_accounts

mix phx.gen.live Translators DeeplAccount deepl_accounts\
  name:string description:text auth_key:string character_limit:integer\
  character_count:integer our_character_count:integer user_id:references:users
This commit is contained in:
Thelonius Kort
2022-12-26 18:51:30 +01:00
parent f66521dba8
commit 9e9c7b5519
12 changed files with 585 additions and 0 deletions

View File

@ -0,0 +1,23 @@
defmodule Outlook.Translators.DeeplAccount do
use Ecto.Schema
import Ecto.Changeset
schema "deepl_accounts" do
field :auth_key, :string
field :character_count, :integer
field :character_limit, :integer
field :description, :string
field :name, :string
field :our_character_count, :integer
field :user_id, :id
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])
|> validate_required([:name, :description, :auth_key, :character_limit, :character_count, :our_character_count])
end
end