module.exports = (sequelize, Sequelize) => {
  const TransactionHistory = sequelize.define("transaction_history", {
    invoice_number: {
      type: Sequelize.STRING
    },
    client_id: {
      type: Sequelize.INTEGER
    },
    date_of_purchase: {
      type: Sequelize.DATE
    },
    type: {
      type: Sequelize.ENUM,
      values: ['Buy', 'Sell']
    },
    wallet_address: {
      type: Sequelize.STRING
    },
    amount_in_cad: {
      type: Sequelize.DECIMAL(10,2)
    },
    purchasing_currency_id: {
      type: Sequelize.INTEGER
    },
    live_rate: {
      type: Sequelize.INTEGER
    },
    available_crypto_amount: {
      type: Sequelize.DECIMAL(10,2)
    },
    fx_rate: {
      type: Sequelize.STRING
    },
    fee_percentage: {
      type: Sequelize.INTEGER
    },
    fee_gained: {
      type: Sequelize.STRING
    },
    amount_usdt: {
      type: Sequelize.DECIMAL(10,2)
    },
    amount: {
      type: Sequelize.DECIMAL(10,2)
    },
    trading_fee: {
      type: Sequelize.DECIMAL(10,2)
    },
    network_fee: {
      type: Sequelize.DECIMAL(10,2)
    },
    payment_type_id: {
      type: Sequelize.INTEGER 
    },
    exchange_use: {
      type: Sequelize.INTEGER 
    },
    payout_amount: {
      type: Sequelize.DECIMAL(10,2) 
    },
    payout_unit: {
      type: Sequelize.STRING 
    },
    other_fees: {
      type: Sequelize.STRING 
    }
  });

  return TransactionHistory;
};
