JKHeadley / JKHeadley/rest-hapi
Nested associations using User and Group Models
- Dominant language
- JavaScript
- Stars
- 1.2k
- Forks
- 155
- PR merge metrics
- No merged PRs in 30d
Description
Hi @JKHeadley,
I would appreciate your advice to redefine the user and group model associations. My goal is to define **Groups** for "Companies", "Consumers" and "SysAdmin". It means I will have **Companies** with many **Consumers** and many **Consumers** belonging to many **Companies**. At the end, we are talking about having **Users** associated with a **Group** (Consumer or Company). However, it is not clear to me how should I make this nested association within the **User** model (having Users inside Users) or if I should split this into a different model.
Thanks in advance,
@jadgsam
Contributor guide
Research direction
No files, tests, or entry points are named; begin by reviewing the issue body and the repository's existing User and Group model definitions. Clarify the intended Company, Consumer, and SysAdmin relationships with maintainers before making changes; done means an agreed association design is implemented and its behavior is covered by the project's relevant tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mongodb, node.js
- Domain
- backend-api-design, databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 18/100