All checks were successful
Deploy to production / deploy (push) Successful in 1m51s
- Added a new `completionCount` field to the DayProduction model to track the number of completed productions. - Updated the FalukantService to aggregate completed productions using the new `completionCount` field, improving accuracy in production statistics. - Introduced new vocabulary training features in VocabLessonView, including options to mark vocabulary as difficult and track remaining hard vocabulary, enhancing user engagement and learning effectiveness. - Updated localization files for German and English to support new vocabulary training features, ensuring a consistent user experience across languages.
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
import { Model, DataTypes } from 'sequelize';
|
|
import { sequelize } from '../../../utils/sequelize.js';
|
|
|
|
class DayProduction extends Model { }
|
|
|
|
DayProduction.init({
|
|
regionId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false},
|
|
productId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false},
|
|
quantity: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false},
|
|
producerId: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false},
|
|
productionTimestamp: {
|
|
type: DataTypes.DATE,
|
|
allowNull: false,
|
|
defaultValue: sequelize.literal('CURRENT_TIMESTAMP')},
|
|
productionDate: {
|
|
type: DataTypes.DATEONLY,
|
|
allowNull: false,
|
|
defaultValue: sequelize.literal('CURRENT_DATE')},
|
|
completionCount: {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: false,
|
|
defaultValue: 1}
|
|
}, {
|
|
sequelize,
|
|
modelName: 'DayProduction',
|
|
tableName: 'production',
|
|
schema: 'falukant_log',
|
|
timestamps: false,
|
|
underscored: true,
|
|
indexes: [
|
|
{
|
|
unique: true,
|
|
fields: ['producer_id', 'product_id', 'region_id', 'production_date']
|
|
}
|
|
]
|
|
});
|
|
|
|
export default DayProduction;
|