defmodule DaProductApp.PosTransactions.PosMerchant do use Ecto.Schema import Ecto.Changeset @primary_key {:id, :integer, autogenerate: false} schema "pos_merchant" do field :merchantid, :string field :merchant_name, :string field :address_id, :integer end def changeset(merchant, attrs) do merchant |> cast(attrs, [:merchantid, :merchant_name, :address_id]) |> validate_required([:merchantid]) end end