Skip to content

Add PerformanceReview feature #9

@amaurymedeiros

Description

@amaurymedeiros

Add a reviews field to User model. A list of PerformanceReview

PerformanceReview model should contain the following fields:

  • author (required) - The user who asks for a performance review
  • admins (required) - A list of ADMIN users that can reply to the review
  • description (required) - The user's explanation regarding why their performance should be reviewed

PerformanceReview controller should include the following methods:

  • create (Regular users only)
  • update (Only the user that created the review)
  • delete (Only the user that created the review)
  • list (ADMIN can only list reviews which he belongs to the admins list. Regular users can only list reviews created by themselves)
  • show (ADMIN can only view reviews which he belongs to the admins list. Regular users can only view reviews created by themselves)
  • reply (ADMIN can only reply to reviews which he belongs to the admins list. Regular users can only reply to reviews created by themselves)

Suggested tests:

  • Create review using an ADMIN user (should return 401 - Unauthorized)
  • Create review using a user from any other level (should return 201 - Created)
  • Update review using the user that created it (should return 200 - OK)
  • Update review using a user that hasn't created it (should return 401 - Unauthorized)
  • Delete review using the user that created it (should return 200 - OK)
  • Delete review using a user that hasn't created it (should return 401 - Unauthorized)
  • List all reviews using an ADMIN user (should return 200 - OK, displaying only the reviews that has this ADMIN on the admins list)
  • List all reviews using a user from any other level (should return 200 - OK, displaying only the reviews created by them)
  • View a review using the user that created it (should return 200 - OK)
  • View a review using a regular user that hasn't created it (should return 401 - Unauthorized)
  • View a review using an ADMIN user that is not on the admins list of the review (should return 401 - Unauthorized)
  • View a review using an ADMIN user that is on the admins list of the review (should return 200 - OK)
  • Create/Update review without required fields

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions