feat: Einführung von Umgebungsvariablen und Startskripten für die Backend-Anwendung

- Hinzufügen eines zentralen Skripts zum Laden von Umgebungsvariablen aus einer .env-Datei.
- Implementierung von Start- und Entwicklungs-Skripten in der package.json für eine vereinfachte Ausführung der Anwendung.
- Bereinigung und Entfernung nicht mehr benötigter Minigame-Modelle und -Services zur Verbesserung der Codebasis.
- Anpassungen an den Datenbankmodellen zur Unterstützung von neuen Assoziationen und zur Verbesserung der Lesbarkeit.
This commit is contained in:
Torsten Schulz (local)
2025-08-23 22:27:19 +02:00
parent 66818cc728
commit 6da849ca3c
128 changed files with 1054 additions and 1611 deletions

View File

@@ -4,32 +4,26 @@ import { sequelize } from '../../../utils/sequelize.js';
class DayProduction extends Model { }
DayProduction.init({
region_id: {
regionId: {
type: DataTypes.INTEGER,
allowNull: false,
},
product_id: {
allowNull: false},
productId: {
type: DataTypes.INTEGER,
allowNull: false,
},
allowNull: false},
quantity: {
type: DataTypes.INTEGER,
allowNull: false,
},
producer_id: {
allowNull: false},
producerId: {
type: DataTypes.INTEGER,
allowNull: false,
},
production_timestamp: {
allowNull: false},
productionTimestamp: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
},
production_date: {
defaultValue: sequelize.literal('CURRENT_TIMESTAMP')},
productionDate: {
type: DataTypes.DATEONLY,
allowNull: false,
defaultValue: sequelize.literal('CURRENT_DATE'),
}
defaultValue: sequelize.literal('CURRENT_DATE')}
}, {
sequelize,
modelName: 'DayProduction',
@@ -40,9 +34,8 @@ DayProduction.init({
indexes: [
{
unique: true,
fields: ['producer_id', 'product_id', 'region_id', 'production_date']
,
freezeTableName: true}
fields: ['producerId', 'productId', 'regionId', 'productionDate']
}
]
});

View File

@@ -4,27 +4,22 @@ import { sequelize } from '../../../utils/sequelize.js';
class DaySell extends Model { }
DaySell.init({
region_id: {
regionId: {
type: DataTypes.INTEGER,
allowNull: false,
},
product_id: {
allowNull: false},
productId: {
type: DataTypes.INTEGER,
allowNull: false,
},
allowNull: false},
quantity: {
type: DataTypes.INTEGER,
allowNull: false,
},
seller_id: {
allowNull: false},
sellerId: {
type: DataTypes.INTEGER,
allowNull: false,
},
sell_timestamp: {
allowNull: false},
sellTimestamp: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: sequelize.literal('CURRENT_TIMESTAMP'),
}
defaultValue: sequelize.literal('CURRENT_TIMESTAMP')}
}, {
sequelize,
modelName: 'DaySell',
@@ -35,9 +30,8 @@ DaySell.init({
indexes: [
{
unique: true,
fields: ['seller_id', 'product_id', 'region_id']
,
freezeTableName: true}
fields: ['sellerId', 'productId', 'regionId']
}
]
});

View File

@@ -4,30 +4,24 @@ import { sequelize } from '../../../utils/sequelize.js';
class ElectionHistory extends Model { }
ElectionHistory.init({
election_id: {
electionId: {
type: DataTypes.INTEGER,
allowNull: false,
},
political_office_type_id: {
allowNull: false},
politicalOfficeTypeId: {
type: DataTypes.INTEGER,
allowNull: false,
},
election_date: {
allowNull: false},
electionDate: {
type: DataTypes.DATE,
allowNull: false,
},
election_result: {
allowNull: false},
electionResult: {
type: DataTypes.JSON,
allowNull: false,
}
allowNull: false}
}, {
sequelize,
modelName: 'ElectionHistory',
tableName: 'election_history',
schema: 'falukant_log',
timestamps: true,
underscored: true,
,
freezeTableName: true});
underscored: true});
export default ElectionHistory;

View File

