fcsc_ipi_backend/app/models/manufacturingIPI.model.js
2026-04-29 10:39:44 +05:30

67 lines
1.4 KiB
JavaScript

module.exports = (sequelize, DataTypes) => {
const ManufacturingIpi = sequelize.define("manufacturing_ipi", {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
},
year: {
type: DataTypes.INTEGER,
allowNull: false,
},
quarter: {
type: DataTypes.STRING,
allowNull: false,
},
quarter_name: {
type: DataTypes.STRING,
allowNull: false,
},
reference_date: {
type: DataTypes.DATEONLY,
allowNull: false,
},
total_weight: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
},
weighted_index_sum: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
},
manufacturing_index: {
type: DataTypes.DECIMAL(10, 2),
allowNull: false,
},
mom_change: {
type: DataTypes.DECIMAL(12, 2),
allowNull: true,
},
yoy_change: {
type: DataTypes.DECIMAL(12, 2),
allowNull: true,
},
status: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: 'Completed',
},
generated_on: {
type: DataTypes.DATE,
allowNull: false,
},
created_at: {
type: DataTypes.DATE,
defaultValue: DataTypes.NOW,
},
updated_at: {
type: DataTypes.DATE,
allowNull: true,
},
}, {
tableName: "manufacturing_ipi",
timestamps: false,
});
return ManufacturingIpi;
};