Add reputation attribute to FalukantCharacter model and update related services and views
- Introduced a new 'reputation' attribute in the FalukantCharacter model with a default value and validation. - Updated FalukantService to include 'reputation' in character attributes for API responses. - Enhanced ReputationView component to display current reputation and load it from the API. - Added translations for reputation in both German and English locales.
This commit is contained in:
@@ -34,6 +34,18 @@ FalukantCharacter.init(
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 1}
|
||||
,
|
||||
reputation: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
// Initialisierung: zufällig 20..80 (Prozent)
|
||||
// DB-seitig per DEFAULT umgesetzt, damit es auch ohne App-Logic gilt.
|
||||
defaultValue: sequelize.literal('(floor(random()*61)+20)'),
|
||||
validate: {
|
||||
min: 0,
|
||||
max: 100
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
|
||||
Reference in New Issue
Block a user