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

@@ -19,9 +19,7 @@ const FalukantPredefineFirstname = sequelize.define('firstname', {
{
unique: true,
fields: ['name', 'gender']
,
freezeTableName: true}
],
});
}
]});
export default FalukantPredefineFirstname;

View File

@@ -6,8 +6,7 @@ const FalukantPredefineLastname = sequelize.define('lastname', {
type: DataTypes.STRING,
length: 1,
allowNull: false
},
}, {
}}, {
tableName: 'lastname',
schema: 'falukant_predefine',
underscored: true,
@@ -16,9 +15,7 @@ const FalukantPredefineLastname = sequelize.define('lastname', {
{
unique: true,
fields: ['name']
,
freezeTableName: true}
],
});
}
]});
export default FalukantPredefineLastname;

View File

@@ -9,29 +9,22 @@ PoliticalOfficeBenefit.init({
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
political_office_id: {
autoIncrement: true},
politicalOfficeId: {
type: DataTypes.INTEGER,
allowNull: false,
},
benefit_type_id: {
allowNull: false},
benefitTypeId: {
type: DataTypes.INTEGER,
allowNull: false,
},
allowNull: false},
value: {
type: DataTypes.JSONB,
allowNull: false,
},
}, {
allowNull: false}}, {
sequelize,
modelName: 'PoliticalOfficeBenefit',
tableName: 'political_office_benefit',
schema: 'falukant_predefine',
timestamps: false,
underscored: true,
,
freezeTableName: true});
underscored: true});
// Association
PoliticalOfficeBenefit.belongsTo(PoliticalOfficeBenefitType, {

View File

@@ -9,27 +9,22 @@ PoliticalOfficePrerequisite.init({
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
autoIncrement: true},
// Neu: Feld heißt jetzt eindeutig "office_type_id"
office_type_id: {
officeTypeId: {
type: DataTypes.INTEGER,
allowNull: false,
},
field: 'office_type_id',
allowNull: false},
prerequisite: {
type: DataTypes.JSONB,
allowNull: false,
},
}, {
allowNull: false}}, {
sequelize,
modelName: 'PoliticalOfficePrerequisite',
tableName: 'political_office_prerequisite',
schema: 'falukant_predefine',
timestamps: false,
underscored: true,
,
freezeTableName: true});
underscored: true});
export default PoliticalOfficePrerequisite;

View File

@@ -5,33 +5,26 @@ import CharacterTrait from '../type/character_trait.js';
class PromotionalGiftCharacterTrait extends Model {}
PromotionalGiftCharacterTrait.init(
PromotionalGiftCharacterTrait.init(
{
gift_id: {
giftId: {
type: DataTypes.INTEGER,
references: {
model: PromotionalGift,
key: 'id',
},
allowNull: false,
field: 'gift_id',
references: { model: PromotionalGift, key: 'id' },
allowNull: false
},
trait_id: {
traitId: {
type: DataTypes.INTEGER,
references: {
model: CharacterTrait,
key: 'id',
},
allowNull: false,
field: 'trait_id',
references: { model: CharacterTrait, key: 'id' },
allowNull: false
},
suitability: {
type: DataTypes.INTEGER,
allowNull: false,
validate: {
min: 1,
max: 5,
},
},
},
max: 5}}},
{
sequelize,
modelName: 'PromotionalGiftCharacterTrait',
@@ -39,8 +32,9 @@ PromotionalGiftCharacterTrait.init(
schema: 'falukant_predefine',
timestamps: false,
underscored: true,
,
freezeTableName: true}
indexes: [
{ unique: true, fields: ['gift_id','trait_id'] }
]}
);
export default PromotionalGiftCharacterTrait;

View File

@@ -7,40 +7,44 @@ class PromotionalGiftMood extends Model {}
PromotionalGiftMood.init(
{
gift_id: {
giftId: {
type: DataTypes.INTEGER,
field: 'gift_id',
references: {
model: PromotionalGift,
key: 'id',
key: 'id'
},
allowNull: false,
allowNull: false
},
mood_id: {
moodId: {
type: DataTypes.INTEGER,
field: 'mood_id',
references: {
model: Mood,
key: 'id',
key: 'id'
},
allowNull: false,
allowNull: false
},
suitability: {
type: DataTypes.INTEGER,
allowNull: false,
validate: {
min: 1,
max: 5,
},
},
},
max: 5}}},
{
sequelize,
modelName: 'PromotionalGiftMood',
modelName: 'PromotionalGiftMood',
tableName: 'promotional_gift_mood',
schema: 'falukant_predefine',
timestamps: false,
underscored: true,
,
freezeTableName: true}
indexes: [
{
unique: true,
fields: ['gift_id', 'mood_id']
}
]
}
);
export default PromotionalGiftMood;