Files
yourpart3/backend/models/falukant/log/daysell.js
Torsten Schulz (local) 1ab9407e79
All checks were successful
Deploy to production / deploy (push) Successful in 2m56s
Refactor code structure for improved readability and maintainability; optimize performance across multiple modules.
2026-07-21 09:08:15 +02:00

39 lines
897 B
JavaScript
Executable File

import { Model, DataTypes } from 'sequelize';
import { sequelize } from '../../../utils/sequelize.js';
class DaySell extends Model { }
DaySell.init({
regionId: {
type: DataTypes.INTEGER,
allowNull: false},
productId: {
type: DataTypes.INTEGER,
allowNull: false},
quantity: {
type: DataTypes.INTEGER,
allowNull: false},
sellerId: {
type: DataTypes.INTEGER,
allowNull: false},
sellTimestamp: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: sequelize.literal('CURRENT_TIMESTAMP')}
}, {
sequelize,
modelName: 'DaySell',
tableName: 'sell',
schema: 'falukant_log',
timestamps: false,
underscored: true,
indexes: [
{
unique: true,
fields: ['seller_id', 'product_id', 'region_id']
}
]
});
export default DaySell;