Add a feedbacks field to User model. A list of Feedback
Feedback model should contain the following fields:
author (required) - The user who gives the feedback
feedback (required) - The feedback itself
recipient (required) - The user that receives the feedback
Feedback controller should include the following methods:
create (ADMIN only)
update (ADMIN only)
delete (Only ADMIN that created the feedback.)
list
show
Suggested tests:
- Create feedback using an
ADMIN user (should return 201 - Created)
- Create feedback using a user from any other level (should return 401 - Unauthorized)
- Update feedback using an
ADMIN user (should return 200 - OK)
- Update feedback using a user from any other level (should return 401 - Unauthorized)
- Delete feedback using an
ADMIN that created the feedback (should return 200 - OK)
- Delete feedback using other
ADMIN (should return 401 - Unauthorized)
- Delete feedback using a user from any other level (should return 401 - Unauthorized)
- List all feedback using an
ADMIN user (should return 200 - OK)
- List all feedback using a user from any other level (should return 200 - OK)
- View a feedback using an
ADMIN user (should return 200 - OK)
- View a feedback using a user from any other level (should return 200 - OK)
- Create/Update feedback without required fields
Add a
feedbacksfield toUsermodel. A list ofFeedbackFeedbackmodel should contain the following fields:author(required) - The user who gives the feedbackfeedback(required) - The feedback itselfrecipient(required) - The user that receives the feedbackFeedbackcontroller should include the following methods:create(ADMINonly)update(ADMINonly)delete(OnlyADMINthat created the feedback.)listshowSuggested tests:
ADMINuser (should return 201 - Created)ADMINuser (should return 200 - OK)ADMINthat created the feedback (should return 200 - OK)ADMIN(should return 401 - Unauthorized)ADMINuser (should return 200 - OK)ADMINuser (should return 200 - OK)