-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: New rating framework #42
Conversation
- ratingCategory - ratingField - overallReview - fieldReview
f9d9ea0
to
7037f44
Compare
7037f44
to
1b899f7
Compare
1b899f7
to
c98bee9
Compare
export default class RatingCategoryController { | ||
static async createRatingCategory(req, res) { | ||
try { | ||
const results = v.safeParse(ratingCategorySchema, req.body); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TresorRw it could be better if we have some validation middleware which accept the schema and return the result instead of importing this "valibot" in every files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @leandreAlly, Let me look into that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @leandreAlly, Kindly review again and let me know
c98bee9
to
9182f64
Compare
What does this PR do?
This PR includes the implementation of the new rating framework which gives the admin abilities to manage rating categories and their fields.
This new rating framework gives more detailed reviews across the team.
Short demo at loom
Description of Task to be completed?
Allow the admin to set rating categories and their fields which helps in making reviews for the team
This added new controllers, and services for each of the modules (Rating category, Rating Field) and refined the Overall Review to help in implementing this new rating framework.
Requirements
How should this be manually tested?
To test this new you need to log in as admin if you want to manage category and their fields because he is the one to manage them.
To manage rating categories
POST /api/v1/ratingCategories
send this request with aname
in the request body (It is required, it will return an error if it's not provided)GET /api/v1/ratingCategories
returns all registered categories with their corresponding fields it existsGET /api/v1/ratingCategories/<category_id>
returns rating category if it exists otherwise its errorPATCH /api/v1/ratingCategories/<category_id>
updates a rating category nameDELETE /api/v1/ratingCategories/<category_id>
deletes a rating categoryTo manage rating fields
POST /api/v1/ratingFields
send this request with aname
andcategoryId
in the request body (It is required, it will return an error if it's not provided)GET /api/v1/ratingFields
returns all registered rating fieldsGET /api/v1/ratingFields/<rating_id>
returns rating fields if it exists otherwise its errorDELETE /api/v1/ratingFields/<rating_id>
deletes a rating fieldCreating A Review
This is where the change comes in, a user must provide this request body but with the correct data
Note:
fieldReviews
key must be an array, if you provide wrong data you will get validation messages to tell you what is going onAny background context you want to provide?
None
What are the relevant pivotal tracker stories?
Story ID: 187364953
Screenshots (if appropriate)
Questions: