chore: Remove unused members route and handlers
Remove members and recruiters controllers, routes, validators, and related tests to streamline the codebase. This cleanup eliminates unused functionality and improves maintainability.
Date: 09/11/2025
Developer Name: JC CODER
Issue Ticket Number
#2488
Description
Deprecated the members api route, also removed all associated unused handlers and tests to ensure codebase is not bloated with unused codes
Video summary on changes :
https://pub-117edfe63835468a9b79d5439921520b.r2.dev/rds-website-backend-members-api-task.mp4
Associated PRs:
- https://github.com/Real-Dev-Squad/members-site/pull/198
- https://github.com/Real-Dev-Squad/website-api-contracts/pull/251
Documentation Updated?
- [ ] Yes
- [x] No
Under Feature Flag
- [ ] Yes
- [ ] No
Database Changes
- [ ] Yes
- [x] No
Breaking Changes
- [ ] Yes
- [x] No
Development Tested?
- [x] Yes
- [ ] No
Screenshots
Screenshot 1
Test Coverage
Screenshot 1
Additional Notes
[!IMPORTANT]
Review skipped
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.
Summary by CodeRabbit
-
Refactor
- Removed members management endpoints, controllers, and data access functionality
- Removed recruiters management endpoints, controllers, and data access functionality
- Removed associated validation middleware and route handlers
-
Tests
- Removed integration and unit test suites for members and recruiters features
-
Bug Fixes
- Fixed routing module import and formatting in configuration
Walkthrough
This PR removes all members and recruiters management features from the backend, including controllers, models, validators, routes, and their corresponding integration and unit tests. Route file cleanup includes an explicit import of devFlagMiddleware and deduplication.
Changes
| Cohort / File(s) | Summary |
|---|---|
Members Controller Removal controllers/members.js |
Deleted entire file containing getMembers, getIdleMembers, moveToMembers, and archiveMembers route handlers with their error handling and dependencies |
Recruiters Controller Removal controllers/recruiters.js |
Deleted entire file containing addRecruiter and fetchRecruitersInfo route handlers |
Members Model Cleanup models/members.js |
Removed fetchUsers, moveToMembers, and addArchiveRoleToMembers functions; module now exports only fetchUsersWithRole |
Recruiters Model Removal models/recruiters.js |
Deleted entire file containing addRecruiterInfo and fetchRecruitersInfo data access functions |
Validators Removal middlewares/validators/members.js, middlewares/validators/recruiter.js |
Removed validateGetMembers and validateRecruiter Joi-based validation middleware functions |
Routes Cleanup routes/members.js, routes/index.ts |
Deleted members routes file; added explicit devFlagMiddleware import and removed duplicate in index.ts with semicolon addition |
Services Cleanup services/dataAccessLayer.js |
Removed retrieveMembers function that fetched users and stripped sensitive info |
Integration Tests Removal test/integration/members.test.js, test/integration/recruiters.test.js |
Deleted entire test suites for members and recruiters endpoints |
Unit Tests Removal test/unit/models/recruiters.test.js, test/unit/services/dataAccessLayer.test.js |
Removed unit tests for recruiters model and retrieveMembers function |
Estimated code review effort
🎯 3 (Moderate) | ⏱️ ~20 minutes
- Verify no other files or external services depend on the deleted controllers, models, or validators (particularly members and recruiters functionality used elsewhere in routes or services)
- Confirm route removals do not break API contracts or existing integrations
- Ensure test removals align with the intended feature deprecation
- Check if any documentation or API specs reference the deleted endpoints
Suggested labels
backend, tests
Suggested reviewers
- AnujChhikara
- MayankBansal12
- iamitprakash
Poem
🐰 Goodbye members, farewell recruiters fine, Controllers and models, now benign— Tests swept away, routes set free, A cleaner codebase is our spree! Old features fade to memories' shrines.
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
| Description check | ✅ Passed | The pull request description clearly relates to the changeset, detailing the removal of members and recruiters controllers, routes, validators, and tests for codebase cleanup. |
| Title check | ✅ Passed | The title 'chore: Remove unused members and recuiters route and handlers' clearly describes the main objective of the PR—removing unused members and recruiters routes and their related code. |
[!TIP]
📝 Customizable high-level summaries are now available in beta!
You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
- Provide your own instructions using the
high_level_summary_instructionssetting.- Format the summary however you like (bullet lists, tables, contributor stats, etc.).
- Use
high_level_summary_in_walkthroughto move the summary from the description to the walkthrough section.Example:
"Create a concise high-level summary as a bullet-point list. Then include a Markdown table showing lines added and removed by each contributing author."
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
I was unable to write a description for this pull request. This could be because I only found files I can't scan.
@JC-Coder have you verified the use of the member site in different project? As the members api can be used on different sites over RDS
@JC-Coder have you verified the use of the member site in different project? As the members api can be used on different sites over RDS
yes , i've verified and it's not used elsewhere
- @JC-Coder please raise the PR for the Updating the api contracts also and mention in that pr
@AnujChhikara @vinit717 all issues fixed
Website contract has been updated
here is the pr : https://github.com/Real-Dev-Squad/website-api-contracts/pull/251
I was unable to write a description for this pull request. This could be because I only found files I can't scan.