Implement cross-club friendly match concept with invitations and shared matches
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 49s
All checks were successful
Deploy tt-tagebuch / deploy (push) Successful in 49s
- Added controllers for handling friendly match invitations and shared matches. - Created migration scripts for `friendly_match_invitation` and `friendly_match_shared` tables. - Developed models for `FriendlyMatchInvitation` and `FriendlyMatchShared`. - Established routes for managing invitations and shared matches. - Implemented services for business logic related to invitations and shared matches. - Documented the concept plan for the new feature including API endpoints and data models.
This commit is contained in:
20
backend/routes/friendlyMatchInvitationRoutes.js
Normal file
20
backend/routes/friendlyMatchInvitationRoutes.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import express from 'express';
|
||||
import {
|
||||
acceptFriendlyMatchInvitation,
|
||||
createFriendlyMatchInvitation,
|
||||
declineFriendlyMatchInvitation,
|
||||
listIncomingFriendlyMatchInvitations,
|
||||
listOutgoingFriendlyMatchInvitations,
|
||||
} from '../controllers/friendlyMatchInvitationController.js';
|
||||
import { authenticate } from '../middleware/authMiddleware.js';
|
||||
import { authorize } from '../middleware/authorizationMiddleware.js';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.post('/:clubId', authenticate, authorize('schedule', 'write'), createFriendlyMatchInvitation);
|
||||
router.get('/:clubId/incoming', authenticate, authorize('schedule', 'read'), listIncomingFriendlyMatchInvitations);
|
||||
router.get('/:clubId/outgoing', authenticate, authorize('schedule', 'read'), listOutgoingFriendlyMatchInvitations);
|
||||
router.post('/:clubId/:invitationId/accept', authenticate, authorize('schedule', 'write'), acceptFriendlyMatchInvitation);
|
||||
router.post('/:clubId/:invitationId/decline', authenticate, authorize('schedule', 'write'), declineFriendlyMatchInvitation);
|
||||
|
||||
export default router;
|
||||
20
backend/routes/friendlyMatchSharedRoutes.js
Normal file
20
backend/routes/friendlyMatchSharedRoutes.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import express from 'express';
|
||||
import {
|
||||
deleteSharedFriendlyMatch,
|
||||
findSharedFriendlyMatches,
|
||||
listSharedFriendlyMatches,
|
||||
updateSharedFriendlyMatch,
|
||||
updateSharedFriendlyMatchPlayers,
|
||||
} from '../controllers/friendlyMatchSharedController.js';
|
||||
import { authenticate } from '../middleware/authMiddleware.js';
|
||||
import { authorize } from '../middleware/authorizationMiddleware.js';
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.get('/find', authenticate, authorize('schedule', 'read'), findSharedFriendlyMatches);
|
||||
router.get('/shared/:clubId', authenticate, authorize('schedule', 'read'), listSharedFriendlyMatches);
|
||||
router.put('/shared/:clubId/:matchId', authenticate, authorize('schedule', 'write'), updateSharedFriendlyMatch);
|
||||
router.patch('/shared/:clubId/:matchId/players', authenticate, authorize('schedule', 'write'), updateSharedFriendlyMatchPlayers);
|
||||
router.delete('/shared/:clubId/:matchId', authenticate, authorize('schedule', 'write'), deleteSharedFriendlyMatch);
|
||||
|
||||
export default router;
|
||||
Reference in New Issue
Block a user