Large set of changes - building the GUI for the data tracking app.

This commit is contained in:
Wynne Crisman
2016-08-17 17:54:59 -07:00
parent 08266cdd41
commit b3bbdc0c2a
47 changed files with 4186 additions and 158 deletions

View File

@@ -13,13 +13,21 @@ module.exports = function(sequelize, DataTypes) {
type: DataTypes.STRING,
allowNull: false
},
visible: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true
createdAt: {
type: DataTypes.DATE,
allowNull: false
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false
},
deletedAt: {
type: DataTypes.DATE,
allowNull: true
}
}, {
freezeTableName: true, // Model tableName will be the same as the model name
paranoid: true,
classMethods: {
associate: function(models) {
Category.hasMany(models.Subcategory, {as: 'subcategories', foreignKey: {name: 'categoryId', field: 'categoryId'}});

View File

@@ -22,13 +22,21 @@ module.exports = function(sequelize, DataTypes) {
type: DataTypes.DECIMAL(9,2),
allowNull: false
},
visible: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true
createdAt: {
type: DataTypes.DATE,
allowNull: false
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false
},
deletedAt: {
type: DataTypes.DATE,
allowNull: true
}
}, {
freezeTableName: true, // Model tableName will be the same as the model name
paranoid: true,
classMethods: {
associate: function(models) {
Item.belongsTo(models.Subcategory, {as: 'subcategory', foreignKey: {name: 'subcategoryId', field: 'subcategoryId'}});

View File

@@ -20,13 +20,9 @@ module.exports = function(sequelize, DataTypes) {
postfix: {
type: DataTypes.STRING,
allowNull: false
},
visible: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true
}
}, {
freezeTableName: true // Model tableName will be the same as the model name
freezeTableName: true, // Model tableName will be the same as the model
paranoid: true
});
};

View File

@@ -21,9 +21,22 @@ module.exports = function(sequelize, DataTypes) {
//GAAP standard is to use DECIMAL(13,4) for precision when dealing with money. 13 digits before the decimal, and 4 after it.
type: DataTypes.DECIMAL(13,4),
allowNull: false
},
createdAt: {
type: DataTypes.DATE,
allowNull: false
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false
},
deletedAt: {
type: DataTypes.DATE,
allowNull: true
}
}, {
freezeTableName: true, // Model tableName will be the same as the model name
paranoid: true,
classMethods: {
associate: function(models) {
Sale.belongsTo(models.Item, {as: 'item', foreignKey: {name: 'itemId', field: 'itemId'}});

View File

@@ -15,13 +15,21 @@ module.exports = function(sequelize, DataTypes) {
field: 'name',
allowNull: false
},
visible: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true
createdAt: {
type: DataTypes.DATE,
allowNull: false
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false
},
deletedAt: {
type: DataTypes.DATE,
allowNull: true
}
}, {
freezeTableName: true, // Model tableName will be the same as the model name
paranoid: true,
classMethods: {
associate: function(models) {
Subcategory.belongsTo(models.Category, {as: 'category', foreignKey: {name: 'categoryId', field: 'categoryId'}});

View File

@@ -13,12 +13,20 @@ module.exports = function(sequelize, DataTypes) {
type: DataTypes.STRING,
allowNull: false
},
visible: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: true
createdAt: {
type: DataTypes.DATE,
allowNull: false
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false
},
deletedAt: {
type: DataTypes.DATE,
allowNull: true
}
}, {
freezeTableName: true // Model tableName will be the same as the model name
freezeTableName: true, // Model tableName will be the same as the model name,
paranoid: true
});
};