feat(MemberGroupPhoto): implement group photo management functionality
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 38s

- Added MemberGroupPhoto model and established relationships with Club and User models.
- Introduced new routes for managing group photos in the backend.
- Enhanced frontend components to support group photo cropping and member image updates.
- Updated localization files to include new terms related to group photo processing across multiple languages.
- Refactored server.js to include MemberGroupPhoto in the synchronization process.
This commit is contained in:
Torsten Schulz (local)
2026-04-15 22:45:35 +02:00
parent 5fa34637ba
commit 1dd7bb24ea
26 changed files with 1384 additions and 2 deletions

View File

@@ -0,0 +1,80 @@
import { DataTypes } from 'sequelize';
import sequelize from '../database.js';
const MemberGroupPhoto = sequelize.define('MemberGroupPhoto', {
id: {
type: DataTypes.INTEGER,
autoIncrement: true,
primaryKey: true,
allowNull: false
},
clubId: {
type: DataTypes.INTEGER,
allowNull: false,
field: 'club_id',
references: {
model: 'clubs',
key: 'id'
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE'
},
title: {
type: DataTypes.STRING(255),
allowNull: false
},
description: {
type: DataTypes.TEXT,
allowNull: true
},
fileName: {
type: DataTypes.STRING(255),
allowNull: false,
field: 'file_name'
},
originalFileName: {
type: DataTypes.STRING(255),
allowNull: true,
field: 'original_file_name'
},
mimeType: {
type: DataTypes.STRING(100),
allowNull: true,
field: 'mime_type'
},
fileSize: {
type: DataTypes.INTEGER,
allowNull: true,
field: 'file_size'
},
width: {
type: DataTypes.INTEGER,
allowNull: true
},
height: {
type: DataTypes.INTEGER,
allowNull: true
},
takenAt: {
type: DataTypes.DATE,
allowNull: true,
field: 'taken_at'
},
createdByUserId: {
type: DataTypes.INTEGER,
allowNull: true,
field: 'created_by_user_id',
references: {
model: 'user',
key: 'id'
},
onDelete: 'SET NULL',
onUpdate: 'CASCADE'
}
}, {
tableName: 'member_group_photo',
underscored: true,
timestamps: true
});
export default MemberGroupPhoto;

View File

@@ -49,6 +49,7 @@ import ApiLog from './ApiLog.js';
import MemberTransferConfig from './MemberTransferConfig.js';
import MemberContact from './MemberContact.js';
import MemberImage from './MemberImage.js';
import MemberGroupPhoto from './MemberGroupPhoto.js';
import MemberTtrHistory from './MemberTtrHistory.js';
import MemberPlayInterest from './MemberPlayInterest.js';
import MemberOrder from './MemberOrder.js';
@@ -102,6 +103,11 @@ MemberPlayInterest.belongsTo(Member, { as: 'member', foreignKey: 'memberId' });
Club.hasMany(MemberPlayInterest, { as: 'memberPlayInterests', foreignKey: 'clubId' });
MemberPlayInterest.belongsTo(Club, { as: 'club', foreignKey: 'clubId' });
Club.hasMany(MemberGroupPhoto, { as: 'memberGroupPhotos', foreignKey: 'clubId' });
MemberGroupPhoto.belongsTo(Club, { as: 'club', foreignKey: 'clubId' });
User.hasMany(MemberGroupPhoto, { as: 'createdMemberGroupPhotos', foreignKey: 'createdByUserId' });
MemberGroupPhoto.belongsTo(User, { as: 'createdByUser', foreignKey: 'createdByUserId' });
Member.hasMany(MemberOrder, { as: 'orders', foreignKey: 'memberId' });
MemberOrder.belongsTo(Member, { as: 'member', foreignKey: 'memberId' });
Club.hasMany(MemberOrder, { as: 'memberOrders', foreignKey: 'clubId' });
@@ -442,6 +448,7 @@ export {
MemberTransferConfig,
MemberContact,
MemberImage,
MemberGroupPhoto,
MemberTtrHistory,
MemberPlayInterest,
MemberOrder,