From ffed23a8401b317be2a6573666bd140b8e19ea4e Mon Sep 17 00:00:00 2001 From: surya Date: Wed, 11 Aug 2021 12:22:01 +0530 Subject: [PATCH] surya:add models file added --- app/models/Brokenperiods.js | 35 +++++++++++++++++++++++++++++++++ app/models/Fin_remarks.js | 33 +++++++++++++++++++++++++++++++ app/models/Financials.js | 35 +++++++++++++++++++++++++++++++++ app/models/Itemsmaster.js | 34 ++++++++++++++++++++++++++++++++ app/models/Sectionsmaster.js | 32 ++++++++++++++++++++++++++++++ app/models/Statementsmaster.js | 31 +++++++++++++++++++++++++++++ app/models/Subsectionsmaster.js | 33 +++++++++++++++++++++++++++++++ package-lock.json | 2 +- 8 files changed, 234 insertions(+), 1 deletion(-) create mode 100644 app/models/Brokenperiods.js create mode 100644 app/models/Fin_remarks.js create mode 100644 app/models/Financials.js create mode 100644 app/models/Itemsmaster.js create mode 100644 app/models/Sectionsmaster.js create mode 100644 app/models/Statementsmaster.js create mode 100644 app/models/Subsectionsmaster.js diff --git a/app/models/Brokenperiods.js b/app/models/Brokenperiods.js new file mode 100644 index 0000000..aff0611 --- /dev/null +++ b/app/models/Brokenperiods.js @@ -0,0 +1,35 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class Brokenperiods 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. + */ + // define association here + //static associate({ Model_name }) { + //this.hasMany(Model_name, { foreignKey: 'child_table_prim_key', as: 'child_tbl_name' }) + //} + + + } + Brokenperiods.init( + { + entity_id: { type: DataTypes.INTEGER }, + months: { type: DataTypes.INTEGER }, + cy: { type: DataTypes.INTEGER }, + py: { type: DataTypes.INTEGER }, + variation: { type: DataTypes.INTEGER }, + createdby: { type: DataTypes.INTEGER }, + updatedby: { type: DataTypes.INTEGER }, + + }, + { + sequelize, + tableName: 'brokenperiods', + modelName: 'Brokenperiods', + } + ) + return Brokenperiods +} diff --git a/app/models/Fin_remarks.js b/app/models/Fin_remarks.js new file mode 100644 index 0000000..52b73cd --- /dev/null +++ b/app/models/Fin_remarks.js @@ -0,0 +1,33 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class Fin_remarks 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. + */ + // define association here + //static associate({ Model_name }) { + //this.hasMany(Model_name, { foreignKey: 'child_table_prim_key', as: 'child_tbl_name' }) + //} + + + } + Fin_remarks.init( + { + entity_id: { type: DataTypes.INTEGER }, + itemid: { type: DataTypes.INTEGER }, + remarks: { type: DataTypes.STRING }, + createdby: { type: DataTypes.INTEGER }, + updatedby: { type: DataTypes.INTEGER }, + + }, + { + sequelize, + tableName: 'fin_remarks', + modelName: 'Fin_remarks', + } + ) + return Fin_remarks +} diff --git a/app/models/Financials.js b/app/models/Financials.js new file mode 100644 index 0000000..01c7e6f --- /dev/null +++ b/app/models/Financials.js @@ -0,0 +1,35 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class Financials 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. + */ + // define association here + //static associate({ Model_name }) { + //this.hasMany(Model_name, { foreignKey: 'child_table_prim_key', as: 'child_tbl_name' }) + //} + + + } + Financials.init( + { + entity_id: { type: DataTypes.INTEGER }, + fy: { type: DataTypes.STRING }, + st_type:{ type: DataTypes.STRING }, + itemid: { type: DataTypes.INTEGER }, + value: { type: DataTypes.INTEGER }, + createdby: { type: DataTypes.INTEGER }, + updatedby: { type: DataTypes.INTEGER }, + + }, + { + sequelize, + tableName: 'financials', + modelName: 'Financials', + } + ) + return Financials +} diff --git a/app/models/Itemsmaster.js b/app/models/Itemsmaster.js new file mode 100644 index 0000000..2c2b658 --- /dev/null +++ b/app/models/Itemsmaster.js @@ -0,0 +1,34 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class Itemsmaster 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. + */ + // define association here + //static associate({ Model_name }) { + //this.hasMany(Model_name, { foreignKey: 'child_table_prim_key', as: 'child_tbl_name' }) + //} + + + } + Itemsmaster.init( + { + statement: { type: DataTypes.INTEGER }, + section: { type: DataTypes.INTEGER }, + subsection: { type: DataTypes.INTEGER }, + itemtext: { type: DataTypes.STRING }, + createdby: { type: DataTypes.INTEGER }, + updatedby: { type: DataTypes.INTEGER }, + + }, + { + sequelize, + tableName: 'itemsmaster', + modelName: 'Itemsmaster', + } + ) + return Itemsmaster +} diff --git a/app/models/Sectionsmaster.js b/app/models/Sectionsmaster.js new file mode 100644 index 0000000..02fbfe1 --- /dev/null +++ b/app/models/Sectionsmaster.js @@ -0,0 +1,32 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class Sectionsmaster 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. + */ + // define association here + //static associate({ Model_name }) { + //this.hasMany(Model_name, { foreignKey: 'child_table_prim_key', as: 'child_tbl_name' }) + //} + + + } + Sectionsmaster.init( + { + statement: { type: DataTypes.INTEGER }, + section: { type: DataTypes.STRING }, + createdby: { type: DataTypes.INTEGER }, + updatedby: { type: DataTypes.INTEGER }, + + }, + { + sequelize, + tableName: 'sectionsmaster', + modelName: 'Sectionsmaster', + } + ) + return Sectionsmaster +} diff --git a/app/models/Statementsmaster.js b/app/models/Statementsmaster.js new file mode 100644 index 0000000..fb6bef8 --- /dev/null +++ b/app/models/Statementsmaster.js @@ -0,0 +1,31 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class Statementsmaster 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. + */ + // define association here + //static associate({ Model_name }) { + //this.hasMany(Model_name, { foreignKey: 'child_table_prim_key', as: 'child_tbl_name' }) + //} + + + } + Statementsmaster.init( + { + statement: { type: DataTypes.STRING }, + createdby: { type: DataTypes.INTEGER }, + updatedby: { type: DataTypes.INTEGER }, + + }, + { + sequelize, + tableName: 'statementsmaster', + modelName: 'Statementsmaster', + } + ) + return Statementsmaster +} diff --git a/app/models/Subsectionsmaster.js b/app/models/Subsectionsmaster.js new file mode 100644 index 0000000..c83f455 --- /dev/null +++ b/app/models/Subsectionsmaster.js @@ -0,0 +1,33 @@ +'use strict' +const { Model } = require('sequelize') +module.exports = (sequelize, DataTypes) => { + class Subsectionsmaster 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. + */ + // define association here + //static associate({ Model_name }) { + //this.hasMany(Model_name, { foreignKey: 'child_table_prim_key', as: 'child_tbl_name' }) + //} + + + } + Subsectionsmaster.init( + { + section: { type: DataTypes.INTEGER }, + subsection: { type: DataTypes.STRING }, + itemtext: { type: DataTypes.STRING }, + createdby: { type: DataTypes.INTEGER }, + updatedby: { type: DataTypes.INTEGER }, + + }, + { + sequelize, + tableName: 'subsectionsmaster', + modelName: 'Subsectionsmaster', + } + ) + return Subsectionsmaster +} diff --git a/package-lock.json b/package-lock.json index fd44046..99fb68d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "smc_cet_fin_backend", + "name": "smc_cet_financials_backend", "version": "1.0.0", "lockfileVersion": 1, "requires": true,