fcsc_ipi_backend/app/models/calculation_log.model.js
2026-01-09 16:16:16 +05:30

48 lines
990 B
JavaScript

module.exports = (sequelize, DataTypes) => {
const CalculationLog = sequelize.define("calculation_log", {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
},
calculation_type: {
type: DataTypes.STRING,
allowNull: false,
},
reference_year: {
type: DataTypes.INTEGER,
allowNull: false,
},
reference_month: {
type: DataTypes.INTEGER,
allowNull: false,
},
status: {
type: DataTypes.STRING,
allowNull: false,
},
records_processed: {
type: DataTypes.INTEGER,
allowNull: true,
},
error_message: {
type: DataTypes.TEXT,
allowNull: true,
},
started_at: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW,
},
completed_at: {
type: DataTypes.DATE,
allowNull: true,
},
}, {
tableName: "calculation_log",
timestamps: false,
});
return CalculationLog;
};