Implement group management system #225
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements comprehensive Group Management System for organizing interviewers and candidates into efficient scheduling groups. Includes full CRUD operations, role-based member assignment, bidirectional user-group synchronization, and advanced filtering with search and pagination.
Features Added
1. Enhanced Group Model
Modified
backend/src/models/group.tswith new fields per requirements:2. Group API Endpoints
POST /api/groupsGET /api/groupstype- Filter by 'interviewer', 'candidate', or 'both'search- Case-insensitive partial name matchingpage- Pagination page number (default: 1)limit- Results per page (default: 20, max: 100)GET /api/groups/:idPUT /api/groups/:idDELETE /api/groups/:idPOST /api/groups/:id/membersmembersarray (interviewers/admins) orcandidatesarray based on user.roleDELETE /api/groups/:id/members/:userIdGET /api/groups/:id/members3. Validation & Error Handling
createGroupSchema: Validates all creation fields with proper typesupdateGroupSchema: Validates update fields (teamId not allowed)addMemberSchema: Validates userId formatgroupFilterSchema: Validates query parametersSecurity & Permissions
PermissionChecker.requireTeamAccess()Data Consistency
All group membership changes maintain data consistency:
Acceptance Criteria Met
Files Changed
backend/src/models/group.ts- Enhanced model with type, description, candidates, settings, compound indexbackend/src/routes/groupRoutes.ts- Complete CRUD implementation with validation, filtering, error handlingCloses #108