Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(refactor): refactored user schema to camelcasing #53

Closed

Conversation

prasanth7890
Copy link

@prasanth7890 prasanth7890 commented Nov 27, 2023

closes #44

👷🏻 Changes made

I rewrote the UserSchema and ReportProblemSchema to follow camelCase naming conventions for improved readability and consistency. Also updated instances in code where these schema models are referenced to reflect the case changes.

Summary by CodeRabbit

  • Refactor

    • Standardized naming conventions across the application by updating field names to camelCase (e.g., usertype to userType, firstname to firstName, lastname to lastName, reportmessage to reportMessage).
  • Bug Fixes

    • Corrected case sensitivity issues in database queries to ensure consistent data retrieval.
  • Documentation

    • Updated internal documentation to reflect changes in naming conventions and query parameters.

Copy link

coderabbitai bot commented Nov 27, 2023

Walkthrough

The recent updates across various JavaScript files and Mongoose schemas in the codebase reflect a shift towards standardizing naming conventions. Specifically, the changes involve adopting camelCase for variable and property names, aligning with common JavaScript practices. This includes modifying fields such as usertype, firstname, and lastname to userType, firstName, and lastName, respectively.

Changes

File Path Change Summary
routes/club/Club.js
routes/display/Display.js
routes/user/Auth.js
routes/user/User.js (multiple instances)
schema/user/ReportProblemSchema.js
schema/user/UserSchema.js
Renamed fields from usertype, firstname, lastname, and reportmessage to userType, firstName, lastName, and reportMessage to adopt camelCase naming convention.

Assessment against linked issues

Objective Addressed Explanation
Refactor user schema to use camel casing (#44) The changes in ReportProblemSchema.js and UserSchema.js reflect the adoption of camelCase, which aligns with the issue's requirement for improved naming conventions.

Poem

In the code where fields align,
A rabbit hopped to redefine.
With a leap and a bound, camelCase was found,
Now the code reads quite divine. 🐇✨


Tips

Chat with CodeRabbit Bot (@coderabbitai)

  • If you reply to a review comment from CodeRabbit, the bot will automatically respond.
  • To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment
  • Note: Review comments are made on code diffs or files, not on the PR overview.
  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Note: For conversation with the bot, please use the review comments on code diffs or files.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @prasanth7890, thank you for raising a pull request.

Currently, the pull request is marked as https://github.com/MilanCommunity/Milan-Backend/labels/%F0%9F%9F%A3%20status%3A%20todo so please wait until the maintainers/owner review it and provide you with feedback/suggestions to proceed further.

Feel free to reach out to Tamal on Twitter, or drop a mail at tamalcodes@gmail.com if you think that this pull request is of critical priority.

Give us a ⭐ to show some support
Happy OpenSource 🚀

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 2

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between a06c909 and 0e976eb.
Files selected for processing (6)
  • routes/club/Club.js (1 hunks)
  • routes/display/Display.js (1 hunks)
  • routes/user/Auth.js (3 hunks)
  • routes/user/User.js (3 hunks)
  • schema/user/ReportProblemSchema.js (1 hunks)
  • schema/user/UserSchema.js (1 hunks)
Files skipped from review due to trivial changes (3)
  • routes/club/Club.js
  • routes/display/Display.js
  • routes/user/Auth.js
Additional comments: 4
routes/user/User.js (1)
  • 103-103: The query field has been correctly updated to userType: "individual" to match the new camelCase naming convention.
schema/user/ReportProblemSchema.js (2)
  • 5-20: The changes to the ReportProblemSchema fields to use camelCase are consistent with the pull request's intent to standardize naming conventions and align with JavaScript best practices.

  • 3-20: Verify that all references to the modified schema fields in the codebase have been updated to the new camelCase names to maintain consistency and prevent potential errors.

schema/user/UserSchema.js (1)
  • 3-14: The changes to the UserSchema fields from usertype to userType, firstname to firstName, and lastname to lastName are correctly implemented and follow JavaScript naming conventions.

routes/user/User.js Outdated Show resolved Hide resolved
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 0e976eb and 305f527.
Files selected for processing (1)
  • routes/user/User.js (3 hunks)
Additional comments: 2
routes/user/User.js (2)
  • 37-42: The changes to the UserData object correctly reflect the new camelCase naming convention.

  • 102-104: The query condition has been correctly updated to use camelCase for userType.

routes/user/User.js Show resolved Hide resolved
@prasanth7890 prasanth7890 deleted the Updatingto_CamelCasing branch November 27, 2023 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📂Other: user schema need to be refactored
1 participant