Provide basic group functionality for customer segmentation#27
Open
JustShah wants to merge 4 commits into
Open
Provide basic group functionality for customer segmentation#27JustShah wants to merge 4 commits into
JustShah wants to merge 4 commits into
Conversation
3808f85 to
014dba4
Compare
e5868ec to
b19d82d
Compare
448813f to
fb116e2
Compare
b19d82d to
d6bea81
Compare
eea994f to
07acd8b
Compare
- Implemented the `set_user_group` method in `Spree::Api::UsersController`. - This method assigns the default user group to a new user if the current store has the `enforce_group_upon_signup` setting enabled. - Ensures that new users are automatically added to the specified user group during signup.
- Modified the `user_attributes` preference in `Spree::ApiConfiguration` to include `:user_group_id`. - This change allows the user group information to be included in API responses for user details.
- Updated the user request specs to test the assignment of the default user group upon user creation. - Added scenarios to verify that the user group is assigned when `enforce_group_upon_signup` is enabled and not assigned when it is disabled.
- Updated the `@@user_attributes` in `Spree::PermittedAttributes` to include `:user_group_id`. - This allows the user group to be permitted during user creation and updates via the API.
d6bea81 to
2873fb4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Overview:
This pull request introduces functionality to automatically assign a user group to new users upon signup, based on the store's configuration. This enhancement allows for better user management and organization within the application by ensuring that users are categorized into appropriate groups from the moment they register.
Key Changes:
User Group Assignment Logic:
set_user_groupmethod in theSpree::Api::UsersController. This method checks if the current store has theenforce_group_upon_signupsetting enabled and assigns the default user group to new users accordingly.API Configuration Update:
user_attributespreference inSpree::ApiConfigurationto include:user_group_id. This change allows the user group information to be included in API responses for user details.Request Specs for User Group Assignment:
enforce_group_upon_signupis enabled and not assigned when it is disabled.Permitted Attributes Update:
@@user_attributesinSpree::PermittedAttributesto include:user_group_id, allowing the user group to be permitted during user creation and updates via the API.Benefits: