synt_backend
Version:
Synt light-weight node backend service
33 lines (32 loc) • 976 B
JavaScript
const { Model } = require("sequelize");
module.exports = (sequelize, DataTypes) => {
class GeneralLedgerAccount 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) {
// define association here
GeneralLedgerAccount.belongsTo(models.GeneralLedgerDefinition);
GeneralLedgerAccount.belongsTo(models.VME);
GeneralLedgerAccount.belongsTo(models.DistributionKey);
}
}
GeneralLedgerAccount.init(
{
code: DataTypes.INTEGER,
name: DataTypes.STRING,
description: DataTypes.STRING,
order_number: DataTypes.INTEGER.UNSIGNED,
balance_type: DataTypes.ENUM("B", "R"),
start_value: DataTypes.DECIMAL(8, 2),
},
{
sequelize,
modelName: "GeneralLedgerAccount",
}
);
return GeneralLedgerAccount;
};
;