Open
Description
Description
Create endpoints that will support flexible schemas for non-required fields and toggle their visibility (e.g. director can add a field called “areDuesPaid” which is or isn’t visible to members of their chapter)
Things to consider:
- This is not only limited to the member schema, to ensure the highest code quality we want it to be versatile to other schemas that might exist like chapters and projects
- Due to the optional nature of new fields we won't have issues if fields don't exist in all documents
- Frontend needs to know the new fields so that they can be displayed
- All-new optional fields must contain a viewable field within (view permissions)
- Even though this is backend only while developing think of the frontend implementation too. This might save you from unnecessary endpoints or headaches
Learning objectives
- MongoDB usage and its features
Todo
These points are a rough guideline. Please feel free to discuss with others on the team about the best way to design this component!
- Brainstorm methods of storing new optional fields made by admins (maybe a new schema?)
- Brainstorm endpoints that will be useful for the frontend to know
- Look over
../models/members.js
and linked related question - Implement endpoints in
../src/api/
folder - Test using Postman