defmodule DaProductApp.PosTransactions.PosTransaction do use Ecto.Schema import Ecto.Changeset @primary_key {:id, :id, autogenerate: true} schema "pos_transaction" do field :s_txn_type, :string field :s_tid, :string field :s_mid, :string field :s_tid_stan, :string field :s_tid_invoiceno, :string field :s_tid_batchno, :string field :b_tid, :string field :b_mid, :string field :acquirer_id, :integer field :b_tid_stan, :string field :b_tid_invoiceno, :string field :b_tid_batchno, :string field :b_tid_date, :string field :b_tid_time, :string field :entry_mode, :string field :condition_code, :string field :currency_code, :string field :mti, :string field :proc_code, :string field :total_amount, :decimal field :auth_amount, :decimal field :cash_amount, :decimal field :tip_amount, :decimal field :approval_code, :string field :reference_no, :string field :response_code, :string field :response_message, :string field :mcc_code, :string field :encrypted_track2, :string field :encrypted_pan, :string field :hash_pan, :string field :masked_card_no, :string field :encrypted_expiry, :string field :pan_seq, :string field :emv_data, :string field :acquirer_reference_no, :string field :scheme_reference_no, :string field :created_date_time, :naive_datetime, source: :created_dateTime field :updated_date_time, :naive_datetime, source: :updated_dateTime field :metadata, :string field :order_number, :string end def changeset(txn, attrs) do txn |> cast(attrs, [ :s_txn_type, :s_tid, :s_mid, :s_tid_stan, :s_tid_invoiceno, :s_tid_batchno, :b_tid, :b_mid, :acquirer_id, :b_tid_stan, :b_tid_invoiceno, :b_tid_batchno, :b_tid_date, :b_tid_time, :entry_mode, :condition_code, :currency_code, :mti, :proc_code, :total_amount, :auth_amount, :cash_amount, :tip_amount, :approval_code, :reference_no, :response_code, :response_message, :mcc_code, :encrypted_track2, :encrypted_pan, :hash_pan, :masked_card_no, :encrypted_expiry, :pan_seq, :emv_data, :acquirer_reference_no, :scheme_reference_no, :created_date_time, :updated_date_time, :metadata, :order_number ]) end end