Update training group management and enhance UI components

This commit introduces the `TrainingGroup` model and related functionality, allowing for the management of training groups within the application. The `ClubService` is updated to automatically create preset groups upon club creation. The frontend is enhanced with new views and components, including `TrainingGroupsView` and `TrainingGroupsTab`, to facilitate the display and management of training groups. Additionally, the `MembersView` is updated to allow adding and removing members from training groups, improving the overall user experience and interactivity in managing club members and their associated training groups.
This commit is contained in:
Torsten Schulz (local)
2025-11-15 20:38:53 +01:00
parent fd4b47327f
commit 7a9e856961
21 changed files with 2232 additions and 299 deletions

View File

@@ -0,0 +1,33 @@
import express from 'express';
import { authenticate } from '../middleware/authMiddleware.js';
import {
getTrainingGroups,
createTrainingGroup,
updateTrainingGroup,
deleteTrainingGroup,
addMemberToGroup,
removeMemberFromGroup,
getMemberGroups,
ensurePresetGroups,
enablePresetGroup,
} from '../controllers/trainingGroupController.js';
const router = express.Router();
router.use(authenticate);
// Spezifischere Routen zuerst (mit /member/ im Pfad)
router.get('/:clubId/member/:memberId', getMemberGroups);
router.post('/:clubId/:groupId/member/:memberId', addMemberToGroup);
router.delete('/:clubId/:groupId/member/:memberId', removeMemberFromGroup);
// Allgemeinere Routen danach
router.post('/:clubId/ensure-preset-groups', ensurePresetGroups);
router.post('/:clubId/enable-preset-group/:presetType', enablePresetGroup);
router.get('/:clubId', getTrainingGroups);
router.post('/:clubId', createTrainingGroup);
router.put('/:clubId/:groupId', updateTrainingGroup);
router.delete('/:clubId/:groupId', deleteTrainingGroup);
export default router;