WIP ✨ feat: Implement Group Management with Create and Assign Functionality #5934
+167
−0
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
This pull request introduces a new Group model to the API, allowing for the creation and assignment of user groups. The changes include the addition of a new schema, updates to existing models, and new scripts for managing groups. Below are the most important changes:
Group Model Introduction:
api/models/Group.js
: Added the Group model usingmongoose
and the newgroupSchema
.api/models/schema/groupSchema.js
: Defined thegroupSchema
with fields forname
,description
,allowedEndpoints
, andallowedModels
.Integration with Existing Models:
api/models/index.js
: Added the Group model to the module exports. [1] [2]api/models/schema/userSchema.js
: Updated the user schema to include a reference to the Group model.Group Management Scripts:
config/create-group.js
: Added a script to create new groups, including prompts for group details and validation.config/assign-group.js
: Added a script to assign existing groups to users, with validation and error handling.Package Configuration:
package.json
: Updated the scripts section to include commands for creating and assigning groups.Change Type
Testing
Test Configuration:
Checklist