ReviewerApprovalLogic - IEEE-Team-3/map GitHub Wiki
Reviewers ensure that the submitted tasks meet the required criteria. They have the ability to approve or reject task submissions.
- Once the task is submitted, the reviewer is notified.
- The reviewer checks the submission for correctness and quality.
- The reviewer either approves or rejects the submission.
- If approved, the task status is updated to "completed," and points are awarded.
- If rejected, the task status is updated to "rejected," and feedback is provided to the assignee.
- Admins and team leads are typically designated as reviewers.
- Custom roles can be created to allow specific users to approve/reject tasks.
const TaskReviewSchema = new Schema({
taskId: { type: Schema.Types.ObjectId, ref: 'Task' },
reviewerId: { type: Schema.Types.ObjectId, ref: 'User' },
status: { type: String, enum: ['approved', 'rejected'], required: true },
feedback: String, // Feedback provided to the assignee
reviewDate: Date
});
if (task.status === 'submitted' && reviewerHasPermission(reviewer)) {
task.status = 'approved';
task.save();
} else {
task.status = 'rejected';
task.save();
}