website-backend icon indicating copy to clipboard operation
website-backend copied to clipboard

chore: Remove unused members route and handlers

Open JC-Coder opened this issue 1 month ago • 7 comments

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:

  1. https://github.com/Real-Dev-Squad/members-site/pull/198
  2. 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 Screenshot 2025-11-09 at 2 37 25 AM

Test Coverage

Screenshot 1 Screenshot 2025-11-09 at 2 37 01 AM Screenshot 2025-11-09 at 2 37 17 AM

Additional Notes

JC-Coder avatar Nov 09 '25 01:11 JC-Coder

[!IMPORTANT]

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in 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_instructions setting.
  • Format the summary however you like (bullet lists, tables, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Nov 09 '25 01:11 coderabbitai[bot]

I was unable to write a description for this pull request. This could be because I only found files I can't scan.

korbit-ai[bot] avatar Nov 09 '25 01:11 korbit-ai[bot]

@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

vinit717 avatar Nov 10 '25 18:11 vinit717

@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 avatar Nov 12 '25 07:11 JC-Coder

  • @JC-Coder please raise the PR for the Updating the api contracts also and mention in that pr

AnujChhikara avatar Nov 12 '25 16:11 AnujChhikara

@AnujChhikara @vinit717 all issues fixed

JC-Coder avatar Nov 13 '25 08:11 JC-Coder

Website contract has been updated

here is the pr : https://github.com/Real-Dev-Squad/website-api-contracts/pull/251

JC-Coder avatar Nov 14 '25 02:11 JC-Coder

I was unable to write a description for this pull request. This could be because I only found files I can't scan.

korbit-ai[bot] avatar Nov 18 '25 02:11 korbit-ai[bot]