ReviewerApprovalLogic - IEEE-Team-3/map GitHub Wiki

Purpose

Reviewers ensure that the submitted tasks meet the required criteria. They have the ability to approve or reject task submissions.

Approval Process

  1. Once the task is submitted, the reviewer is notified.
  2. The reviewer checks the submission for correctness and quality.
  3. The reviewer either approves or rejects the submission.
  4. If approved, the task status is updated to "completed," and points are awarded.
  5. If rejected, the task status is updated to "rejected," and feedback is provided to the assignee.

Reviewer Roles

  • Admins and team leads are typically designated as reviewers.
  • Custom roles can be created to allow specific users to approve/reject tasks.

Example Schema

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
});

Approval Logic

if (task.status === 'submitted' && reviewerHasPermission(reviewer)) {
  task.status = 'approved';
  task.save();
} else {
  task.status = 'rejected';
  task.save();
}
⚠️ **GitHub.com Fallback** ⚠️