@@ -7,21 +7,17 @@ HealthActivity.init({
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
character_id: {
autoIncrement: true},
characterId: {
type: DataTypes.INTEGER,
allowNull: false,
},
activity_tr: {
allowNull: false},
activityTr: {
type: DataTypes.STRING,
allowNull: false,
},
allowNull: false},
cost: {
type: DataTypes.FLOAT,
allowNull: false,
},
success_percentage: {
allowNull: false},
successPercentage: {
type: DataTypes.INTEGER,
allowNull: false
}
@@ -31,8 +27,6 @@ HealthActivity.init({
tableName: 'health_activity',
schema: 'falukant_log',
timestamps: true,
underscored: true,
,
freezeTableName: true});
underscored: true});
export default HealthActivity;

View File

@@ -4,43 +4,34 @@ import { sequelize } from '../../../utils/sequelize.js';
class MoneyFlow extends Model { }
MoneyFlow.init({
falukant_user_id: {
falukantUserId: {
type: DataTypes.INTEGER,
allowNull: false,
},
allowNull: false},
activity: {
type: DataTypes.STRING,
allowNull: false,
},
money_before: {
allowNull: false},
moneyBefore: {
type: DataTypes.DOUBLE,
allowNull: false,
},
money_after: {
allowNull: false},
moneyAfter: {
type: DataTypes.DOUBLE,
allowNull: true,
},
allowNull: true},
time: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: DataTypes.NOW
},
change_value: {
changeValue: {
type: DataTypes.DOUBLE,
allowNull: false,
},
changed_by: {
allowNull: false},
changedBy: {
type: DataTypes.INTEGER,
allowNull: true,
},
}, {
allowNull: true}}, {
sequelize,
modelName: 'MoneyFlow',
tableName: 'moneyflow',
schema: 'falukant_log',
timestamps: false,
underscored: true,
,
freezeTableName: true});
underscored: true});
export default MoneyFlow;

View File

@@ -4,27 +4,21 @@ import { sequelize } from '../../../utils/sequelize.js';
class Notification extends Model { }
Notification.init({
user_id: {
userId: {
type: DataTypes.INTEGER,
allowNull: false,
},
allowNull: false},
tr: {
type: DataTypes.STRING,
allowNull: false,
},
allowNull: false},
shown: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
},
}, {
defaultValue: false}}, {
sequelize,
modelName: 'Notification',
tableName: 'notification',
schema: 'falukant_log',
timestamps: true,
underscored: true,
,
freezeTableName: true});
underscored: true});
export default Notification;

View File

@@ -5,22 +5,18 @@ class PoliticalOfficeHistory extends Model { }
PoliticalOfficeHistory.init(
{
character_id: {
characterId: {
type: DataTypes.INTEGER,
allowNull: false,
},
office_type_id: {
allowNull: false},
officeTypeId: {
type: DataTypes.INTEGER,
allowNull: false,
},
start_date: {
allowNull: false},
startDate: {
type: DataTypes.DATE,
allowNull: false,
},
end_date: {
allowNull: false},
endDate: {
type: DataTypes.DATE,
allowNull: false,
}
allowNull: false}
},
{
sequelize,
@@ -28,9 +24,7 @@ PoliticalOfficeHistory.init(
tableName: 'political_office_history',
schema: 'falukant_log',
timestamps: true,
underscored: true,
,
freezeTableName: true}
underscored: true}
);
export default PoliticalOfficeHistory;

View File

@@ -4,30 +4,23 @@ import { sequelize } from '../../../utils/sequelize.js';
class PromotionalGiftLog extends Model { };
PromotionalGiftLog.init({
sender_character_id: {
senderCharacterId: {
type: DataTypes.INTEGER,
allowNull: false,
},
recipient_character_id: {
allowNull: false},
recipientCharacterId: {
type: DataTypes.INTEGER,
allowNull: false,
},
gift_id: {
allowNull: false},
giftId: {
type: DataTypes.INTEGER,
allowNull: false,
},
change_value: {
allowNull: false},
changeValue: {
type: DataTypes.INTEGER,
allowNull: false,
},
}, {
allowNull: false}}, {
sequelize,
modelName: 'PromotionalGiftLog',
tableName: 'promotional_gift',
schema: 'falukant_log',
timestamps: true,
underscored: true,
,
freezeTableName: true});
underscored: true});
export default PromotionalGiftLog;