'use strict';
const {
  Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
  class invoice_trans extends Model {
    /**
     * Helper method for defining associations.
     * This method is not a part of Sequelize lifecycle.
     * The `models/index` file will call this method automatically.
     */
    static associate(models) {
      invoice_trans.belongsTo(models.invoice, { foreignKey: 'inv_id'});
    }
  }
  invoice_trans.init({
    inv_id: DataTypes.STRING,
    gateway: DataTypes.STRING,
    date: DataTypes.DATE,
    description: DataTypes.STRING,
    amount: DataTypes.STRING,
    balance: DataTypes.STRING
  }, {
    sequelize,
    modelName: 'invoice_trans',
  });
  return invoice_trans;
};