defmodule DaProductApp.Brands.Brand do use Ecto.Schema import Ecto.Changeset schema "brands" do field :code, :string field :name, :string field :description, :string field :default_acquirer, :string field :group_id, :integer field :merchant_reference_id, :string field :region, :string field :merchant_tag, :string timestamps() end def changeset(brand, attrs) do brand |> cast(attrs, [:code, :name, :description, :default_acquirer, :group_id, :merchant_reference_id, :region, :merchant_tag]) |> validate_required([:code, :name]) end end