module.exports = (sequelize, DataTypes) => {
  const transaction = sequelize.define("transaction", {
    id: {
      type: DataTypes.INTEGER,
      primaryKey: true,
      autoIncrement: true,
    },
    order_id: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
    user_id: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
    shipping_dock_id: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
    amount: {
      type: DataTypes.NUMERIC,
      allowNull: false,
    },
    discount: {
      type: DataTypes.NUMERIC,
    },
    tax: {
      type: DataTypes.NUMERIC,
    },
    total: {
      type: DataTypes.NUMERIC,
      allowNull: false,
    },
    notes: DataTypes.STRING,
    status: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
  });
  return transaction;
};
