feat(member-notes): enhance member note functionality with structured data and observation tracking
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 58s

This commit is contained in:
Torsten Schulz (local)
2026-08-14 13:39:00 +02:00
parent f59c7391b8
commit 313790428d
7 changed files with 262 additions and 16 deletions

View File

@@ -22,6 +22,40 @@ const MemberNote = sequelize.define('MemberNote', {
return decryptData(encryptedValue);
}
},
kind: {
type: DataTypes.ENUM('general', 'strength', 'development', 'training_focus'),
allowNull: false,
defaultValue: 'general',
},
trainingFocus: {
type: DataTypes.TEXT,
allowNull: true,
field: 'training_focus',
set(value) {
this.setDataValue('trainingFocus', value ? encryptData(value) : null);
},
get() {
const encryptedValue = this.getDataValue('trainingFocus');
return encryptedValue ? decryptData(encryptedValue) : null;
}
},
sourceType: {
type: DataTypes.STRING,
allowNull: true,
field: 'source_type',
},
sourceLabel: {
type: DataTypes.TEXT,
allowNull: true,
field: 'source_label',
set(value) {
this.setDataValue('sourceLabel', value ? encryptData(value) : null);
},
get() {
const encryptedValue = this.getDataValue('sourceLabel');
return encryptedValue ? decryptData(encryptedValue) : null;
}
},
memberId: {
type: DataTypes.INTEGER,
allowNull: false,