defmodule DaProductApp.DeviceMiddlelayer.PosTerminalData do use Ecto.Schema import Ecto.Changeset @primary_key {:id, :id, autogenerate: true} @timestamps_opts [type: :utc_datetime, autogenerate: {DateTime, :utc_now, []}] schema "pos_terminal_data" do field :pos_terminalId, :string field :stan, :string field :batch_number, :string field :transaction_date, :string field :transaction_time, :string field :transaction_id, :integer timestamps(inserted_at: :created_at, updated_at: :updated_at, type: :utc_datetime) end def changeset(data, attrs) do data |> cast(attrs, [ :pos_terminalId, :stan, :batch_number, :transaction_date, :transaction_time, :transaction_id ]) |> validate_required([:pos_terminalId, :stan, :batch_number, :transaction_date, :transaction_time]) end end