<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Vshetty2</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Vshetty2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Vshetty2"/>
	<updated>2026-05-14T07:48:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=160720</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=160720"/>
		<updated>2024-12-04T05:18:55Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: /* Relevant Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Details about the Notification Model and Controller==&lt;br /&gt;
&lt;br /&gt;
The Notification model in Expertiza serves a critical role in enhancing communication and user engagement on the platform. It is essential because it automates the process of alerting users to significant events, such as receiving feedback, team changes, or assignment updates, without requiring users to actively seek out this information. By streamlining these updates, the model reduces the risk of missed information, helping users stay on top of their responsibilities, collaborate more effectively, and respond in a timely manner. This function is particularly valuable in a platform like Expertiza, where users juggle multiple assignments, peer reviews, and team interactions, and would otherwise need to manually monitor changes and updates or rely on external tools for reminders.&lt;br /&gt;
&lt;br /&gt;
The Notification model also improves the overall user experience by organizing and presenting notifications in a way that makes them easy to access and track. It stores notification details (like type, content, and timestamp) and associates them with specific users, ensuring each user receives personalized, relevant updates. Users can view notifications sorted by date or filtered by read/unread status, making it easier to prioritize tasks and responses. Ultimately, the Notification model supports Expertiza’s usability by helping users stay informed and accountable, contributing to an environment that encourages active participation and smooth collaboration across assignments.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
The objective was to create a Notification model in the backend to handle notifications for the Expertiza system. &lt;br /&gt;
&lt;br /&gt;
This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. &lt;br /&gt;
Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
The main objective is to create the Notification controller and model to handle sending and receiving notifications on the Expertiza platform.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic: Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
&amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
1. Model Creation:&lt;br /&gt;
&lt;br /&gt;
Create a Notification model with the following key attributes:&lt;br /&gt;
* id: Primary key (auto-generated).&lt;br /&gt;
* subject: Brief title of the notification.&lt;br /&gt;
* description: Detailed message of the notification.&lt;br /&gt;
* expiration_date: The date when the notification should expire.&lt;br /&gt;
* is_active: Boolean flag to mark if the notification is active or inactive.&lt;br /&gt;
* is_unread: Boolean to mark if a notification is unread (default to true for new notifications).&lt;br /&gt;
&lt;br /&gt;
2. Associations:&lt;br /&gt;
&lt;br /&gt;
* Define associations between Notification, User, and Course models.&lt;br /&gt;
* User Association: Each notification should have a creator (e.g., a teaching assistant or instructor).&lt;br /&gt;
* Course Association: Each notification should be linked to a course, and the enrolled students should be able to view relevant notifications.&lt;br /&gt;
&lt;br /&gt;
3. Relationships:&lt;br /&gt;
&lt;br /&gt;
* One-to-Many: Course to Notification, as each course can have multiple notifications.&lt;br /&gt;
* One-to-Many: User (creator) to Notification, as a user can create multiple notifications.&lt;br /&gt;
* Many-to-Many (indirect): User to Notification via course enrollment, as multiple students can view a notification if they are enrolled in the course associated with the notification.&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
[[File:Schema2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
===Associations===&lt;br /&gt;
&lt;br /&gt;
'''Notification'''&lt;br /&gt;
&lt;br /&gt;
* belongs_to :user - Links the notification to its creator (TA, instructor).&lt;br /&gt;
&lt;br /&gt;
* belongs_to :course - Links the notification to a course.&lt;br /&gt;
&lt;br /&gt;
'''User'''&lt;br /&gt;
&lt;br /&gt;
* has_many :notifications - Users (instructors, TAs) can create multiple notifications.&lt;br /&gt;
&lt;br /&gt;
* has_many :viewable_notifications, through: :courses - Students can view notifications for courses they are enrolled in.&lt;br /&gt;
&lt;br /&gt;
'''Course'''&lt;br /&gt;
&lt;br /&gt;
* has_many :notifications - Each course can have multiple notifications.&lt;br /&gt;
&lt;br /&gt;
* has_many :students, through: :enrollments - Defines which students are associated with the course.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[File:UML notification2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
''' Relationship Explanation''' &lt;br /&gt;
&lt;br /&gt;
* User to Notification: A User (e.g., TA, instructor) can create multiple notifications.&lt;br /&gt;
* Course to Notification: Each Course can have multiple notifications associated with it.&lt;br /&gt;
* User (Student) to Notification (Viewer): Through Course enrollment, students can access notifications related to their courses.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&amp;lt;b&amp;gt;NotificationController Implementation&amp;lt;/b&amp;gt;: Following are the controller methods:&lt;br /&gt;
&lt;br /&gt;
1. create:&lt;br /&gt;
&lt;br /&gt;
* Description: This method is responsible for creating a new notification. It validates the incoming data to ensure that all required fields are present and correctly formatted. Only authorized users (instructors or TAs) can create notifications. Upon successful creation, the method associates the notification with the specified course and user (creator).&lt;br /&gt;
* API Endpoint: POST /notifications&lt;br /&gt;
* Parameters:&lt;br /&gt;
** subject (required): The title of the notification that briefly describes its purpose (limited to 255 characters).&lt;br /&gt;
** description (optional): Detailed content of the notification.&lt;br /&gt;
** expiration_date (optional): The date until which the notification remains valid. Defaults to no expiration.&lt;br /&gt;
** is_active (optional): A boolean flag indicating if the notification is active (default is true).&lt;br /&gt;
** course_id (required): The course associated with the notification.&lt;br /&gt;
* Authorization: Ensures that only users with roles of TA or instructor can create a notification.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns the newly created notification with a 201 status.&lt;br /&gt;
** Error: Returns validation errors (e.g., missing fields, invalid data) with a 422 status.&lt;br /&gt;
&lt;br /&gt;
2. index:&lt;br /&gt;
&lt;br /&gt;
* Description: The index method retrieves a list of notifications based on specific filters, such as active status, unread status, or course association. This endpoint ensures that students only see notifications related to the courses they are enrolled in. It supports querying with multiple optional parameters for flexibility.&lt;br /&gt;
* API Endpoint: GET /notifications&lt;br /&gt;
* Parameters: Query parameters (optional):&lt;br /&gt;
** is_active: Filter notifications by their active status.&lt;br /&gt;
** is_unread: Retrieve only unread notifications for the current user.&lt;br /&gt;
** course_id: Fetch notifications specific to a course.&lt;br /&gt;
* Authorization: Students can only access notifications for courses they are enrolled in. Instructors and TAs can view all notifications they have created.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns an array of filtered notifications with a 200 status.&lt;br /&gt;
** Error: Returns a 403 status if unauthorized.&lt;br /&gt;
&lt;br /&gt;
3. show:&lt;br /&gt;
&lt;br /&gt;
* Description: This method retrieves the details of a specific notification identified by its unique ID. It ensures that the current user is authorized to view the notification (e.g., enrolled in the course or the creator of the notification).&lt;br /&gt;
* API Endpoint: GET /notifications/:id&lt;br /&gt;
* Parameters:&lt;br /&gt;
** id: The unique identifier of the notification to be retrieved.&lt;br /&gt;
* Authorization: Students can view notifications for courses they are enrolled in. Instructors and TAs can view notifications they have created.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns the notification details with a 200 status.&lt;br /&gt;
** Error: Returns a 404 status if the notification is not found or the user is unauthorized.&lt;br /&gt;
&lt;br /&gt;
4. update:&lt;br /&gt;
&lt;br /&gt;
* Description: This method allows the creator of a notification (TA or instructor) to update its details. It validates the incoming data and ensures that the user is authorized to make changes.&lt;br /&gt;
* API Endpoint: PUT /notifications/:id&lt;br /&gt;
* Parameters: Fields that can be updated include subject, description, expiration_date, and is_active.&lt;br /&gt;
* Authorization: Only the creator of the notification can update it.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns the updated notification with a 200 status.&lt;br /&gt;
** Error: Returns a 403 status if the user does not have the required permissions.&lt;br /&gt;
&lt;br /&gt;
5. destroy:&lt;br /&gt;
&lt;br /&gt;
* Description: This method deletes a specific notification. Only the user who created the notification can perform this action. The method ensures that no unauthorized users can delete notifications.&lt;br /&gt;
* API Endpoint: DELETE /notifications/:id&lt;br /&gt;
* Parameters:&lt;br /&gt;
** id: The unique identifier of the notification to be deleted.&lt;br /&gt;
* Authorization: Only the creator of the notification can delete it.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns a 204 status with no content upon successful deletion.&lt;br /&gt;
** Error: Returns a 403 status if the user is unauthorized.&lt;br /&gt;
&lt;br /&gt;
6. toggle_notification_visibility:&lt;br /&gt;
&lt;br /&gt;
* Description: This method toggles the is_active status of a notification. For example, a TA or instructor can deactivate a notification that is no longer relevant. The method ensures that only the creator of the notification can perform this action.&lt;br /&gt;
* API Endpoint: PATCH /notifications/:id/toggle&lt;br /&gt;
* Parameters:&lt;br /&gt;
** id: The unique identifier of the notification to be toggled.&lt;br /&gt;
* Authorization: Only the creator of the notification can toggle its visibility.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns the updated notification status with a 200 status.&lt;br /&gt;
** Error: Returns a 403 status if unauthorized.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Model Implementation&amp;lt;/b&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
1. Notification model:&lt;br /&gt;
&lt;br /&gt;
* Description: The Notification model represents a single notification. It includes all attributes, validations, and associations necessary for managing notifications.&lt;br /&gt;
* Attributes:&lt;br /&gt;
** subject: The title of the notification (required, max length: 255).&lt;br /&gt;
** description: The detailed content of the notification.&lt;br /&gt;
** expiration_date: The date when the notification should expire (validated to be in the future).&lt;br /&gt;
** is_active: Indicates whether the notification is active (default: true).&lt;br /&gt;
** is_unread: Marks if a notification is unread (default: true).&lt;br /&gt;
** course_id: Links the notification to a course.&lt;br /&gt;
** user_id: Links the notification to its creator.&lt;br /&gt;
* Associations:&lt;br /&gt;
** belongs_to :course&lt;br /&gt;
** belongs_to :user&lt;br /&gt;
* Validations:&lt;br /&gt;
** Ensures the presence of subject, course_id, and user_id.&lt;br /&gt;
** Validates expiration_date to ensure it is not in the past.&lt;br /&gt;
* Scopes:&lt;br /&gt;
** active: Filters notifications that are active.&lt;br /&gt;
** unread: Filters unread notifications for a user.&lt;br /&gt;
&lt;br /&gt;
2. User Model:&lt;br /&gt;
&lt;br /&gt;
* Associations:&lt;br /&gt;
** has_many :notifications (creator role).&lt;br /&gt;
** has_many :viewable_notifications, through: :courses (student role).&lt;br /&gt;
&lt;br /&gt;
3. Course Model:&lt;br /&gt;
&lt;br /&gt;
* Associations:&lt;br /&gt;
** has_many :notifications.&lt;br /&gt;
** has_many :students, through: :enrollments.&lt;br /&gt;
&lt;br /&gt;
== New Files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. Model for Notification (models/notification.rb) &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SoubarnicaSuresh/reimplementation-back-end/blob/main/app/models/notification.rb Commit]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
class Notification &amp;lt; ApplicationRecord&lt;br /&gt;
  # Associations&lt;br /&gt;
  belongs_to :course, foreign_key: :course_name, primary_key: :name&lt;br /&gt;
  belongs_to :user&lt;br /&gt;
  # Validations&lt;br /&gt;
  validates :subject, presence: true, length: { maximum: 255 }&lt;br /&gt;
  validates :description, presence: true&lt;br /&gt;
  validates :expiration_date, presence: true&lt;br /&gt;
  validate :expiration_date_cannot_be_in_the_past&lt;br /&gt;
  # Scopes&lt;br /&gt;
  scope :active, -&amp;gt; { where(active_flag: true) }&lt;br /&gt;
  scope :expired, -&amp;gt; { where('expiration_date &amp;lt; ?', Date.today) }&lt;br /&gt;
  scope :unread_by, -&amp;gt;(user) {&lt;br /&gt;
    joins(:course).where(courses: { id: user.assignments.pluck(:course_id) }).where(active_flag: true)&lt;br /&gt;
  }&lt;br /&gt;
  # Custom Validation for Expiration Date&lt;br /&gt;
  def expiration_date_cannot_be_in_the_past&lt;br /&gt;
    if expiration_date.present? &amp;amp;&amp;amp; expiration_date &amp;lt; Date.today&lt;br /&gt;
      errors.add(:expiration_date, &amp;quot;cannot be in the past&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; 2. Controller for Notification (controllers/notification_controller.rb) &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SoubarnicaSuresh/reimplementation-back-end/blob/main/app/controllers/api/v1/notifications_controller.rb Commit]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;class Api::V1::NotificationsController &amp;lt; ApplicationController&lt;br /&gt;
  include AuthorizationHelper&lt;br /&gt;
  before_action :set_notification, only: %i[show update destroy]&lt;br /&gt;
  # GET /notifications&lt;br /&gt;
  def index&lt;br /&gt;
    if current_user_has_instructor_privileges? || current_user_has_ta_privileges?&lt;br /&gt;
      @notifications = Notification.where(user_id: current_user.id)&lt;br /&gt;
    elsif current_user_has_student_privileges?&lt;br /&gt;
      course_names = current_user.courses.pluck(:name)&lt;br /&gt;
      @notifications = Notification.where(course_name: course_names, active_flag: true)&lt;br /&gt;
    else&lt;br /&gt;
      render json: { error: 'Access denied' }, status: :forbidden&lt;br /&gt;
      return&lt;br /&gt;
    end&lt;br /&gt;
    render json: @notifications&lt;br /&gt;
  end&lt;br /&gt;
  # GET /notifications/:id&lt;br /&gt;
  def show&lt;br /&gt;
    if notification_accessible?(@notification)&lt;br /&gt;
      render json: @notification&lt;br /&gt;
    else&lt;br /&gt;
      render json: { error: 'You do not have access to this notification.' }, status: :forbidden&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # POST /notifications&lt;br /&gt;
  def create&lt;br /&gt;
    # Check if the current user has sufficient privileges&lt;br /&gt;
    unless current_user_has_instructor_privileges? || current_user_has_ta_privileges?&lt;br /&gt;
      render json: { error: 'You are not authorized to create notifications.' }, status: :forbidden&lt;br /&gt;
      return&lt;br /&gt;
    end &lt;br /&gt;
    @notification = Notification.new(notification_params)&lt;br /&gt;
    @notification.user_id = current_user.id&lt;br /&gt;
  &lt;br /&gt;
    if @notification.save&lt;br /&gt;
      render json: @notification, status: :created&lt;br /&gt;
    else&lt;br /&gt;
      render json: @notification.errors, status: :unprocessable_entity&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PATCH/PUT /notifications/:id&lt;br /&gt;
  def update&lt;br /&gt;
    # Check if the current user has sufficient privileges&lt;br /&gt;
    unless current_user_has_instructor_privileges? || current_user_has_ta_privileges?&lt;br /&gt;
      render json: { error: 'You are not authorized to update notifications.' }, status: :forbidden&lt;br /&gt;
      return&lt;br /&gt;
    end&lt;br /&gt;
    if @notification.update(notification_params)&lt;br /&gt;
      render json: @notification, status: :ok&lt;br /&gt;
    else&lt;br /&gt;
      render json: @notification.errors, status: :unprocessable_entity&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /notifications/:id&lt;br /&gt;
  def destroy&lt;br /&gt;
    # Check if the current user has sufficient privileges&lt;br /&gt;
    unless current_user_has_instructor_privileges? || current_user_has_ta_privileges?&lt;br /&gt;
      render json: { error: 'You are not authorized to delete notifications.' }, status: :forbidden&lt;br /&gt;
      return&lt;br /&gt;
    end&lt;br /&gt;
    if @notification.destroy&lt;br /&gt;
      render json: { message: 'Notification deleted successfully.' }, status: :ok&lt;br /&gt;
    else&lt;br /&gt;
      render json: { error: 'Failed to delete the notification.' }, status: :unprocessable_entity&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PATCH /notifications/:id/toggle_active&lt;br /&gt;
  def toggle_notification_visibility&lt;br /&gt;
    if notification_accessible?(@notification)&lt;br /&gt;
      @notification.update(active_flag: !@notification.active_flag)&lt;br /&gt;
      render json: { message: 'Notification visibility toggled successfully.', notification: @notification }, status: :ok&lt;br /&gt;
    else&lt;br /&gt;
      render json: { error: 'You are not authorized to toggle this notification.' }, status: :forbidden&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  private&lt;br /&gt;
  # Use callbacks to share common setup or constraints between actions.&lt;br /&gt;
  def set_notification&lt;br /&gt;
    @notification = Notification.find(params[:id])&lt;br /&gt;
  rescue ActiveRecord::RecordNotFound&lt;br /&gt;
    render json: { error: 'Notification not found.' }, status: :not_found&lt;br /&gt;
  end&lt;br /&gt;
  # Define strong parameters for notification creation/update&lt;br /&gt;
  def notification_params&lt;br /&gt;
    params.require(:notification).permit(:course_name, :subject, :description, :expiration_date, :active_flag)&lt;br /&gt;
  end&lt;br /&gt;
  # Helper method to check if a notification is accessible to the current user&lt;br /&gt;
  def notification_accessible?(notification)&lt;br /&gt;
    # Instructors and TAs can access their own notifications&lt;br /&gt;
    return true if notification.user_id == current_user.id&lt;br /&gt;
    # Students can access notifications for their courses&lt;br /&gt;
    return true if current_user_has_student_privileges? &amp;amp;&amp;amp;&lt;br /&gt;
                   current_user.courses.exists?(name: notification.course_name)&lt;br /&gt;
    false&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Endpoints for Notification Management ==&lt;br /&gt;
&lt;br /&gt;
Endpoints for Creating, Reading, Updating, and Deleting (CRUD) Notifications&lt;br /&gt;
&lt;br /&gt;
1. POST /notifications - Create a new notification. The create method in the NotificationController implementation aligns with this endpoint, allowing authorized users to create notifications for specific courses.&lt;br /&gt;
&lt;br /&gt;
2. GET /notifications - Get a list of notifications (with optional filters, such as is_active or is_unread). The index method aligns with this endpoint, allowing filtered retrieval of notifications.&lt;br /&gt;
&lt;br /&gt;
3. GET /notifications/:id - View details of a specific notification. The show method aligns with this endpoint, retrieving specific notification details.&lt;br /&gt;
&lt;br /&gt;
4. PUT /notifications/:id - Update a specific notification. The update method allows modification of existing notifications, respecting role-based access.&lt;br /&gt;
&lt;br /&gt;
5. DELETE /notifications/:id - Delete a specific notification. The destroy method aligns with this endpoint, enabling notification deletion by authorized users.&lt;br /&gt;
&lt;br /&gt;
6. PATCH /notifications/:id/toggle - Toggle active state of a notification. The toggle_notification_visibility method handles this functionality, toggling the is_active flag.&lt;br /&gt;
&lt;br /&gt;
=Design Patterns and SOLID principles uses=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. Strategy Pattern&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use Case:&lt;br /&gt;
** Dynamically applying different filtering criteria for notifications (e.g., active notifications, unread notifications, notifications for a specific course).&lt;br /&gt;
** This modularizes the filtering logic, making it easier to extend or change in the future.&lt;br /&gt;
* Explanation:&lt;br /&gt;
** The Strategy Pattern separates filtering logic into individual strategy classes, making it easy to add new filters without modifying existing code.&lt;br /&gt;
** It also enhances the maintainability and testability of the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. Decorator Pattern&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use Case:&lt;br /&gt;
** Dynamically modifying the presentation of notifications based on user roles or other conditions.&lt;br /&gt;
** For example, students might see a simplified view of notifications, while instructors see a detailed view.&lt;br /&gt;
* Explanation:&lt;br /&gt;
** The Decorator Pattern adds additional functionality (like role-based formatting) without modifying the original Notification model.&lt;br /&gt;
** It keeps the model clean and focused on core functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Following are the some of the SOLID principles with how they will be applied to the back-end development:&amp;lt;/b&amp;gt;&lt;br /&gt;
* Single Responsibility : Controllers handle HTTP requests, models handle data, and service objects handle business logic (e.g., sending notifications).&lt;br /&gt;
* Open/Closed : Extend functionality (e.g., new notification types or filters) by adding new classes or methods without modifying existing code.&lt;br /&gt;
* Interface Segregation : Create small, role-specific interfaces (e.g., policies for TAs, students, instructors) and separate service objects for different types of notifications.&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
This section outlines the comprehensive testing approach for the Notifications feature to ensure it meets functional and non-functional requirements. The strategy includes detailed test cases for models, controllers, role-based access, and error handling, leveraging RSpec for testing and RSwag for API documentation.&lt;br /&gt;
&lt;br /&gt;
'''1. Unit Testing'''&lt;br /&gt;
&lt;br /&gt;
Goal: Ensure that the Notification model functions as expected by validating its attributes, associations, and methods.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SoubarnicaSuresh/reimplementation-back-end/blob/main/spec/models/notification_spec.rb File as on GitHub]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;Key Test Cases:&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* Validations:&lt;br /&gt;
** Presence validation for subject, description, expiration_date, course_id, and user_id.&lt;br /&gt;
** Length constraints on subject and description.&lt;br /&gt;
** Format validation for expiration_date.&lt;br /&gt;
&lt;br /&gt;
* Associations:&lt;br /&gt;
** belongs_to :user and belongs_to :course associations are correctly established.&lt;br /&gt;
** Notifications have appropriate relationships with Course and User models.&lt;br /&gt;
&lt;br /&gt;
* Custom Methods and Scopes:&lt;br /&gt;
** active_notifications: Ensure only active notifications are returned.&lt;br /&gt;
** unread_notifications: Validate that unread notifications are fetched correctly.&lt;br /&gt;
&lt;br /&gt;
* Edge Cases:&lt;br /&gt;
** Notifications with an expired expiration_date should not appear in the active notifications list.&lt;br /&gt;
** Handling invalid foreign keys for user_id and course_id.&lt;br /&gt;
&lt;br /&gt;
  require 'rails_helper'&lt;br /&gt;
  RSpec.describe Notification, type: :model do&lt;br /&gt;
  describe 'validations' do&lt;br /&gt;
    it { should validate_presence_of(:subject) }&lt;br /&gt;
    it { should validate_presence_of(:description) }&lt;br /&gt;
    it { should validate_presence_of(:expiration_date) }&lt;br /&gt;
    it { should validate_length_of(:subject).is_at_most(100) }&lt;br /&gt;
  end&lt;br /&gt;
  describe 'associations' do&lt;br /&gt;
    it { should belong_to(:user) }&lt;br /&gt;
    it { should belong_to(:course) }&lt;br /&gt;
  end&lt;br /&gt;
  describe 'scopes' do&lt;br /&gt;
    let!(:active_notification) { create(:notification, is_active: true) }&lt;br /&gt;
    let!(:expired_notification) { create(:notification, expiration_date: Date.yesterday) }&lt;br /&gt;
    it 'returns active notifications' do&lt;br /&gt;
      expect(Notification.active_notifications).to include(active_notification)&lt;br /&gt;
      expect(Notification.active_notifications).not_to include(expired_notification)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Controller Testing'''&lt;br /&gt;
&lt;br /&gt;
Goal: Test all CRUD operations for the Notifications controller to ensure endpoints function as expected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;Key Test Cases:&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Index Action:&lt;br /&gt;
** Ensure all notifications for a given user are returned.&lt;br /&gt;
** Verify that unauthorized users cannot access the endpoint.&lt;br /&gt;
** Test paginated responses if applicable.&lt;br /&gt;
* Show Action:&lt;br /&gt;
** Ensure notifications can be retrieved by id.&lt;br /&gt;
** Handle cases where id is invalid or unauthorized.&lt;br /&gt;
* Create Action:&lt;br /&gt;
** Validate successful creation of notifications with proper attributes.&lt;br /&gt;
** Handle validation failures and unauthorized access.&lt;br /&gt;
* Update Action:&lt;br /&gt;
** Test updates to notification attributes.&lt;br /&gt;
** Ensure unauthorized users cannot perform updates.&lt;br /&gt;
* Delete Action:&lt;br /&gt;
** Verify notifications are deleted successfully.&lt;br /&gt;
** Test behavior when id is invalid or unauthorized.&lt;br /&gt;
&lt;br /&gt;
 require 'rails_helper'&lt;br /&gt;
 RSpec.describe Api::V1::NotificationsController, type: :controller do&lt;br /&gt;
  let(:admin) { create(:user, role: 'Admin') }&lt;br /&gt;
  let(:student) { create(:user, role: 'Student') }&lt;br /&gt;
  let(:notification) { create(:notification) }&lt;br /&gt;
  describe 'GET #index' do&lt;br /&gt;
    before { sign_in admin }&lt;br /&gt;
    it 'returns notifications for the current user' do&lt;br /&gt;
      get :index&lt;br /&gt;
      expect(response).to have_http_status(:ok)&lt;br /&gt;
      expect(json_response).to include(notification)&lt;br /&gt;
    end&lt;br /&gt;
    it 'denies access to unauthorized users' do&lt;br /&gt;
      sign_out admin&lt;br /&gt;
      sign_in student&lt;br /&gt;
      get :index&lt;br /&gt;
      expect(response).to have_http_status(:forbidden)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  describe 'POST #create' do&lt;br /&gt;
    context 'with valid attributes' do&lt;br /&gt;
      it 'creates a new notification' do&lt;br /&gt;
        expect {&lt;br /&gt;
          post :create, params: { notification: attributes_for(:notification) }&lt;br /&gt;
        }.to change(Notification, :count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'with invalid attributes' do&lt;br /&gt;
      it 'returns validation errors' do&lt;br /&gt;
        post :create, params: { notification: { subject: '' } }&lt;br /&gt;
        expect(response).to have_http_status(:unprocessable_entity)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
'''3. Integration Testing'''&lt;br /&gt;
&lt;br /&gt;
Goal: Ensure seamless interaction between models, controllers, and role-based access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;Key Test Cases:&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Role-Based Access:&lt;br /&gt;
** Verify only authorized roles (e.g., Admin, Instructor) can manage notifications.&lt;br /&gt;
** Ensure students can only view notifications for their enrolled courses.&lt;br /&gt;
* Full CRUD Workflow:&lt;br /&gt;
** Test end-to-end creation, updating, and deletion of notifications.&lt;br /&gt;
* Error Scenarios:&lt;br /&gt;
** Handle cases where a notification is created for a non-existent course or user.&lt;br /&gt;
** Verify appropriate error messages for unauthorized actions.&lt;br /&gt;
&lt;br /&gt;
 RSpec.describe 'Notifications Integration', type: :request do&lt;br /&gt;
  let(:admin) { create(:user, role: 'Admin') }&lt;br /&gt;
  let(:student) { create(:user, role: 'Student') }&lt;br /&gt;
  let!(:notification) { create(:notification, user: admin) }&lt;br /&gt;
  it 'allows admins to create notifications' do&lt;br /&gt;
    sign_in admin&lt;br /&gt;
    post '/api/v1/notifications', params: { notification: attributes_for(:notification) }&lt;br /&gt;
    expect(response).to have_http_status(:created)&lt;br /&gt;
  end&lt;br /&gt;
  it 'prevents students from creating notifications' do&lt;br /&gt;
    sign_in student&lt;br /&gt;
    post '/api/v1/notifications', params: { notification: attributes_for(:notification) }&lt;br /&gt;
    expect(response).to have_http_status(:forbidden)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
'''4. API Documentation and Testing with RSwag'''&lt;br /&gt;
&lt;br /&gt;
Goal: Generate API documentation and test all endpoints.&lt;br /&gt;
&lt;br /&gt;
 RSpec.describe 'Notifications API', type: :request do&lt;br /&gt;
  path '/api/v1/notifications' do&lt;br /&gt;
    get 'Retrieve notifications' do&lt;br /&gt;
      tags 'Notifications'&lt;br /&gt;
      produces 'application/json'&lt;br /&gt;
      response '200', 'success' do&lt;br /&gt;
        schema type: :array, items: { type: :object, properties: { id: { type: :integer }, subject: { type: :string } } }&lt;br /&gt;
        run_test!&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    post 'Create a notification' do&lt;br /&gt;
      tags 'Notifications'&lt;br /&gt;
      consumes 'application/json'&lt;br /&gt;
      parameter name: :notification, in: :body, schema: {&lt;br /&gt;
        type: :object,&lt;br /&gt;
        properties: {&lt;br /&gt;
          subject: { type: :string },&lt;br /&gt;
          description: { type: :string },&lt;br /&gt;
          expiration_date: { type: :string, format: 'date' },&lt;br /&gt;
          is_active: { type: :boolean }&lt;br /&gt;
        },&lt;br /&gt;
        required: %w[subject description expiration_date]&lt;br /&gt;
      }&lt;br /&gt;
      response '201', 'created' do&lt;br /&gt;
        let(:notification) { { subject: 'Test', description: 'Test notification', expiration_date: '2024-12-31', is_active: true } }&lt;br /&gt;
        run_test!&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' [https://github.com/SoubarnicaSuresh/reimplementation-back-end reimplementation back-end]&lt;br /&gt;
* '''Demo Video Link''' [https://youtu.be/pct11aDPMRM?si=5HdZK3EGeW1z21Y_]&lt;br /&gt;
* '''Pull Request Link''' [https://github.com/expertiza/reimplementation-back-end/pull/142]&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=160715</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=160715"/>
		<updated>2024-12-04T05:14:34Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: /* Relevant Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Details about the Notification Model and Controller==&lt;br /&gt;
&lt;br /&gt;
The Notification model in Expertiza serves a critical role in enhancing communication and user engagement on the platform. It is essential because it automates the process of alerting users to significant events, such as receiving feedback, team changes, or assignment updates, without requiring users to actively seek out this information. By streamlining these updates, the model reduces the risk of missed information, helping users stay on top of their responsibilities, collaborate more effectively, and respond in a timely manner. This function is particularly valuable in a platform like Expertiza, where users juggle multiple assignments, peer reviews, and team interactions, and would otherwise need to manually monitor changes and updates or rely on external tools for reminders.&lt;br /&gt;
&lt;br /&gt;
The Notification model also improves the overall user experience by organizing and presenting notifications in a way that makes them easy to access and track. It stores notification details (like type, content, and timestamp) and associates them with specific users, ensuring each user receives personalized, relevant updates. Users can view notifications sorted by date or filtered by read/unread status, making it easier to prioritize tasks and responses. Ultimately, the Notification model supports Expertiza’s usability by helping users stay informed and accountable, contributing to an environment that encourages active participation and smooth collaboration across assignments.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
The objective was to create a Notification model in the backend to handle notifications for the Expertiza system. &lt;br /&gt;
&lt;br /&gt;
This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. &lt;br /&gt;
Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
The main objective is to create the Notification controller and model to handle sending and receiving notifications on the Expertiza platform.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic: Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
&amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
1. Model Creation:&lt;br /&gt;
&lt;br /&gt;
Create a Notification model with the following key attributes:&lt;br /&gt;
* id: Primary key (auto-generated).&lt;br /&gt;
* subject: Brief title of the notification.&lt;br /&gt;
* description: Detailed message of the notification.&lt;br /&gt;
* expiration_date: The date when the notification should expire.&lt;br /&gt;
* is_active: Boolean flag to mark if the notification is active or inactive.&lt;br /&gt;
* is_unread: Boolean to mark if a notification is unread (default to true for new notifications).&lt;br /&gt;
&lt;br /&gt;
2. Associations:&lt;br /&gt;
&lt;br /&gt;
* Define associations between Notification, User, and Course models.&lt;br /&gt;
* User Association: Each notification should have a creator (e.g., a teaching assistant or instructor).&lt;br /&gt;
* Course Association: Each notification should be linked to a course, and the enrolled students should be able to view relevant notifications.&lt;br /&gt;
&lt;br /&gt;
3. Relationships:&lt;br /&gt;
&lt;br /&gt;
* One-to-Many: Course to Notification, as each course can have multiple notifications.&lt;br /&gt;
* One-to-Many: User (creator) to Notification, as a user can create multiple notifications.&lt;br /&gt;
* Many-to-Many (indirect): User to Notification via course enrollment, as multiple students can view a notification if they are enrolled in the course associated with the notification.&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
[[File:Schema2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
===Associations===&lt;br /&gt;
&lt;br /&gt;
'''Notification'''&lt;br /&gt;
&lt;br /&gt;
* belongs_to :user - Links the notification to its creator (TA, instructor).&lt;br /&gt;
&lt;br /&gt;
* belongs_to :course - Links the notification to a course.&lt;br /&gt;
&lt;br /&gt;
'''User'''&lt;br /&gt;
&lt;br /&gt;
* has_many :notifications - Users (instructors, TAs) can create multiple notifications.&lt;br /&gt;
&lt;br /&gt;
* has_many :viewable_notifications, through: :courses - Students can view notifications for courses they are enrolled in.&lt;br /&gt;
&lt;br /&gt;
'''Course'''&lt;br /&gt;
&lt;br /&gt;
* has_many :notifications - Each course can have multiple notifications.&lt;br /&gt;
&lt;br /&gt;
* has_many :students, through: :enrollments - Defines which students are associated with the course.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[File:UML notification2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
''' Relationship Explanation''' &lt;br /&gt;
&lt;br /&gt;
* User to Notification: A User (e.g., TA, instructor) can create multiple notifications.&lt;br /&gt;
* Course to Notification: Each Course can have multiple notifications associated with it.&lt;br /&gt;
* User (Student) to Notification (Viewer): Through Course enrollment, students can access notifications related to their courses.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&amp;lt;b&amp;gt;NotificationController Implementation&amp;lt;/b&amp;gt;: Following are the controller methods:&lt;br /&gt;
&lt;br /&gt;
1. create:&lt;br /&gt;
&lt;br /&gt;
* Description: This method is responsible for creating a new notification. It validates the incoming data to ensure that all required fields are present and correctly formatted. Only authorized users (instructors or TAs) can create notifications. Upon successful creation, the method associates the notification with the specified course and user (creator).&lt;br /&gt;
* API Endpoint: POST /notifications&lt;br /&gt;
* Parameters:&lt;br /&gt;
** subject (required): The title of the notification that briefly describes its purpose (limited to 255 characters).&lt;br /&gt;
** description (optional): Detailed content of the notification.&lt;br /&gt;
** expiration_date (optional): The date until which the notification remains valid. Defaults to no expiration.&lt;br /&gt;
** is_active (optional): A boolean flag indicating if the notification is active (default is true).&lt;br /&gt;
** course_id (required): The course associated with the notification.&lt;br /&gt;
* Authorization: Ensures that only users with roles of TA or instructor can create a notification.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns the newly created notification with a 201 status.&lt;br /&gt;
** Error: Returns validation errors (e.g., missing fields, invalid data) with a 422 status.&lt;br /&gt;
&lt;br /&gt;
2. index:&lt;br /&gt;
&lt;br /&gt;
* Description: The index method retrieves a list of notifications based on specific filters, such as active status, unread status, or course association. This endpoint ensures that students only see notifications related to the courses they are enrolled in. It supports querying with multiple optional parameters for flexibility.&lt;br /&gt;
* API Endpoint: GET /notifications&lt;br /&gt;
* Parameters: Query parameters (optional):&lt;br /&gt;
** is_active: Filter notifications by their active status.&lt;br /&gt;
** is_unread: Retrieve only unread notifications for the current user.&lt;br /&gt;
** course_id: Fetch notifications specific to a course.&lt;br /&gt;
* Authorization: Students can only access notifications for courses they are enrolled in. Instructors and TAs can view all notifications they have created.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns an array of filtered notifications with a 200 status.&lt;br /&gt;
** Error: Returns a 403 status if unauthorized.&lt;br /&gt;
&lt;br /&gt;
3. show:&lt;br /&gt;
&lt;br /&gt;
* Description: This method retrieves the details of a specific notification identified by its unique ID. It ensures that the current user is authorized to view the notification (e.g., enrolled in the course or the creator of the notification).&lt;br /&gt;
* API Endpoint: GET /notifications/:id&lt;br /&gt;
* Parameters:&lt;br /&gt;
** id: The unique identifier of the notification to be retrieved.&lt;br /&gt;
* Authorization: Students can view notifications for courses they are enrolled in. Instructors and TAs can view notifications they have created.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns the notification details with a 200 status.&lt;br /&gt;
** Error: Returns a 404 status if the notification is not found or the user is unauthorized.&lt;br /&gt;
&lt;br /&gt;
4. update:&lt;br /&gt;
&lt;br /&gt;
* Description: This method allows the creator of a notification (TA or instructor) to update its details. It validates the incoming data and ensures that the user is authorized to make changes.&lt;br /&gt;
* API Endpoint: PUT /notifications/:id&lt;br /&gt;
* Parameters: Fields that can be updated include subject, description, expiration_date, and is_active.&lt;br /&gt;
* Authorization: Only the creator of the notification can update it.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns the updated notification with a 200 status.&lt;br /&gt;
** Error: Returns a 403 status if the user does not have the required permissions.&lt;br /&gt;
&lt;br /&gt;
5. destroy:&lt;br /&gt;
&lt;br /&gt;
* Description: This method deletes a specific notification. Only the user who created the notification can perform this action. The method ensures that no unauthorized users can delete notifications.&lt;br /&gt;
* API Endpoint: DELETE /notifications/:id&lt;br /&gt;
* Parameters:&lt;br /&gt;
** id: The unique identifier of the notification to be deleted.&lt;br /&gt;
* Authorization: Only the creator of the notification can delete it.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns a 204 status with no content upon successful deletion.&lt;br /&gt;
** Error: Returns a 403 status if the user is unauthorized.&lt;br /&gt;
&lt;br /&gt;
6. toggle_notification_visibility:&lt;br /&gt;
&lt;br /&gt;
* Description: This method toggles the is_active status of a notification. For example, a TA or instructor can deactivate a notification that is no longer relevant. The method ensures that only the creator of the notification can perform this action.&lt;br /&gt;
* API Endpoint: PATCH /notifications/:id/toggle&lt;br /&gt;
* Parameters:&lt;br /&gt;
** id: The unique identifier of the notification to be toggled.&lt;br /&gt;
* Authorization: Only the creator of the notification can toggle its visibility.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns the updated notification status with a 200 status.&lt;br /&gt;
** Error: Returns a 403 status if unauthorized.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Model Implementation&amp;lt;/b&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
1. Notification model:&lt;br /&gt;
&lt;br /&gt;
* Description: The Notification model represents a single notification. It includes all attributes, validations, and associations necessary for managing notifications.&lt;br /&gt;
* Attributes:&lt;br /&gt;
** subject: The title of the notification (required, max length: 255).&lt;br /&gt;
** description: The detailed content of the notification.&lt;br /&gt;
** expiration_date: The date when the notification should expire (validated to be in the future).&lt;br /&gt;
** is_active: Indicates whether the notification is active (default: true).&lt;br /&gt;
** is_unread: Marks if a notification is unread (default: true).&lt;br /&gt;
** course_id: Links the notification to a course.&lt;br /&gt;
** user_id: Links the notification to its creator.&lt;br /&gt;
* Associations:&lt;br /&gt;
** belongs_to :course&lt;br /&gt;
** belongs_to :user&lt;br /&gt;
* Validations:&lt;br /&gt;
** Ensures the presence of subject, course_id, and user_id.&lt;br /&gt;
** Validates expiration_date to ensure it is not in the past.&lt;br /&gt;
* Scopes:&lt;br /&gt;
** active: Filters notifications that are active.&lt;br /&gt;
** unread: Filters unread notifications for a user.&lt;br /&gt;
&lt;br /&gt;
2. User Model:&lt;br /&gt;
&lt;br /&gt;
* Associations:&lt;br /&gt;
** has_many :notifications (creator role).&lt;br /&gt;
** has_many :viewable_notifications, through: :courses (student role).&lt;br /&gt;
&lt;br /&gt;
3. Course Model:&lt;br /&gt;
&lt;br /&gt;
* Associations:&lt;br /&gt;
** has_many :notifications.&lt;br /&gt;
** has_many :students, through: :enrollments.&lt;br /&gt;
&lt;br /&gt;
== New Files ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. Model for Notification (models/notification.rb) &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SoubarnicaSuresh/reimplementation-back-end/blob/main/app/models/notification.rb Commit]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
class Notification &amp;lt; ApplicationRecord&lt;br /&gt;
  # Associations&lt;br /&gt;
  belongs_to :course, foreign_key: :course_name, primary_key: :name&lt;br /&gt;
  belongs_to :user&lt;br /&gt;
  # Validations&lt;br /&gt;
  validates :subject, presence: true, length: { maximum: 255 }&lt;br /&gt;
  validates :description, presence: true&lt;br /&gt;
  validates :expiration_date, presence: true&lt;br /&gt;
  validate :expiration_date_cannot_be_in_the_past&lt;br /&gt;
  # Scopes&lt;br /&gt;
  scope :active, -&amp;gt; { where(active_flag: true) }&lt;br /&gt;
  scope :expired, -&amp;gt; { where('expiration_date &amp;lt; ?', Date.today) }&lt;br /&gt;
  scope :unread_by, -&amp;gt;(user) {&lt;br /&gt;
    joins(:course).where(courses: { id: user.assignments.pluck(:course_id) }).where(active_flag: true)&lt;br /&gt;
  }&lt;br /&gt;
  # Custom Validation for Expiration Date&lt;br /&gt;
  def expiration_date_cannot_be_in_the_past&lt;br /&gt;
    if expiration_date.present? &amp;amp;&amp;amp; expiration_date &amp;lt; Date.today&lt;br /&gt;
      errors.add(:expiration_date, &amp;quot;cannot be in the past&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; 2. Controller for Notification (controllers/notification_controller.rb) &amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SoubarnicaSuresh/reimplementation-back-end/blob/main/app/controllers/api/v1/notifications_controller.rb Commit]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;class Api::V1::NotificationsController &amp;lt; ApplicationController&lt;br /&gt;
  include AuthorizationHelper&lt;br /&gt;
  before_action :set_notification, only: %i[show update destroy]&lt;br /&gt;
  # GET /notifications&lt;br /&gt;
  def index&lt;br /&gt;
    if current_user_has_instructor_privileges? || current_user_has_ta_privileges?&lt;br /&gt;
      @notifications = Notification.where(user_id: current_user.id)&lt;br /&gt;
    elsif current_user_has_student_privileges?&lt;br /&gt;
      course_names = current_user.courses.pluck(:name)&lt;br /&gt;
      @notifications = Notification.where(course_name: course_names, active_flag: true)&lt;br /&gt;
    else&lt;br /&gt;
      render json: { error: 'Access denied' }, status: :forbidden&lt;br /&gt;
      return&lt;br /&gt;
    end&lt;br /&gt;
    render json: @notifications&lt;br /&gt;
  end&lt;br /&gt;
  # GET /notifications/:id&lt;br /&gt;
  def show&lt;br /&gt;
    if notification_accessible?(@notification)&lt;br /&gt;
      render json: @notification&lt;br /&gt;
    else&lt;br /&gt;
      render json: { error: 'You do not have access to this notification.' }, status: :forbidden&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # POST /notifications&lt;br /&gt;
  def create&lt;br /&gt;
    # Check if the current user has sufficient privileges&lt;br /&gt;
    unless current_user_has_instructor_privileges? || current_user_has_ta_privileges?&lt;br /&gt;
      render json: { error: 'You are not authorized to create notifications.' }, status: :forbidden&lt;br /&gt;
      return&lt;br /&gt;
    end &lt;br /&gt;
    @notification = Notification.new(notification_params)&lt;br /&gt;
    @notification.user_id = current_user.id&lt;br /&gt;
  &lt;br /&gt;
    if @notification.save&lt;br /&gt;
      render json: @notification, status: :created&lt;br /&gt;
    else&lt;br /&gt;
      render json: @notification.errors, status: :unprocessable_entity&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PATCH/PUT /notifications/:id&lt;br /&gt;
  def update&lt;br /&gt;
    # Check if the current user has sufficient privileges&lt;br /&gt;
    unless current_user_has_instructor_privileges? || current_user_has_ta_privileges?&lt;br /&gt;
      render json: { error: 'You are not authorized to update notifications.' }, status: :forbidden&lt;br /&gt;
      return&lt;br /&gt;
    end&lt;br /&gt;
    if @notification.update(notification_params)&lt;br /&gt;
      render json: @notification, status: :ok&lt;br /&gt;
    else&lt;br /&gt;
      render json: @notification.errors, status: :unprocessable_entity&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # DELETE /notifications/:id&lt;br /&gt;
  def destroy&lt;br /&gt;
    # Check if the current user has sufficient privileges&lt;br /&gt;
    unless current_user_has_instructor_privileges? || current_user_has_ta_privileges?&lt;br /&gt;
      render json: { error: 'You are not authorized to delete notifications.' }, status: :forbidden&lt;br /&gt;
      return&lt;br /&gt;
    end&lt;br /&gt;
    if @notification.destroy&lt;br /&gt;
      render json: { message: 'Notification deleted successfully.' }, status: :ok&lt;br /&gt;
    else&lt;br /&gt;
      render json: { error: 'Failed to delete the notification.' }, status: :unprocessable_entity&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  # PATCH /notifications/:id/toggle_active&lt;br /&gt;
  def toggle_notification_visibility&lt;br /&gt;
    if notification_accessible?(@notification)&lt;br /&gt;
      @notification.update(active_flag: !@notification.active_flag)&lt;br /&gt;
      render json: { message: 'Notification visibility toggled successfully.', notification: @notification }, status: :ok&lt;br /&gt;
    else&lt;br /&gt;
      render json: { error: 'You are not authorized to toggle this notification.' }, status: :forbidden&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  private&lt;br /&gt;
  # Use callbacks to share common setup or constraints between actions.&lt;br /&gt;
  def set_notification&lt;br /&gt;
    @notification = Notification.find(params[:id])&lt;br /&gt;
  rescue ActiveRecord::RecordNotFound&lt;br /&gt;
    render json: { error: 'Notification not found.' }, status: :not_found&lt;br /&gt;
  end&lt;br /&gt;
  # Define strong parameters for notification creation/update&lt;br /&gt;
  def notification_params&lt;br /&gt;
    params.require(:notification).permit(:course_name, :subject, :description, :expiration_date, :active_flag)&lt;br /&gt;
  end&lt;br /&gt;
  # Helper method to check if a notification is accessible to the current user&lt;br /&gt;
  def notification_accessible?(notification)&lt;br /&gt;
    # Instructors and TAs can access their own notifications&lt;br /&gt;
    return true if notification.user_id == current_user.id&lt;br /&gt;
    # Students can access notifications for their courses&lt;br /&gt;
    return true if current_user_has_student_privileges? &amp;amp;&amp;amp;&lt;br /&gt;
                   current_user.courses.exists?(name: notification.course_name)&lt;br /&gt;
    false&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Endpoints for Notification Management ==&lt;br /&gt;
&lt;br /&gt;
Endpoints for Creating, Reading, Updating, and Deleting (CRUD) Notifications&lt;br /&gt;
&lt;br /&gt;
1. POST /notifications - Create a new notification. The create method in the NotificationController implementation aligns with this endpoint, allowing authorized users to create notifications for specific courses.&lt;br /&gt;
&lt;br /&gt;
2. GET /notifications - Get a list of notifications (with optional filters, such as is_active or is_unread). The index method aligns with this endpoint, allowing filtered retrieval of notifications.&lt;br /&gt;
&lt;br /&gt;
3. GET /notifications/:id - View details of a specific notification. The show method aligns with this endpoint, retrieving specific notification details.&lt;br /&gt;
&lt;br /&gt;
4. PUT /notifications/:id - Update a specific notification. The update method allows modification of existing notifications, respecting role-based access.&lt;br /&gt;
&lt;br /&gt;
5. DELETE /notifications/:id - Delete a specific notification. The destroy method aligns with this endpoint, enabling notification deletion by authorized users.&lt;br /&gt;
&lt;br /&gt;
6. PATCH /notifications/:id/toggle - Toggle active state of a notification. The toggle_notification_visibility method handles this functionality, toggling the is_active flag.&lt;br /&gt;
&lt;br /&gt;
=Design Patterns and SOLID principles uses=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. Strategy Pattern&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use Case:&lt;br /&gt;
** Dynamically applying different filtering criteria for notifications (e.g., active notifications, unread notifications, notifications for a specific course).&lt;br /&gt;
** This modularizes the filtering logic, making it easier to extend or change in the future.&lt;br /&gt;
* Explanation:&lt;br /&gt;
** The Strategy Pattern separates filtering logic into individual strategy classes, making it easy to add new filters without modifying existing code.&lt;br /&gt;
** It also enhances the maintainability and testability of the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. Decorator Pattern&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use Case:&lt;br /&gt;
** Dynamically modifying the presentation of notifications based on user roles or other conditions.&lt;br /&gt;
** For example, students might see a simplified view of notifications, while instructors see a detailed view.&lt;br /&gt;
* Explanation:&lt;br /&gt;
** The Decorator Pattern adds additional functionality (like role-based formatting) without modifying the original Notification model.&lt;br /&gt;
** It keeps the model clean and focused on core functionality.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Following are the some of the SOLID principles with how they will be applied to the back-end development:&amp;lt;/b&amp;gt;&lt;br /&gt;
* Single Responsibility : Controllers handle HTTP requests, models handle data, and service objects handle business logic (e.g., sending notifications).&lt;br /&gt;
* Open/Closed : Extend functionality (e.g., new notification types or filters) by adding new classes or methods without modifying existing code.&lt;br /&gt;
* Interface Segregation : Create small, role-specific interfaces (e.g., policies for TAs, students, instructors) and separate service objects for different types of notifications.&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
This section outlines the comprehensive testing approach for the Notifications feature to ensure it meets functional and non-functional requirements. The strategy includes detailed test cases for models, controllers, role-based access, and error handling, leveraging RSpec for testing and RSwag for API documentation.&lt;br /&gt;
&lt;br /&gt;
'''1. Unit Testing'''&lt;br /&gt;
&lt;br /&gt;
Goal: Ensure that the Notification model functions as expected by validating its attributes, associations, and methods.&lt;br /&gt;
&lt;br /&gt;
[https://github.com/SoubarnicaSuresh/reimplementation-back-end/blob/main/spec/models/notification_spec.rb File as on GitHub]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;Key Test Cases:&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* Validations:&lt;br /&gt;
** Presence validation for subject, description, expiration_date, course_id, and user_id.&lt;br /&gt;
** Length constraints on subject and description.&lt;br /&gt;
** Format validation for expiration_date.&lt;br /&gt;
&lt;br /&gt;
* Associations:&lt;br /&gt;
** belongs_to :user and belongs_to :course associations are correctly established.&lt;br /&gt;
** Notifications have appropriate relationships with Course and User models.&lt;br /&gt;
&lt;br /&gt;
* Custom Methods and Scopes:&lt;br /&gt;
** active_notifications: Ensure only active notifications are returned.&lt;br /&gt;
** unread_notifications: Validate that unread notifications are fetched correctly.&lt;br /&gt;
&lt;br /&gt;
* Edge Cases:&lt;br /&gt;
** Notifications with an expired expiration_date should not appear in the active notifications list.&lt;br /&gt;
** Handling invalid foreign keys for user_id and course_id.&lt;br /&gt;
&lt;br /&gt;
  require 'rails_helper'&lt;br /&gt;
  RSpec.describe Notification, type: :model do&lt;br /&gt;
  describe 'validations' do&lt;br /&gt;
    it { should validate_presence_of(:subject) }&lt;br /&gt;
    it { should validate_presence_of(:description) }&lt;br /&gt;
    it { should validate_presence_of(:expiration_date) }&lt;br /&gt;
    it { should validate_length_of(:subject).is_at_most(100) }&lt;br /&gt;
  end&lt;br /&gt;
  describe 'associations' do&lt;br /&gt;
    it { should belong_to(:user) }&lt;br /&gt;
    it { should belong_to(:course) }&lt;br /&gt;
  end&lt;br /&gt;
  describe 'scopes' do&lt;br /&gt;
    let!(:active_notification) { create(:notification, is_active: true) }&lt;br /&gt;
    let!(:expired_notification) { create(:notification, expiration_date: Date.yesterday) }&lt;br /&gt;
    it 'returns active notifications' do&lt;br /&gt;
      expect(Notification.active_notifications).to include(active_notification)&lt;br /&gt;
      expect(Notification.active_notifications).not_to include(expired_notification)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Controller Testing'''&lt;br /&gt;
&lt;br /&gt;
Goal: Test all CRUD operations for the Notifications controller to ensure endpoints function as expected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;Key Test Cases:&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Index Action:&lt;br /&gt;
** Ensure all notifications for a given user are returned.&lt;br /&gt;
** Verify that unauthorized users cannot access the endpoint.&lt;br /&gt;
** Test paginated responses if applicable.&lt;br /&gt;
* Show Action:&lt;br /&gt;
** Ensure notifications can be retrieved by id.&lt;br /&gt;
** Handle cases where id is invalid or unauthorized.&lt;br /&gt;
* Create Action:&lt;br /&gt;
** Validate successful creation of notifications with proper attributes.&lt;br /&gt;
** Handle validation failures and unauthorized access.&lt;br /&gt;
* Update Action:&lt;br /&gt;
** Test updates to notification attributes.&lt;br /&gt;
** Ensure unauthorized users cannot perform updates.&lt;br /&gt;
* Delete Action:&lt;br /&gt;
** Verify notifications are deleted successfully.&lt;br /&gt;
** Test behavior when id is invalid or unauthorized.&lt;br /&gt;
&lt;br /&gt;
 require 'rails_helper'&lt;br /&gt;
 RSpec.describe Api::V1::NotificationsController, type: :controller do&lt;br /&gt;
  let(:admin) { create(:user, role: 'Admin') }&lt;br /&gt;
  let(:student) { create(:user, role: 'Student') }&lt;br /&gt;
  let(:notification) { create(:notification) }&lt;br /&gt;
  describe 'GET #index' do&lt;br /&gt;
    before { sign_in admin }&lt;br /&gt;
    it 'returns notifications for the current user' do&lt;br /&gt;
      get :index&lt;br /&gt;
      expect(response).to have_http_status(:ok)&lt;br /&gt;
      expect(json_response).to include(notification)&lt;br /&gt;
    end&lt;br /&gt;
    it 'denies access to unauthorized users' do&lt;br /&gt;
      sign_out admin&lt;br /&gt;
      sign_in student&lt;br /&gt;
      get :index&lt;br /&gt;
      expect(response).to have_http_status(:forbidden)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  describe 'POST #create' do&lt;br /&gt;
    context 'with valid attributes' do&lt;br /&gt;
      it 'creates a new notification' do&lt;br /&gt;
        expect {&lt;br /&gt;
          post :create, params: { notification: attributes_for(:notification) }&lt;br /&gt;
        }.to change(Notification, :count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'with invalid attributes' do&lt;br /&gt;
      it 'returns validation errors' do&lt;br /&gt;
        post :create, params: { notification: { subject: '' } }&lt;br /&gt;
        expect(response).to have_http_status(:unprocessable_entity)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
'''3. Integration Testing'''&lt;br /&gt;
&lt;br /&gt;
Goal: Ensure seamless interaction between models, controllers, and role-based access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;Key Test Cases:&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Role-Based Access:&lt;br /&gt;
** Verify only authorized roles (e.g., Admin, Instructor) can manage notifications.&lt;br /&gt;
** Ensure students can only view notifications for their enrolled courses.&lt;br /&gt;
* Full CRUD Workflow:&lt;br /&gt;
** Test end-to-end creation, updating, and deletion of notifications.&lt;br /&gt;
* Error Scenarios:&lt;br /&gt;
** Handle cases where a notification is created for a non-existent course or user.&lt;br /&gt;
** Verify appropriate error messages for unauthorized actions.&lt;br /&gt;
&lt;br /&gt;
 RSpec.describe 'Notifications Integration', type: :request do&lt;br /&gt;
  let(:admin) { create(:user, role: 'Admin') }&lt;br /&gt;
  let(:student) { create(:user, role: 'Student') }&lt;br /&gt;
  let!(:notification) { create(:notification, user: admin) }&lt;br /&gt;
  it 'allows admins to create notifications' do&lt;br /&gt;
    sign_in admin&lt;br /&gt;
    post '/api/v1/notifications', params: { notification: attributes_for(:notification) }&lt;br /&gt;
    expect(response).to have_http_status(:created)&lt;br /&gt;
  end&lt;br /&gt;
  it 'prevents students from creating notifications' do&lt;br /&gt;
    sign_in student&lt;br /&gt;
    post '/api/v1/notifications', params: { notification: attributes_for(:notification) }&lt;br /&gt;
    expect(response).to have_http_status(:forbidden)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
'''4. API Documentation and Testing with RSwag'''&lt;br /&gt;
&lt;br /&gt;
Goal: Generate API documentation and test all endpoints.&lt;br /&gt;
&lt;br /&gt;
 RSpec.describe 'Notifications API', type: :request do&lt;br /&gt;
  path '/api/v1/notifications' do&lt;br /&gt;
    get 'Retrieve notifications' do&lt;br /&gt;
      tags 'Notifications'&lt;br /&gt;
      produces 'application/json'&lt;br /&gt;
      response '200', 'success' do&lt;br /&gt;
        schema type: :array, items: { type: :object, properties: { id: { type: :integer }, subject: { type: :string } } }&lt;br /&gt;
        run_test!&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    post 'Create a notification' do&lt;br /&gt;
      tags 'Notifications'&lt;br /&gt;
      consumes 'application/json'&lt;br /&gt;
      parameter name: :notification, in: :body, schema: {&lt;br /&gt;
        type: :object,&lt;br /&gt;
        properties: {&lt;br /&gt;
          subject: { type: :string },&lt;br /&gt;
          description: { type: :string },&lt;br /&gt;
          expiration_date: { type: :string, format: 'date' },&lt;br /&gt;
          is_active: { type: :boolean }&lt;br /&gt;
        },&lt;br /&gt;
        required: %w[subject description expiration_date]&lt;br /&gt;
      }&lt;br /&gt;
      response '201', 'created' do&lt;br /&gt;
        let(:notification) { { subject: 'Test', description: 'Test notification', expiration_date: '2024-12-31', is_active: true } }&lt;br /&gt;
        run_test!&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' [https://github.com/SoubarnicaSuresh/reimplementation-back-end reimplementation back-end]&lt;br /&gt;
* '''Demo Video Link''' []&lt;br /&gt;
* '''Pull Request Link''' [https://github.com/expertiza/reimplementation-back-end/pull/142]&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=159689</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=159689"/>
		<updated>2024-11-18T03:41:59Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: /* Testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Details about the Notification Model and Controller==&lt;br /&gt;
&lt;br /&gt;
The Notification model in Expertiza serves a critical role in enhancing communication and user engagement on the platform. It is essential because it automates the process of alerting users to significant events, such as receiving feedback, team changes, or assignment updates, without requiring users to actively seek out this information. By streamlining these updates, the model reduces the risk of missed information, helping users stay on top of their responsibilities, collaborate more effectively, and respond in a timely manner. This function is particularly valuable in a platform like Expertiza, where users juggle multiple assignments, peer reviews, and team interactions, and would otherwise need to manually monitor changes and updates or rely on external tools for reminders.&lt;br /&gt;
&lt;br /&gt;
The Notification model also improves the overall user experience by organizing and presenting notifications in a way that makes them easy to access and track. It stores notification details (like type, content, and timestamp) and associates them with specific users, ensuring each user receives personalized, relevant updates. Users can view notifications sorted by date or filtered by read/unread status, making it easier to prioritize tasks and responses. Ultimately, the Notification model supports Expertiza’s usability by helping users stay informed and accountable, contributing to an environment that encourages active participation and smooth collaboration across assignments.&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
The objective was to create a Notification model in the backend to handle notifications for the Expertiza system. &lt;br /&gt;
&lt;br /&gt;
This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. &lt;br /&gt;
Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
The main objective is to create the Notification controller and model to handle sending and receiving notifications on the Expertiza platform.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic: Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
&amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
1. Model Creation:&lt;br /&gt;
&lt;br /&gt;
Create a Notification model with the following key attributes:&lt;br /&gt;
* id: Primary key (auto-generated).&lt;br /&gt;
* subject: Brief title of the notification.&lt;br /&gt;
* description: Detailed message of the notification.&lt;br /&gt;
* expiration_date: The date when the notification should expire.&lt;br /&gt;
* is_active: Boolean flag to mark if the notification is active or inactive.&lt;br /&gt;
* is_unread: Boolean to mark if a notification is unread (default to true for new notifications).&lt;br /&gt;
&lt;br /&gt;
2. Associations:&lt;br /&gt;
&lt;br /&gt;
* Define associations between Notification, User, and Course models.&lt;br /&gt;
* User Association: Each notification should have a creator (e.g., a teaching assistant or instructor).&lt;br /&gt;
* Course Association: Each notification should be linked to a course, and the enrolled students should be able to view relevant notifications.&lt;br /&gt;
&lt;br /&gt;
3. Relationships:&lt;br /&gt;
&lt;br /&gt;
* One-to-Many: Course to Notification, as each course can have multiple notifications.&lt;br /&gt;
* One-to-Many: User (creator) to Notification, as a user can create multiple notifications.&lt;br /&gt;
* Many-to-Many (indirect): User to Notification via course enrollment, as multiple students can view a notification if they are enrolled in the course associated with the notification.&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
[[File:Schema2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
===Associations===&lt;br /&gt;
&lt;br /&gt;
'''Notification'''&lt;br /&gt;
&lt;br /&gt;
* belongs_to :user - Links the notification to its creator (TA, instructor).&lt;br /&gt;
&lt;br /&gt;
* belongs_to :course - Links the notification to a course.&lt;br /&gt;
&lt;br /&gt;
'''User'''&lt;br /&gt;
&lt;br /&gt;
* has_many :notifications - Users (instructors, TAs) can create multiple notifications.&lt;br /&gt;
&lt;br /&gt;
* has_many :viewable_notifications, through: :courses - Students can view notifications for courses they are enrolled in.&lt;br /&gt;
&lt;br /&gt;
'''Course'''&lt;br /&gt;
&lt;br /&gt;
* has_many :notifications - Each course can have multiple notifications.&lt;br /&gt;
&lt;br /&gt;
* has_many :students, through: :enrollments - Defines which students are associated with the course.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[File:UML notification2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
''' Relationship Explanation''' &lt;br /&gt;
&lt;br /&gt;
* User to Notification: A User (e.g., TA, instructor) can create multiple notifications.&lt;br /&gt;
* Course to Notification: Each Course can have multiple notifications associated with it.&lt;br /&gt;
* User (Student) to Notification (Viewer): Through Course enrollment, students can access notifications related to their courses.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&amp;lt;b&amp;gt;NotificationController Implementation&amp;lt;/b&amp;gt;: Following are the controller methods:&lt;br /&gt;
&lt;br /&gt;
1. create:&lt;br /&gt;
&lt;br /&gt;
* Description: This method is responsible for creating a new notification. It validates the incoming data to ensure that all required fields are present and correctly formatted. Only authorized users (instructors or TAs) can create notifications. Upon successful creation, the method associates the notification with the specified course and user (creator).&lt;br /&gt;
* API Endpoint: POST /notifications&lt;br /&gt;
* Parameters:&lt;br /&gt;
** subject (required): The title of the notification that briefly describes its purpose (limited to 255 characters).&lt;br /&gt;
** description (optional): Detailed content of the notification.&lt;br /&gt;
** expiration_date (optional): The date until which the notification remains valid. Defaults to no expiration.&lt;br /&gt;
** is_active (optional): A boolean flag indicating if the notification is active (default is true).&lt;br /&gt;
** course_id (required): The course associated with the notification.&lt;br /&gt;
* Authorization: Ensures that only users with roles of TA or instructor can create a notification.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns the newly created notification with a 201 status.&lt;br /&gt;
** Error: Returns validation errors (e.g., missing fields, invalid data) with a 422 status.&lt;br /&gt;
&lt;br /&gt;
2. index:&lt;br /&gt;
&lt;br /&gt;
* Description: The index method retrieves a list of notifications based on specific filters, such as active status, unread status, or course association. This endpoint ensures that students only see notifications related to the courses they are enrolled in. It supports querying with multiple optional parameters for flexibility.&lt;br /&gt;
* API Endpoint: GET /notifications&lt;br /&gt;
* Parameters: Query parameters (optional):&lt;br /&gt;
** is_active: Filter notifications by their active status.&lt;br /&gt;
** is_unread: Retrieve only unread notifications for the current user.&lt;br /&gt;
** course_id: Fetch notifications specific to a course.&lt;br /&gt;
* Authorization: Students can only access notifications for courses they are enrolled in. Instructors and TAs can view all notifications they have created.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns an array of filtered notifications with a 200 status.&lt;br /&gt;
** Error: Returns a 403 status if unauthorized.&lt;br /&gt;
&lt;br /&gt;
3. show:&lt;br /&gt;
&lt;br /&gt;
* Description: This method retrieves the details of a specific notification identified by its unique ID. It ensures that the current user is authorized to view the notification (e.g., enrolled in the course or the creator of the notification).&lt;br /&gt;
* API Endpoint: GET /notifications/:id&lt;br /&gt;
* Parameters:&lt;br /&gt;
** id: The unique identifier of the notification to be retrieved.&lt;br /&gt;
* Authorization: Students can view notifications for courses they are enrolled in. Instructors and TAs can view notifications they have created.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns the notification details with a 200 status.&lt;br /&gt;
** Error: Returns a 404 status if the notification is not found or the user is unauthorized.&lt;br /&gt;
&lt;br /&gt;
4. update:&lt;br /&gt;
&lt;br /&gt;
* Description: This method allows the creator of a notification (TA or instructor) to update its details. It validates the incoming data and ensures that the user is authorized to make changes.&lt;br /&gt;
* API Endpoint: PUT /notifications/:id&lt;br /&gt;
* Parameters: Fields that can be updated include subject, description, expiration_date, and is_active.&lt;br /&gt;
* Authorization: Only the creator of the notification can update it.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns the updated notification with a 200 status.&lt;br /&gt;
** Error: Returns a 403 status if the user does not have the required permissions.&lt;br /&gt;
&lt;br /&gt;
5. destroy:&lt;br /&gt;
&lt;br /&gt;
* Description: This method deletes a specific notification. Only the user who created the notification can perform this action. The method ensures that no unauthorized users can delete notifications.&lt;br /&gt;
* API Endpoint: DELETE /notifications/:id&lt;br /&gt;
* Parameters:&lt;br /&gt;
** id: The unique identifier of the notification to be deleted.&lt;br /&gt;
* Authorization: Only the creator of the notification can delete it.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns a 204 status with no content upon successful deletion.&lt;br /&gt;
** Error: Returns a 403 status if the user is unauthorized.&lt;br /&gt;
&lt;br /&gt;
6. toggle_notification_visibility:&lt;br /&gt;
&lt;br /&gt;
* Description: This method toggles the is_active status of a notification. For example, a TA or instructor can deactivate a notification that is no longer relevant. The method ensures that only the creator of the notification can perform this action.&lt;br /&gt;
* API Endpoint: PATCH /notifications/:id/toggle&lt;br /&gt;
* Parameters:&lt;br /&gt;
** id: The unique identifier of the notification to be toggled.&lt;br /&gt;
* Authorization: Only the creator of the notification can toggle its visibility.&lt;br /&gt;
* Response:&lt;br /&gt;
** Success: Returns the updated notification status with a 200 status.&lt;br /&gt;
** Error: Returns a 403 status if unauthorized.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Model Implementation&amp;lt;/b&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
1. Notification model:&lt;br /&gt;
&lt;br /&gt;
* Description: The Notification model represents a single notification. It includes all attributes, validations, and associations necessary for managing notifications.&lt;br /&gt;
* Attributes:&lt;br /&gt;
** subject: The title of the notification (required, max length: 255).&lt;br /&gt;
** description: The detailed content of the notification.&lt;br /&gt;
** expiration_date: The date when the notification should expire (validated to be in the future).&lt;br /&gt;
** is_active: Indicates whether the notification is active (default: true).&lt;br /&gt;
** is_unread: Marks if a notification is unread (default: true).&lt;br /&gt;
** course_id: Links the notification to a course.&lt;br /&gt;
** user_id: Links the notification to its creator.&lt;br /&gt;
* Associations:&lt;br /&gt;
** belongs_to :course&lt;br /&gt;
** belongs_to :user&lt;br /&gt;
* Validations:&lt;br /&gt;
** Ensures the presence of subject, course_id, and user_id.&lt;br /&gt;
** Validates expiration_date to ensure it is not in the past.&lt;br /&gt;
* Scopes:&lt;br /&gt;
** active: Filters notifications that are active.&lt;br /&gt;
** unread: Filters unread notifications for a user.&lt;br /&gt;
&lt;br /&gt;
2. User Model:&lt;br /&gt;
&lt;br /&gt;
* Associations:&lt;br /&gt;
** has_many :notifications (creator role).&lt;br /&gt;
** has_many :viewable_notifications, through: :courses (student role).&lt;br /&gt;
&lt;br /&gt;
3. Course Model:&lt;br /&gt;
&lt;br /&gt;
* Associations:&lt;br /&gt;
** has_many :notifications.&lt;br /&gt;
** has_many :students, through: :enrollments.&lt;br /&gt;
&lt;br /&gt;
== Endpoints for Notification Management ==&lt;br /&gt;
&lt;br /&gt;
Endpoints for Creating, Reading, Updating, and Deleting (CRUD) Notifications&lt;br /&gt;
&lt;br /&gt;
1. POST /notifications - Create a new notification. The create method in the NotificationController implementation aligns with this endpoint, allowing authorized users to create notifications for specific courses.&lt;br /&gt;
&lt;br /&gt;
2. GET /notifications - Get a list of notifications (with optional filters, such as is_active or is_unread). The index method aligns with this endpoint, allowing filtered retrieval of notifications.&lt;br /&gt;
&lt;br /&gt;
3. GET /notifications/:id - View details of a specific notification. The show method aligns with this endpoint, retrieving specific notification details.&lt;br /&gt;
&lt;br /&gt;
4. PUT /notifications/:id - Update a specific notification. The update method allows modification of existing notifications, respecting role-based access.&lt;br /&gt;
&lt;br /&gt;
5. DELETE /notifications/:id - Delete a specific notification. The destroy method aligns with this endpoint, enabling notification deletion by authorized users.&lt;br /&gt;
&lt;br /&gt;
6. PATCH /notifications/:id/toggle - Toggle active state of a notification. The toggle_notification_visibility method handles this functionality, toggling the is_active flag.&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. Strategy Pattern&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use Case:&lt;br /&gt;
** Dynamically applying different filtering criteria for notifications (e.g., active notifications, unread notifications, notifications for a specific course).&lt;br /&gt;
** This modularizes the filtering logic, making it easier to extend or change in the future.&lt;br /&gt;
* Explanation:&lt;br /&gt;
** The Strategy Pattern separates filtering logic into individual strategy classes, making it easy to add new filters without modifying existing code.&lt;br /&gt;
** It also enhances the maintainability and testability of the system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;2. Decorator Pattern&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use Case:&lt;br /&gt;
** Dynamically modifying the presentation of notifications based on user roles or other conditions.&lt;br /&gt;
** For example, students might see a simplified view of notifications, while instructors see a detailed view.&lt;br /&gt;
* Explanation:&lt;br /&gt;
** The Decorator Pattern adds additional functionality (like role-based formatting) without modifying the original Notification model.&lt;br /&gt;
** It keeps the model clean and focused on core functionality.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;3. Singleton Pattern&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use Case:&lt;br /&gt;
** Managing a global notification scheduler or manager, ensuring that only one instance exists.&lt;br /&gt;
* Explanation:&lt;br /&gt;
** The Singleton Pattern ensures that there is only one centralized manager for handling notification-related tasks, such as scheduling or batch operations.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;4. Chain of Responsibility Pattern&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Use Case:&lt;br /&gt;
** Modularizing the validation logic for notifications (e.g., checking permissions, validating expiration dates, ensuring uniqueness).&lt;br /&gt;
* Explanation:&lt;br /&gt;
** The Chain of Responsibility Pattern allows you to break down validation or processing logic into discrete steps, improving code readability and maintainability.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Following are the some of the SOLID principles with how they will be applied to the back-end development:&amp;lt;/b&amp;gt;&lt;br /&gt;
* Single Responsibility : Controllers handle HTTP requests, models handle data, and service objects handle business logic (e.g., sending notifications).&lt;br /&gt;
* Open/Closed : Extend functionality (e.g., new notification types or filters) by adding new classes or methods without modifying existing code.&lt;br /&gt;
* Interface Segregation : Create small, role-specific interfaces (e.g., policies for TAs, students, instructors) and separate service objects for different types of notifications.&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
This section outlines the comprehensive testing approach for the Notifications feature to ensure it meets functional and non-functional requirements. The strategy includes detailed test cases for models, controllers, role-based access, and error handling, leveraging RSpec for testing and RSwag for API documentation.&lt;br /&gt;
&lt;br /&gt;
'''1. Unit Testing'''&lt;br /&gt;
&lt;br /&gt;
Goal: Ensure that the Notification model functions as expected by validating its attributes, associations, and methods.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;Key Test Cases:&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
* Validations:&lt;br /&gt;
** Presence validation for subject, description, expiration_date, course_id, and user_id.&lt;br /&gt;
** Length constraints on subject and description.&lt;br /&gt;
** Format validation for expiration_date.&lt;br /&gt;
&lt;br /&gt;
* Associations:&lt;br /&gt;
** belongs_to :user and belongs_to :course associations are correctly established.&lt;br /&gt;
** Notifications have appropriate relationships with Course and User models.&lt;br /&gt;
&lt;br /&gt;
* Custom Methods and Scopes:&lt;br /&gt;
** active_notifications: Ensure only active notifications are returned.&lt;br /&gt;
** unread_notifications: Validate that unread notifications are fetched correctly.&lt;br /&gt;
&lt;br /&gt;
* Edge Cases:&lt;br /&gt;
** Notifications with an expired expiration_date should not appear in the active notifications list.&lt;br /&gt;
** Handling invalid foreign keys for user_id and course_id.&lt;br /&gt;
&lt;br /&gt;
  require 'rails_helper'&lt;br /&gt;
  RSpec.describe Notification, type: :model do&lt;br /&gt;
  describe 'validations' do&lt;br /&gt;
    it { should validate_presence_of(:subject) }&lt;br /&gt;
    it { should validate_presence_of(:description) }&lt;br /&gt;
    it { should validate_presence_of(:expiration_date) }&lt;br /&gt;
    it { should validate_length_of(:subject).is_at_most(100) }&lt;br /&gt;
  end&lt;br /&gt;
  describe 'associations' do&lt;br /&gt;
    it { should belong_to(:user) }&lt;br /&gt;
    it { should belong_to(:course) }&lt;br /&gt;
  end&lt;br /&gt;
  describe 'scopes' do&lt;br /&gt;
    let!(:active_notification) { create(:notification, is_active: true) }&lt;br /&gt;
    let!(:expired_notification) { create(:notification, expiration_date: Date.yesterday) }&lt;br /&gt;
    it 'returns active notifications' do&lt;br /&gt;
      expect(Notification.active_notifications).to include(active_notification)&lt;br /&gt;
      expect(Notification.active_notifications).not_to include(expired_notification)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Controller Testing'''&lt;br /&gt;
&lt;br /&gt;
Goal: Test all CRUD operations for the Notifications controller to ensure endpoints function as expected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;Key Test Cases:&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Index Action:&lt;br /&gt;
** Ensure all notifications for a given user are returned.&lt;br /&gt;
** Verify that unauthorized users cannot access the endpoint.&lt;br /&gt;
** Test paginated responses if applicable.&lt;br /&gt;
* Show Action:&lt;br /&gt;
** Ensure notifications can be retrieved by id.&lt;br /&gt;
** Handle cases where id is invalid or unauthorized.&lt;br /&gt;
* Create Action:&lt;br /&gt;
** Validate successful creation of notifications with proper attributes.&lt;br /&gt;
** Handle validation failures and unauthorized access.&lt;br /&gt;
* Update Action:&lt;br /&gt;
** Test updates to notification attributes.&lt;br /&gt;
** Ensure unauthorized users cannot perform updates.&lt;br /&gt;
* Delete Action:&lt;br /&gt;
** Verify notifications are deleted successfully.&lt;br /&gt;
** Test behavior when id is invalid or unauthorized.&lt;br /&gt;
&lt;br /&gt;
 require 'rails_helper'&lt;br /&gt;
 RSpec.describe Api::V1::NotificationsController, type: :controller do&lt;br /&gt;
  let(:admin) { create(:user, role: 'Admin') }&lt;br /&gt;
  let(:student) { create(:user, role: 'Student') }&lt;br /&gt;
  let(:notification) { create(:notification) }&lt;br /&gt;
  describe 'GET #index' do&lt;br /&gt;
    before { sign_in admin }&lt;br /&gt;
    it 'returns notifications for the current user' do&lt;br /&gt;
      get :index&lt;br /&gt;
      expect(response).to have_http_status(:ok)&lt;br /&gt;
      expect(json_response).to include(notification)&lt;br /&gt;
    end&lt;br /&gt;
    it 'denies access to unauthorized users' do&lt;br /&gt;
      sign_out admin&lt;br /&gt;
      sign_in student&lt;br /&gt;
      get :index&lt;br /&gt;
      expect(response).to have_http_status(:forbidden)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
  describe 'POST #create' do&lt;br /&gt;
    context 'with valid attributes' do&lt;br /&gt;
      it 'creates a new notification' do&lt;br /&gt;
        expect {&lt;br /&gt;
          post :create, params: { notification: attributes_for(:notification) }&lt;br /&gt;
        }.to change(Notification, :count).by(1)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    context 'with invalid attributes' do&lt;br /&gt;
      it 'returns validation errors' do&lt;br /&gt;
        post :create, params: { notification: { subject: '' } }&lt;br /&gt;
        expect(response).to have_http_status(:unprocessable_entity)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
'''3. Integration Testing'''&lt;br /&gt;
&lt;br /&gt;
Goal: Ensure seamless interaction between models, controllers, and role-based access.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;&amp;lt;i&amp;gt;Key Test Cases:&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Role-Based Access:&lt;br /&gt;
** Verify only authorized roles (e.g., Admin, Instructor) can manage notifications.&lt;br /&gt;
** Ensure students can only view notifications for their enrolled courses.&lt;br /&gt;
* Full CRUD Workflow:&lt;br /&gt;
** Test end-to-end creation, updating, and deletion of notifications.&lt;br /&gt;
* Error Scenarios:&lt;br /&gt;
** Handle cases where a notification is created for a non-existent course or user.&lt;br /&gt;
** Verify appropriate error messages for unauthorized actions.&lt;br /&gt;
&lt;br /&gt;
 RSpec.describe 'Notifications Integration', type: :request do&lt;br /&gt;
  let(:admin) { create(:user, role: 'Admin') }&lt;br /&gt;
  let(:student) { create(:user, role: 'Student') }&lt;br /&gt;
  let!(:notification) { create(:notification, user: admin) }&lt;br /&gt;
  it 'allows admins to create notifications' do&lt;br /&gt;
    sign_in admin&lt;br /&gt;
    post '/api/v1/notifications', params: { notification: attributes_for(:notification) }&lt;br /&gt;
    expect(response).to have_http_status(:created)&lt;br /&gt;
  end&lt;br /&gt;
  it 'prevents students from creating notifications' do&lt;br /&gt;
    sign_in student&lt;br /&gt;
    post '/api/v1/notifications', params: { notification: attributes_for(:notification) }&lt;br /&gt;
    expect(response).to have_http_status(:forbidden)&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
'''4. API Documentation and Testing with RSwag'''&lt;br /&gt;
&lt;br /&gt;
Goal: Generate API documentation and test all endpoints.&lt;br /&gt;
&lt;br /&gt;
 RSpec.describe 'Notifications API', type: :request do&lt;br /&gt;
  path '/api/v1/notifications' do&lt;br /&gt;
    get 'Retrieve notifications' do&lt;br /&gt;
      tags 'Notifications'&lt;br /&gt;
      produces 'application/json'&lt;br /&gt;
      response '200', 'success' do&lt;br /&gt;
        schema type: :array, items: { type: :object, properties: { id: { type: :integer }, subject: { type: :string } } }&lt;br /&gt;
        run_test!&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    post 'Create a notification' do&lt;br /&gt;
      tags 'Notifications'&lt;br /&gt;
      consumes 'application/json'&lt;br /&gt;
      parameter name: :notification, in: :body, schema: {&lt;br /&gt;
        type: :object,&lt;br /&gt;
        properties: {&lt;br /&gt;
          subject: { type: :string },&lt;br /&gt;
          description: { type: :string },&lt;br /&gt;
          expiration_date: { type: :string, format: 'date' },&lt;br /&gt;
          is_active: { type: :boolean }&lt;br /&gt;
        },&lt;br /&gt;
        required: %w[subject description expiration_date]&lt;br /&gt;
      }&lt;br /&gt;
      response '201', 'created' do&lt;br /&gt;
        let(:notification) { { subject: 'Test', description: 'Test notification', expiration_date: '2024-12-31', is_active: true } }&lt;br /&gt;
        run_test!&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' [https://github.com/SoubarnicaSuresh/reimplementation-back-end reimplementation back-end]&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158886</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158886"/>
		<updated>2024-11-11T23:11:49Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: /* Schema */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
To create a Notification model in the backend to handle notifications for the Expertiza system. This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic: Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
&amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
1. Model Creation:&lt;br /&gt;
&lt;br /&gt;
Create a Notification model with the following key attributes:&lt;br /&gt;
* id: Primary key (auto-generated).&lt;br /&gt;
* subject: Brief title of the notification.&lt;br /&gt;
* description: Detailed message of the notification.&lt;br /&gt;
* expiration_date: The date when the notification should expire.&lt;br /&gt;
* is_active: Boolean flag to mark if the notification is active or inactive.&lt;br /&gt;
* is_unread: Boolean to mark if a notification is unread (default to true for new notifications).&lt;br /&gt;
&lt;br /&gt;
2. Associations:&lt;br /&gt;
&lt;br /&gt;
* Define associations between Notification, User, and Course models.&lt;br /&gt;
* User Association: Each notification should have a creator (e.g., a teaching assistant or instructor).&lt;br /&gt;
* Course Association: Each notification should be linked to a course, and the enrolled students should be able to view relevant notifications.&lt;br /&gt;
&lt;br /&gt;
3. Relationships:&lt;br /&gt;
&lt;br /&gt;
* One-to-Many: Course to Notification, as each course can have multiple notifications.&lt;br /&gt;
* One-to-Many: User (creator) to Notification, as a user can create multiple notifications.&lt;br /&gt;
* Many-to-Many (indirect): User to Notification via course enrollment, as multiple students can view a notification if they are enrolled in the course associated with the notification.&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
[[File:Schema2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
===Associations===&lt;br /&gt;
&lt;br /&gt;
'''Notification'''&lt;br /&gt;
&lt;br /&gt;
* belongs_to :user - Links the notification to its creator (TA, instructor).&lt;br /&gt;
&lt;br /&gt;
* belongs_to :course - Links the notification to a course.&lt;br /&gt;
&lt;br /&gt;
'''User'''&lt;br /&gt;
&lt;br /&gt;
* has_many :notifications - Users (instructors, TAs) can create multiple notifications.&lt;br /&gt;
&lt;br /&gt;
* has_many :viewable_notifications, through: :courses - Students can view notifications for courses they are enrolled in.&lt;br /&gt;
&lt;br /&gt;
'''Course'''&lt;br /&gt;
&lt;br /&gt;
* has_many :notifications - Each course can have multiple notifications.&lt;br /&gt;
&lt;br /&gt;
* has_many :students, through: :enrollments - Defines which students are associated with the course.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[File:UML notification2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
''' Relationship Explanation''' &lt;br /&gt;
&lt;br /&gt;
* User to Notification: A User (e.g., TA, instructor) can create multiple notifications.&lt;br /&gt;
* Course to Notification: Each Course can have multiple notifications associated with it.&lt;br /&gt;
* User (Student) to Notification (Viewer): Through Course enrollment, students can access notifications related to their courses.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
== ⁠issue, methods, problem, solution (rename later)==&lt;br /&gt;
&lt;br /&gt;
== Endpoints for Notification Management ==&lt;br /&gt;
&lt;br /&gt;
Endpoints for Creating, Reading, Updating, and Deleting (CRUD) Notifications&lt;br /&gt;
&lt;br /&gt;
1. POST /notifications - Create a new notification.&lt;br /&gt;
&lt;br /&gt;
2. GET /notifications - Get a list of notifications (with optional filters, such as is_active or is_unread).&lt;br /&gt;
&lt;br /&gt;
3. GET /notifications/ - View details of a specific notification.&lt;br /&gt;
&lt;br /&gt;
4. PUT /notifications/ - Update a specific notification.&lt;br /&gt;
&lt;br /&gt;
5. DELETE /notifications/ - Delete a specific notification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
1. Model Tests:&lt;br /&gt;
&lt;br /&gt;
* Validate presence and format of subject and description.&lt;br /&gt;
* Test is_active and is_unread default values.&lt;br /&gt;
&lt;br /&gt;
2. Controller Tests:&lt;br /&gt;
&lt;br /&gt;
* Ensure proper creation, update, and deletion of notifications.&lt;br /&gt;
* Test that only authorized users can manage notifications.&lt;br /&gt;
&lt;br /&gt;
3. Integration Tests:&lt;br /&gt;
&lt;br /&gt;
* Test access control to verify that only eligible users can view or manage notifications based on role and course association.&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:'''&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158885</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158885"/>
		<updated>2024-11-11T23:11:35Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
To create a Notification model in the backend to handle notifications for the Expertiza system. This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic: Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
&amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
1. Model Creation:&lt;br /&gt;
&lt;br /&gt;
Create a Notification model with the following key attributes:&lt;br /&gt;
* id: Primary key (auto-generated).&lt;br /&gt;
* subject: Brief title of the notification.&lt;br /&gt;
* description: Detailed message of the notification.&lt;br /&gt;
* expiration_date: The date when the notification should expire.&lt;br /&gt;
* is_active: Boolean flag to mark if the notification is active or inactive.&lt;br /&gt;
* is_unread: Boolean to mark if a notification is unread (default to true for new notifications).&lt;br /&gt;
&lt;br /&gt;
2. Associations:&lt;br /&gt;
&lt;br /&gt;
* Define associations between Notification, User, and Course models.&lt;br /&gt;
* User Association: Each notification should have a creator (e.g., a teaching assistant or instructor).&lt;br /&gt;
* Course Association: Each notification should be linked to a course, and the enrolled students should be able to view relevant notifications.&lt;br /&gt;
&lt;br /&gt;
3. Relationships:&lt;br /&gt;
&lt;br /&gt;
* One-to-Many: Course to Notification, as each course can have multiple notifications.&lt;br /&gt;
* One-to-Many: User (creator) to Notification, as a user can create multiple notifications.&lt;br /&gt;
* Many-to-Many (indirect): User to Notification via course enrollment, as multiple students can view a notification if they are enrolled in the course associated with the notification.&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
[[File:Schema2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Associations===&lt;br /&gt;
&lt;br /&gt;
'''Notification'''&lt;br /&gt;
&lt;br /&gt;
* belongs_to :user - Links the notification to its creator (TA, instructor).&lt;br /&gt;
&lt;br /&gt;
* belongs_to :course - Links the notification to a course.&lt;br /&gt;
&lt;br /&gt;
'''User'''&lt;br /&gt;
&lt;br /&gt;
* has_many :notifications - Users (instructors, TAs) can create multiple notifications.&lt;br /&gt;
&lt;br /&gt;
* has_many :viewable_notifications, through: :courses - Students can view notifications for courses they are enrolled in.&lt;br /&gt;
&lt;br /&gt;
'''Course'''&lt;br /&gt;
&lt;br /&gt;
* has_many :notifications - Each course can have multiple notifications.&lt;br /&gt;
&lt;br /&gt;
* has_many :students, through: :enrollments - Defines which students are associated with the course.&lt;br /&gt;
&lt;br /&gt;
==UML Diagram==&lt;br /&gt;
[[File:UML notification2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
''' Relationship Explanation''' &lt;br /&gt;
&lt;br /&gt;
* User to Notification: A User (e.g., TA, instructor) can create multiple notifications.&lt;br /&gt;
* Course to Notification: Each Course can have multiple notifications associated with it.&lt;br /&gt;
* User (Student) to Notification (Viewer): Through Course enrollment, students can access notifications related to their courses.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
== ⁠issue, methods, problem, solution (rename later)==&lt;br /&gt;
&lt;br /&gt;
== Endpoints for Notification Management ==&lt;br /&gt;
&lt;br /&gt;
Endpoints for Creating, Reading, Updating, and Deleting (CRUD) Notifications&lt;br /&gt;
&lt;br /&gt;
1. POST /notifications - Create a new notification.&lt;br /&gt;
&lt;br /&gt;
2. GET /notifications - Get a list of notifications (with optional filters, such as is_active or is_unread).&lt;br /&gt;
&lt;br /&gt;
3. GET /notifications/ - View details of a specific notification.&lt;br /&gt;
&lt;br /&gt;
4. PUT /notifications/ - Update a specific notification.&lt;br /&gt;
&lt;br /&gt;
5. DELETE /notifications/ - Delete a specific notification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
1. Model Tests:&lt;br /&gt;
&lt;br /&gt;
* Validate presence and format of subject and description.&lt;br /&gt;
* Test is_active and is_unread default values.&lt;br /&gt;
&lt;br /&gt;
2. Controller Tests:&lt;br /&gt;
&lt;br /&gt;
* Ensure proper creation, update, and deletion of notifications.&lt;br /&gt;
* Test that only authorized users can manage notifications.&lt;br /&gt;
&lt;br /&gt;
3. Integration Tests:&lt;br /&gt;
&lt;br /&gt;
* Test access control to verify that only eligible users can view or manage notifications based on role and course association.&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:'''&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158884</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158884"/>
		<updated>2024-11-11T23:11:05Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: /* Associations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
To create a Notification model in the backend to handle notifications for the Expertiza system. This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic: Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
&amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
1. Model Creation:&lt;br /&gt;
&lt;br /&gt;
Create a Notification model with the following key attributes:&lt;br /&gt;
* id: Primary key (auto-generated).&lt;br /&gt;
* subject: Brief title of the notification.&lt;br /&gt;
* description: Detailed message of the notification.&lt;br /&gt;
* expiration_date: The date when the notification should expire.&lt;br /&gt;
* is_active: Boolean flag to mark if the notification is active or inactive.&lt;br /&gt;
* is_unread: Boolean to mark if a notification is unread (default to true for new notifications).&lt;br /&gt;
&lt;br /&gt;
2. Associations:&lt;br /&gt;
&lt;br /&gt;
* Define associations between Notification, User, and Course models.&lt;br /&gt;
* User Association: Each notification should have a creator (e.g., a teaching assistant or instructor).&lt;br /&gt;
* Course Association: Each notification should be linked to a course, and the enrolled students should be able to view relevant notifications.&lt;br /&gt;
&lt;br /&gt;
3. Relationships:&lt;br /&gt;
&lt;br /&gt;
* One-to-Many: Course to Notification, as each course can have multiple notifications.&lt;br /&gt;
* One-to-Many: User (creator) to Notification, as a user can create multiple notifications.&lt;br /&gt;
* Many-to-Many (indirect): User to Notification via course enrollment, as multiple students can view a notification if they are enrolled in the course associated with the notification.&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
[[File:Schema2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Associations===&lt;br /&gt;
&lt;br /&gt;
'''Notification'''&lt;br /&gt;
&lt;br /&gt;
* belongs_to :user - Links the notification to its creator (TA, instructor).&lt;br /&gt;
&lt;br /&gt;
* belongs_to :course - Links the notification to a course.&lt;br /&gt;
&lt;br /&gt;
'''User'''&lt;br /&gt;
&lt;br /&gt;
* has_many :notifications - Users (instructors, TAs) can create multiple notifications.&lt;br /&gt;
&lt;br /&gt;
* has_many :viewable_notifications, through: :courses - Students can view notifications for courses they are enrolled in.&lt;br /&gt;
&lt;br /&gt;
'''Course'''&lt;br /&gt;
&lt;br /&gt;
* has_many :notifications - Each course can have multiple notifications.&lt;br /&gt;
&lt;br /&gt;
* has_many :students, through: :enrollments - Defines which students are associated with the course.&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
[[File:UML notification2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
''' Relationship Explanation''' &lt;br /&gt;
&lt;br /&gt;
* User to Notification: A User (e.g., TA, instructor) can create multiple notifications.&lt;br /&gt;
* Course to Notification: Each Course can have multiple notifications associated with it.&lt;br /&gt;
* User (Student) to Notification (Viewer): Through Course enrollment, students can access notifications related to their courses.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
== ⁠issue, methods, problem, solution (rename later)==&lt;br /&gt;
&lt;br /&gt;
== Endpoints for Notification Management ==&lt;br /&gt;
&lt;br /&gt;
Endpoints for Creating, Reading, Updating, and Deleting (CRUD) Notifications&lt;br /&gt;
&lt;br /&gt;
1. POST /notifications - Create a new notification.&lt;br /&gt;
&lt;br /&gt;
2. GET /notifications - Get a list of notifications (with optional filters, such as is_active or is_unread).&lt;br /&gt;
&lt;br /&gt;
3. GET /notifications/ - View details of a specific notification.&lt;br /&gt;
&lt;br /&gt;
4. PUT /notifications/ - Update a specific notification.&lt;br /&gt;
&lt;br /&gt;
5. DELETE /notifications/ - Delete a specific notification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
1. Model Tests:&lt;br /&gt;
&lt;br /&gt;
* Validate presence and format of subject and description.&lt;br /&gt;
* Test is_active and is_unread default values.&lt;br /&gt;
&lt;br /&gt;
2. Controller Tests:&lt;br /&gt;
&lt;br /&gt;
* Ensure proper creation, update, and deletion of notifications.&lt;br /&gt;
* Test that only authorized users can manage notifications.&lt;br /&gt;
&lt;br /&gt;
3. Integration Tests:&lt;br /&gt;
&lt;br /&gt;
* Test access control to verify that only eligible users can view or manage notifications based on role and course association.&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:'''&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158883</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158883"/>
		<updated>2024-11-11T23:10:24Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
To create a Notification model in the backend to handle notifications for the Expertiza system. This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic: Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
&amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
1. Model Creation:&lt;br /&gt;
&lt;br /&gt;
Create a Notification model with the following key attributes:&lt;br /&gt;
* id: Primary key (auto-generated).&lt;br /&gt;
* subject: Brief title of the notification.&lt;br /&gt;
* description: Detailed message of the notification.&lt;br /&gt;
* expiration_date: The date when the notification should expire.&lt;br /&gt;
* is_active: Boolean flag to mark if the notification is active or inactive.&lt;br /&gt;
* is_unread: Boolean to mark if a notification is unread (default to true for new notifications).&lt;br /&gt;
&lt;br /&gt;
2. Associations:&lt;br /&gt;
&lt;br /&gt;
* Define associations between Notification, User, and Course models.&lt;br /&gt;
* User Association: Each notification should have a creator (e.g., a teaching assistant or instructor).&lt;br /&gt;
* Course Association: Each notification should be linked to a course, and the enrolled students should be able to view relevant notifications.&lt;br /&gt;
&lt;br /&gt;
3. Relationships:&lt;br /&gt;
&lt;br /&gt;
* One-to-Many: Course to Notification, as each course can have multiple notifications.&lt;br /&gt;
* One-to-Many: User (creator) to Notification, as a user can create multiple notifications.&lt;br /&gt;
* Many-to-Many (indirect): User to Notification via course enrollment, as multiple students can view a notification if they are enrolled in the course associated with the notification.&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
[[File:Schema2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Associations===&lt;br /&gt;
&lt;br /&gt;
'''Notification'''&lt;br /&gt;
&lt;br /&gt;
belongs_to :user - Links the notification to its creator (TA, instructor).&lt;br /&gt;
&lt;br /&gt;
belongs_to :course - Links the notification to a course.&lt;br /&gt;
&lt;br /&gt;
'''User'''&lt;br /&gt;
&lt;br /&gt;
has_many :notifications - Users (instructors, TAs) can create multiple notifications.&lt;br /&gt;
&lt;br /&gt;
has_many :viewable_notifications, through: :courses - Students can view notifications for courses they are enrolled in.&lt;br /&gt;
&lt;br /&gt;
'''Course'''&lt;br /&gt;
&lt;br /&gt;
has_many :notifications - Each course can have multiple notifications.&lt;br /&gt;
&lt;br /&gt;
has_many :students, through: :enrollments - Defines which students are associated with the course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
[[File:UML notification2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
''' Relationship Explanation''' &lt;br /&gt;
&lt;br /&gt;
* User to Notification: A User (e.g., TA, instructor) can create multiple notifications.&lt;br /&gt;
* Course to Notification: Each Course can have multiple notifications associated with it.&lt;br /&gt;
* User (Student) to Notification (Viewer): Through Course enrollment, students can access notifications related to their courses.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
== ⁠issue, methods, problem, solution (rename later)==&lt;br /&gt;
&lt;br /&gt;
== Endpoints for Notification Management ==&lt;br /&gt;
&lt;br /&gt;
Endpoints for Creating, Reading, Updating, and Deleting (CRUD) Notifications&lt;br /&gt;
&lt;br /&gt;
1. POST /notifications - Create a new notification.&lt;br /&gt;
&lt;br /&gt;
2. GET /notifications - Get a list of notifications (with optional filters, such as is_active or is_unread).&lt;br /&gt;
&lt;br /&gt;
3. GET /notifications/ - View details of a specific notification.&lt;br /&gt;
&lt;br /&gt;
4. PUT /notifications/ - Update a specific notification.&lt;br /&gt;
&lt;br /&gt;
5. DELETE /notifications/ - Delete a specific notification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
1. Model Tests:&lt;br /&gt;
&lt;br /&gt;
* Validate presence and format of subject and description.&lt;br /&gt;
* Test is_active and is_unread default values.&lt;br /&gt;
&lt;br /&gt;
2. Controller Tests:&lt;br /&gt;
&lt;br /&gt;
* Ensure proper creation, update, and deletion of notifications.&lt;br /&gt;
* Test that only authorized users can manage notifications.&lt;br /&gt;
&lt;br /&gt;
3. Integration Tests:&lt;br /&gt;
&lt;br /&gt;
* Test access control to verify that only eligible users can view or manage notifications based on role and course association.&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:'''&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158882</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158882"/>
		<updated>2024-11-11T23:10:11Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: /* Design Goals */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
To create a Notification model in the backend to handle notifications for the Expertiza system. This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic:&lt;br /&gt;
        * Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
&amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
1. Model Creation:&lt;br /&gt;
&lt;br /&gt;
Create a Notification model with the following key attributes:&lt;br /&gt;
* id: Primary key (auto-generated).&lt;br /&gt;
* subject: Brief title of the notification.&lt;br /&gt;
* description: Detailed message of the notification.&lt;br /&gt;
* expiration_date: The date when the notification should expire.&lt;br /&gt;
* is_active: Boolean flag to mark if the notification is active or inactive.&lt;br /&gt;
* is_unread: Boolean to mark if a notification is unread (default to true for new notifications).&lt;br /&gt;
&lt;br /&gt;
2. Associations:&lt;br /&gt;
&lt;br /&gt;
* Define associations between Notification, User, and Course models.&lt;br /&gt;
* User Association: Each notification should have a creator (e.g., a teaching assistant or instructor).&lt;br /&gt;
* Course Association: Each notification should be linked to a course, and the enrolled students should be able to view relevant notifications.&lt;br /&gt;
&lt;br /&gt;
3. Relationships:&lt;br /&gt;
&lt;br /&gt;
* One-to-Many: Course to Notification, as each course can have multiple notifications.&lt;br /&gt;
* One-to-Many: User (creator) to Notification, as a user can create multiple notifications.&lt;br /&gt;
* Many-to-Many (indirect): User to Notification via course enrollment, as multiple students can view a notification if they are enrolled in the course associated with the notification.&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
[[File:Schema2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Associations===&lt;br /&gt;
&lt;br /&gt;
'''Notification'''&lt;br /&gt;
&lt;br /&gt;
belongs_to :user - Links the notification to its creator (TA, instructor).&lt;br /&gt;
&lt;br /&gt;
belongs_to :course - Links the notification to a course.&lt;br /&gt;
&lt;br /&gt;
'''User'''&lt;br /&gt;
&lt;br /&gt;
has_many :notifications - Users (instructors, TAs) can create multiple notifications.&lt;br /&gt;
&lt;br /&gt;
has_many :viewable_notifications, through: :courses - Students can view notifications for courses they are enrolled in.&lt;br /&gt;
&lt;br /&gt;
'''Course'''&lt;br /&gt;
&lt;br /&gt;
has_many :notifications - Each course can have multiple notifications.&lt;br /&gt;
&lt;br /&gt;
has_many :students, through: :enrollments - Defines which students are associated with the course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
[[File:UML notification2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
''' Relationship Explanation''' &lt;br /&gt;
&lt;br /&gt;
* User to Notification: A User (e.g., TA, instructor) can create multiple notifications.&lt;br /&gt;
* Course to Notification: Each Course can have multiple notifications associated with it.&lt;br /&gt;
* User (Student) to Notification (Viewer): Through Course enrollment, students can access notifications related to their courses.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
== ⁠issue, methods, problem, solution (rename later)==&lt;br /&gt;
&lt;br /&gt;
== Endpoints for Notification Management ==&lt;br /&gt;
&lt;br /&gt;
Endpoints for Creating, Reading, Updating, and Deleting (CRUD) Notifications&lt;br /&gt;
&lt;br /&gt;
1. POST /notifications - Create a new notification.&lt;br /&gt;
&lt;br /&gt;
2. GET /notifications - Get a list of notifications (with optional filters, such as is_active or is_unread).&lt;br /&gt;
&lt;br /&gt;
3. GET /notifications/ - View details of a specific notification.&lt;br /&gt;
&lt;br /&gt;
4. PUT /notifications/ - Update a specific notification.&lt;br /&gt;
&lt;br /&gt;
5. DELETE /notifications/ - Delete a specific notification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
1. Model Tests:&lt;br /&gt;
&lt;br /&gt;
* Validate presence and format of subject and description.&lt;br /&gt;
* Test is_active and is_unread default values.&lt;br /&gt;
&lt;br /&gt;
2. Controller Tests:&lt;br /&gt;
&lt;br /&gt;
* Ensure proper creation, update, and deletion of notifications.&lt;br /&gt;
* Test that only authorized users can manage notifications.&lt;br /&gt;
&lt;br /&gt;
3. Integration Tests:&lt;br /&gt;
&lt;br /&gt;
* Test access control to verify that only eligible users can view or manage notifications based on role and course association.&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:'''&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158881</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158881"/>
		<updated>2024-11-11T23:09:44Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: /* UML Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
To create a Notification model in the backend to handle notifications for the Expertiza system. This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic:&lt;br /&gt;
        * Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
* &amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
1. Model Creation:&lt;br /&gt;
&lt;br /&gt;
Create a Notification model with the following key attributes:&lt;br /&gt;
* id: Primary key (auto-generated).&lt;br /&gt;
* subject: Brief title of the notification.&lt;br /&gt;
* description: Detailed message of the notification.&lt;br /&gt;
* expiration_date: The date when the notification should expire.&lt;br /&gt;
* is_active: Boolean flag to mark if the notification is active or inactive.&lt;br /&gt;
* is_unread: Boolean to mark if a notification is unread (default to true for new notifications).&lt;br /&gt;
&lt;br /&gt;
2. Associations:&lt;br /&gt;
&lt;br /&gt;
* Define associations between Notification, User, and Course models.&lt;br /&gt;
* User Association: Each notification should have a creator (e.g., a teaching assistant or instructor).&lt;br /&gt;
* Course Association: Each notification should be linked to a course, and the enrolled students should be able to view relevant notifications.&lt;br /&gt;
&lt;br /&gt;
3. Relationships:&lt;br /&gt;
&lt;br /&gt;
* One-to-Many: Course to Notification, as each course can have multiple notifications.&lt;br /&gt;
* One-to-Many: User (creator) to Notification, as a user can create multiple notifications.&lt;br /&gt;
* Many-to-Many (indirect): User to Notification via course enrollment, as multiple students can view a notification if they are enrolled in the course associated with the notification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
[[File:Schema2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Associations===&lt;br /&gt;
&lt;br /&gt;
'''Notification'''&lt;br /&gt;
&lt;br /&gt;
belongs_to :user - Links the notification to its creator (TA, instructor).&lt;br /&gt;
&lt;br /&gt;
belongs_to :course - Links the notification to a course.&lt;br /&gt;
&lt;br /&gt;
'''User'''&lt;br /&gt;
&lt;br /&gt;
has_many :notifications - Users (instructors, TAs) can create multiple notifications.&lt;br /&gt;
&lt;br /&gt;
has_many :viewable_notifications, through: :courses - Students can view notifications for courses they are enrolled in.&lt;br /&gt;
&lt;br /&gt;
'''Course'''&lt;br /&gt;
&lt;br /&gt;
has_many :notifications - Each course can have multiple notifications.&lt;br /&gt;
&lt;br /&gt;
has_many :students, through: :enrollments - Defines which students are associated with the course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
[[File:UML notification2.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
''' Relationship Explanation''' &lt;br /&gt;
&lt;br /&gt;
* User to Notification: A User (e.g., TA, instructor) can create multiple notifications.&lt;br /&gt;
* Course to Notification: Each Course can have multiple notifications associated with it.&lt;br /&gt;
* User (Student) to Notification (Viewer): Through Course enrollment, students can access notifications related to their courses.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
== ⁠issue, methods, problem, solution (rename later)==&lt;br /&gt;
&lt;br /&gt;
== Endpoints for Notification Management ==&lt;br /&gt;
&lt;br /&gt;
Endpoints for Creating, Reading, Updating, and Deleting (CRUD) Notifications&lt;br /&gt;
&lt;br /&gt;
1. POST /notifications - Create a new notification.&lt;br /&gt;
&lt;br /&gt;
2. GET /notifications - Get a list of notifications (with optional filters, such as is_active or is_unread).&lt;br /&gt;
&lt;br /&gt;
3. GET /notifications/ - View details of a specific notification.&lt;br /&gt;
&lt;br /&gt;
4. PUT /notifications/ - Update a specific notification.&lt;br /&gt;
&lt;br /&gt;
5. DELETE /notifications/ - Delete a specific notification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
1. Model Tests:&lt;br /&gt;
&lt;br /&gt;
* Validate presence and format of subject and description.&lt;br /&gt;
* Test is_active and is_unread default values.&lt;br /&gt;
&lt;br /&gt;
2. Controller Tests:&lt;br /&gt;
&lt;br /&gt;
* Ensure proper creation, update, and deletion of notifications.&lt;br /&gt;
* Test that only authorized users can manage notifications.&lt;br /&gt;
&lt;br /&gt;
3. Integration Tests:&lt;br /&gt;
&lt;br /&gt;
* Test access control to verify that only eligible users can view or manage notifications based on role and course association.&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:'''&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_notification2.PNG&amp;diff=158880</id>
		<title>File:UML notification2.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_notification2.PNG&amp;diff=158880"/>
		<updated>2024-11-11T23:09:30Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158879</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158879"/>
		<updated>2024-11-11T23:00:49Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
To create a Notification model in the backend to handle notifications for the Expertiza system. This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic:&lt;br /&gt;
        * Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
* &amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
1. Model Creation:&lt;br /&gt;
&lt;br /&gt;
Create a Notification model with the following key attributes:&lt;br /&gt;
* id: Primary key (auto-generated).&lt;br /&gt;
* subject: Brief title of the notification.&lt;br /&gt;
* description: Detailed message of the notification.&lt;br /&gt;
* expiration_date: The date when the notification should expire.&lt;br /&gt;
* is_active: Boolean flag to mark if the notification is active or inactive.&lt;br /&gt;
* is_unread: Boolean to mark if a notification is unread (default to true for new notifications).&lt;br /&gt;
&lt;br /&gt;
2. Associations:&lt;br /&gt;
&lt;br /&gt;
* Define associations between Notification, User, and Course models.&lt;br /&gt;
* User Association: Each notification should have a creator (e.g., a teaching assistant or instructor).&lt;br /&gt;
* Course Association: Each notification should be linked to a course, and the enrolled students should be able to view relevant notifications.&lt;br /&gt;
&lt;br /&gt;
3. Relationships:&lt;br /&gt;
&lt;br /&gt;
* One-to-Many: Course to Notification, as each course can have multiple notifications.&lt;br /&gt;
* One-to-Many: User (creator) to Notification, as a user can create multiple notifications.&lt;br /&gt;
* Many-to-Many (indirect): User to Notification via course enrollment, as multiple students can view a notification if they are enrolled in the course associated with the notification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
[[File:Schema2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Associations===&lt;br /&gt;
&lt;br /&gt;
'''Notification'''&lt;br /&gt;
&lt;br /&gt;
belongs_to :user - Links the notification to its creator (TA, instructor).&lt;br /&gt;
&lt;br /&gt;
belongs_to :course - Links the notification to a course.&lt;br /&gt;
&lt;br /&gt;
'''User'''&lt;br /&gt;
&lt;br /&gt;
has_many :notifications - Users (instructors, TAs) can create multiple notifications.&lt;br /&gt;
&lt;br /&gt;
has_many :viewable_notifications, through: :courses - Students can view notifications for courses they are enrolled in.&lt;br /&gt;
&lt;br /&gt;
'''Course'''&lt;br /&gt;
&lt;br /&gt;
has_many :notifications - Each course can have multiple notifications.&lt;br /&gt;
&lt;br /&gt;
has_many :students, through: :enrollments - Defines which students are associated with the course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
[[File:UML notification.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
''' Relationship Explanation''' &lt;br /&gt;
&lt;br /&gt;
* User to Notification: A User (e.g., TA, instructor) can create multiple notifications.&lt;br /&gt;
* Course to Notification: Each Course can have multiple notifications associated with it.&lt;br /&gt;
* User (Student) to Notification (Viewer): Through Course enrollment, students can access notifications related to their courses.&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
== ⁠issue, methods, problem, solution (rename later)==&lt;br /&gt;
&lt;br /&gt;
== Endpoints for Notification Management ==&lt;br /&gt;
&lt;br /&gt;
Endpoints for Creating, Reading, Updating, and Deleting (CRUD) Notifications&lt;br /&gt;
&lt;br /&gt;
1. POST /notifications - Create a new notification.&lt;br /&gt;
&lt;br /&gt;
2. GET /notifications - Get a list of notifications (with optional filters, such as is_active or is_unread).&lt;br /&gt;
&lt;br /&gt;
3. GET /notifications/ - View details of a specific notification.&lt;br /&gt;
&lt;br /&gt;
4. PUT /notifications/ - Update a specific notification.&lt;br /&gt;
&lt;br /&gt;
5. DELETE /notifications/ - Delete a specific notification.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
1. Model Tests:&lt;br /&gt;
&lt;br /&gt;
* Validate presence and format of subject and description.&lt;br /&gt;
* Test is_active and is_unread default values.&lt;br /&gt;
&lt;br /&gt;
2. Controller Tests:&lt;br /&gt;
&lt;br /&gt;
* Ensure proper creation, update, and deletion of notifications.&lt;br /&gt;
* Test that only authorized users can manage notifications.&lt;br /&gt;
&lt;br /&gt;
3. Integration Tests:&lt;br /&gt;
&lt;br /&gt;
* Test access control to verify that only eligible users can view or manage notifications based on role and course association.&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:'''&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158878</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158878"/>
		<updated>2024-11-11T22:44:28Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
To create a Notification model in the backend to handle notifications for the Expertiza system. This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic:&lt;br /&gt;
        * Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
* &amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
[[File:Schema2.PNG]]&lt;br /&gt;
&lt;br /&gt;
===Associations===&lt;br /&gt;
&lt;br /&gt;
'''Notification'''&lt;br /&gt;
&lt;br /&gt;
belongs_to :user - Links the notification to its creator (TA, instructor).&lt;br /&gt;
&lt;br /&gt;
belongs_to :course - Links the notification to a course.&lt;br /&gt;
&lt;br /&gt;
'''User'''&lt;br /&gt;
&lt;br /&gt;
has_many :notifications - Users (instructors, TAs) can create multiple notifications.&lt;br /&gt;
&lt;br /&gt;
has_many :viewable_notifications, through: :courses - Students can view notifications for courses they are enrolled in.&lt;br /&gt;
&lt;br /&gt;
'''Course'''&lt;br /&gt;
&lt;br /&gt;
has_many :notifications - Each course can have multiple notifications.&lt;br /&gt;
&lt;br /&gt;
has_many :students, through: :enrollments - Defines which students are associated with the course.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
[[File:UML notification.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
== ⁠issue, methods, problem, solution (rename later)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
1. Model Tests:&lt;br /&gt;
&lt;br /&gt;
* Validate presence and format of subject and description.&lt;br /&gt;
* Test is_active and is_unread default values.&lt;br /&gt;
&lt;br /&gt;
2. Controller Tests:&lt;br /&gt;
&lt;br /&gt;
* Ensure proper creation, update, and deletion of notifications.&lt;br /&gt;
* Test that only authorized users can manage notifications.&lt;br /&gt;
&lt;br /&gt;
3. Integration Tests:&lt;br /&gt;
&lt;br /&gt;
* Test access control to verify that only eligible users can view or manage notifications based on role and course association.&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:'''&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Schema2.PNG&amp;diff=158877</id>
		<title>File:Schema2.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Schema2.PNG&amp;diff=158877"/>
		<updated>2024-11-11T22:38:49Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158876</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158876"/>
		<updated>2024-11-11T22:35:33Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
To create a Notification model in the backend to handle notifications for the Expertiza system. This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic:&lt;br /&gt;
        * Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
* &amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
* Each notification must be associated with a single course.&lt;br /&gt;
* Each course may or may not have notifications associated with it.&lt;br /&gt;
* Many notifications can be sent to many users.&lt;br /&gt;
* Many users can create/send many notifications.&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
[[File:UML notification.PNG| center]]&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
== ⁠issue, methods, problem, solution (rename later)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:'''&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_notification.PNG&amp;diff=158875</id>
		<title>File:UML notification.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_notification.PNG&amp;diff=158875"/>
		<updated>2024-11-11T22:33:37Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: Vshetty2 uploaded a new version of File:UML notification.PNG&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158874</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158874"/>
		<updated>2024-11-11T22:22:17Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Objective==&lt;br /&gt;
To create a Notification model in the backend to handle notifications for the Expertiza system. This model will manage notifications for different courses and be accessible to students and instructors based on their association with a course. Notifications can have attributes such as subject, description, expiration date, and status (active/inactive).&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic:&lt;br /&gt;
        * Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
* &amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
* Each notification must be associated with a single course.&lt;br /&gt;
* Each course may or may not have notifications associated with it.&lt;br /&gt;
* Many notifications can be sent to many users.&lt;br /&gt;
* Many users can create/send many notifications.&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
[[File:UML notification.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
== ⁠issue, methods, problem, solution (rename later)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:'''&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158873</id>
		<title>CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2483._Reimplement_Notification_Controller_and_Model&amp;diff=158873"/>
		<updated>2024-11-11T21:59:42Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
This project is the implementation for the notification model and controller in the Expertiza backend.&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
* Create a new Notification model with appropriate attributes and relationships:&lt;br /&gt;
* Define associations with User and Course models&lt;br /&gt;
* Implement scopes for filtering notifications based on roles&lt;br /&gt;
* Add validation rules for notification data&lt;br /&gt;
* Include timestamp fields for proper notification tracking&lt;br /&gt;
* Develop a NotificationsController with:&lt;br /&gt;
    * Standard CRUD operations (create, read, update, delete)&lt;br /&gt;
    * Role-based access control logic&lt;br /&gt;
    * Course enrollment verification&lt;br /&gt;
    * Proper error handling and response formatting&lt;br /&gt;
    * RESTful API endpoints&lt;br /&gt;
    * Implement authorization logic:&lt;br /&gt;
        * Add policies to ensure students only see relevant notifications&lt;br /&gt;
* Write comprehensive test cases:&lt;br /&gt;
    * Unit tests for the Notification model&lt;br /&gt;
    * Controller tests covering all CRUD operations&lt;br /&gt;
    * Integration tests for role-based access&lt;br /&gt;
    * Test cases for error scenarios and edge cases&lt;br /&gt;
&lt;br /&gt;
==Design Goals==&lt;br /&gt;
* &amp;lt;b&amp;gt;Implement the Notification backend:&amp;lt;/b&amp;gt; Implement the Notification in Ruby on Rails.&lt;br /&gt;
&lt;br /&gt;
==Schema==&lt;br /&gt;
* Each notification must be associated with a single course.&lt;br /&gt;
* Each course may or may not have notifications associated with it.&lt;br /&gt;
* Many notifications can be sent to many users.&lt;br /&gt;
* Many users can create/send many notifications.&lt;br /&gt;
&lt;br /&gt;
===UML Diagram===&lt;br /&gt;
[[File:UML notification.PNG]]&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
&lt;br /&gt;
== ⁠issue, methods, problem, solution (rename later)==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
* '''Aditi Killedar''' akilled@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' &lt;br /&gt;
* '''Pull Request:'''&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_notification.PNG&amp;diff=158775</id>
		<title>File:UML notification.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_notification.PNG&amp;diff=158775"/>
		<updated>2024-11-10T23:40:34Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Schema.PNG&amp;diff=158774</id>
		<title>File:Schema.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Schema.PNG&amp;diff=158774"/>
		<updated>2024-11-10T23:22:49Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=158741</id>
		<title>CSC/ECE 517 Fall 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=158741"/>
		<updated>2024-11-09T23:38:27Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2024 - E2450. Refactor assignments_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2452. Refactor review_mapping_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2453. Refactor review_mapping_helper.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2454. Refactor student_task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2455. Refactor sign_up_sheet_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2458. User management and users table]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2459. View for results of bidding]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2460 Mentor-Meeting Management]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2461. UI for Courses]]&lt;br /&gt;
* [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2462._UI_for_Questionnaires CSC/ECE 517 Fall 2024 - E2462. UI for Questionnaire.rb]&lt;br /&gt;
* [https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2463_Implement_Front_End_for_Student_Task_List CSC/ECE 517 Fall 2024 - E2463. UI for Student Task List]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2464 UI for Project Topics (was: Sign_up_Topics)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2465. UI for Institutions and Notification]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2466. UI for Impersonate User]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2467. UI for View Submissions]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2468. Reimplement due_date]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2469. Reimplement grades/view_team]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2470. Reimplement grades_controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2471. Reimplement logger]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2472. Reimplement responses_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2475. Reimplement student_task view]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2478. Reimplement the Question hierarchy as Item hierarchy]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2480. Implement testing for new Bookmarks Controller]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2481 Reimplement response_map.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2482. Reimplement heatgrid for reviews]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2401 Refactor Graphql API endpoint for contribution metrics]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - G2402 Refactor Graphql API endpoint for repositories]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2484. Reimplement participants_controller.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb (Phase 2 - Design Document)]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2483. Reimplement Notification Controller and Model]]&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2465._UI_for_Institutions_and_Notification&amp;diff=158480</id>
		<title>CSC/ECE 517 Fall 2024 - E2465. UI for Institutions and Notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2465._UI_for_Institutions_and_Notification&amp;diff=158480"/>
		<updated>2024-10-30T03:30:56Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=About Expertiza=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza], an open-source project built on Ruby on Rails, serves as a versatile learning management platform, enabling instructors to design and customize assignments. It facilitates collaborative learning by allowing students to select topics, form teams, and participate in peer reviews. Recently, the platform has expanded to incorporate modern frontend technologies, with components being refactored to use React.js and Typescript. This upgrade enhances the user experience, making the interface more interactive and responsive while supporting submissions in multiple formats, including URLs and wiki pages, for seamless review and evaluation.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* The prior implementation effectively created user interfaces for managing roles and institutions but missed certain critical specifications.&lt;br /&gt;
* The project was not merged due to unnecessary dynamic role creation; only administrators required the ability to add roles, so this feature was removed to simplify the design.&lt;br /&gt;
* The institution management interface lacked proper authorization, allowing all users access to manage institutions, which conflicted with intended role-based permissions.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
* &amp;lt;b&amp;gt;Modernize the Frontend:&amp;lt;/b&amp;gt; Re-implement the existing Institutions UI from Ruby on Rails to TypeScript and ReactJS for improved modularity, performance, and maintainability.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Authorization-Optimized UIs:&amp;lt;/b&amp;gt; Ensure role-based access by allowing only designated roles (e.g., TAs, Instructors) to manage specific functionalities in Institutions and Notifications.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Enhanced Notifications Feature:&amp;lt;/b&amp;gt; Introduce a robust notification management system that enables course-specific notifications creation for higher roles and displays relevant notifications to enrolled students.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Toggle and Filter Options:&amp;lt;/b&amp;gt; Implement a toggle for notifications to control active/inactive status and filter notifications for students to display only active, course-relevant alerts.&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
=== Enhanced the Manage Institutions page UI ===&lt;br /&gt;
&lt;br /&gt;
Improved the layout and styling of the Manage Institutions page to provide a more user-friendly interface. Adjusted table centering, optimized spacing, and updated visual elements for better alignment and readability.&lt;br /&gt;
[[File:Manage institutions.PNG|center|800px]]&lt;br /&gt;
&lt;br /&gt;
===Added authorization for Institutions [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/0eb2a19b2aa2454f4e5e51b3a02afd28ec79e63c commit]===&lt;br /&gt;
&lt;br /&gt;
Implemented role-based access control to ensure only users with Instructor or higher roles can manage institutions, aligning permissions with user roles and preventing unauthorized access.&lt;br /&gt;
[[File: Authentication for institution.PNG|center|800px]]&lt;br /&gt;
&lt;br /&gt;
===Added Manage Notifications Page [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/de6b0d635cc1a0446928dbe7c838be3ad913f73d commit]===&lt;br /&gt;
&lt;br /&gt;
Developed a dedicated page where authorized users, such as TAs and Instructors, can create, edit, and delete course-specific notifications to streamline communication and course updates.&lt;br /&gt;
[[File:Manage notifications.PNG|center|800px]]&lt;br /&gt;
Following pop-up window appears on clicking create button. the Close/ Create Notification button will redirect to the Manage Notifications page.&lt;br /&gt;
[[File:Manage notifications - create.png|center|800px]]&lt;br /&gt;
Following pop-up window appears on clicking edit button for an existing notification. the Close/ Update Notification button will redirect to the Manage Notifications page.&lt;br /&gt;
[[File:Manage notifications - update.png|center|800px]]&lt;br /&gt;
Following pop-up window appears on clicking delete button. the Delete button will redirect to the Manage Notifications page and dispatch an alert message on top of the page that the notification was deleted successfully.&lt;br /&gt;
[[File:Manage notifications - delete.png|center|800px]]&lt;br /&gt;
&lt;br /&gt;
===Added My Notifications Page [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/c998ced0962c1d786d5e137c638f9cf051488e20 commit]===&lt;br /&gt;
&lt;br /&gt;
Created a page for students to view relevant, active notifications for courses they are enrolled in, ensuring they receive timely updates on assignments, exams, and other course events.&lt;br /&gt;
[[File:My notifications.PNG|center|800px]]&lt;br /&gt;
&lt;br /&gt;
===Added Toggle Notification Feature [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/d341cdfea89b85a24fb5c9be4340981b46bccba5 commit]===&lt;br /&gt;
&lt;br /&gt;
Implemented a toggle option for authorized users to activate or deactivate notifications, allowing control over the visibility of notifications for students based on course requirements.&lt;br /&gt;
[[File:Toggle notifications.PNG|center|300px]]&lt;br /&gt;
&lt;br /&gt;
===Added Notification Badge [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/a66f55a3907c6bf969a2b1751624cf81ab353583 commit]===&lt;br /&gt;
&lt;br /&gt;
Introduced a notification badge on the &amp;quot;My Notifications&amp;quot; menu item, displaying the count of new or unread notifications to keep users informed of recent updates at a glance.&lt;br /&gt;
[[File:Notification badge.PNG|center|600px]]&lt;br /&gt;
&lt;br /&gt;
===Added Alert on Home Page===&lt;br /&gt;
&lt;br /&gt;
Implemented an alert on the home page to notify users of any unread notifications upon login, ensuring important updates are immediately visible.&lt;br /&gt;
[[File:Notification Alert.PNG|center|900px]]&lt;br /&gt;
&lt;br /&gt;
=Design Pattern=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;1. Container-Presenter Pattern&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Container components are responsible for managing the logic, data fetching, and application state.&lt;br /&gt;
Presenter components (also known as Dumb Components) focus on rendering UI elements based on the props received from the container. They don’t manage state or handle business logic directly; instead, they rely on the container for data.&lt;br /&gt;
&lt;br /&gt;
*Institutions and Notifications as Container Components:&lt;br /&gt;
**In Institutions.tsx and Notifications.tsx, the primary components act as containers. &lt;br /&gt;
**Load the required data using the useLoaderData hook (e.g., fetching institution and notification data).&lt;br /&gt;
**Handle logic and user interactions (e.g., onEditHandle and onDeleteHandle for editing and deleting institutions/notifications).&lt;br /&gt;
**Handle the permissions and authorization checks, showing different options based on user roles.&lt;br /&gt;
&lt;br /&gt;
*UI Table and Actions as Presenter Components:&lt;br /&gt;
**Components such as the Table component and column definitions in institutionColumns.tsx and notificationColumns.tsx act as presenters.&lt;br /&gt;
**The presenters don’t hold business logic or directly manage state; they simply render the data provided by the container components. &lt;br /&gt;
**For instance:&lt;br /&gt;
**The Table component renders the list of institutions/notifications.&lt;br /&gt;
**notificationColumns and institutionColumns define the columns, actions, and structure without managing the actual data or state.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt; 2. Strategy Pattern &amp;lt;/b&amp;gt;&lt;br /&gt;
Used in a Limited Form: The Strategy pattern is partially used here in how we pass callback functions (handleEdit and handleDelete) to the column definitions for the table. These functions define the “strategy” for how each action should be handled, allowing flexibility without modifying the notificationColumns or institutionColumns structures.&lt;br /&gt;
&lt;br /&gt;
*Implementation Detail: By passing these functions as arguments, we can customize the behavior for different actions (like editing or deleting) based on the page context. This approach allows us to define different behaviors without altering the column setup, which is a core aspect of the Strategy pattern.&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
Added mock data for verifying the pages are rendered as expected. There is currently no backend implemented, so the tests does not involve calling relevant API endpoints; this will be considered as future work.&lt;br /&gt;
[[File:mock data.png|center|800px]]&lt;br /&gt;
Following is the video demonstrating the UI workflows. Since this is a UI project, the functionality is tested manually.&lt;br /&gt;
* '''Test Video Link:''' https://youtu.be/h7CiRxTgctA&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/SoubarnicaSuresh/reimplementation-front-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-front-end/pull/67&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2465._UI_for_Institutions_and_Notification&amp;diff=158435</id>
		<title>CSC/ECE 517 Fall 2024 - E2465. UI for Institutions and Notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2465._UI_for_Institutions_and_Notification&amp;diff=158435"/>
		<updated>2024-10-30T03:18:25Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=About Expertiza=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza], an open-source project built on Ruby on Rails, serves as a versatile learning management platform, enabling instructors to design and customize assignments. It facilitates collaborative learning by allowing students to select topics, form teams, and participate in peer reviews. Recently, the platform has expanded to incorporate modern frontend technologies, with components being refactored to use React.js and Typescript. This upgrade enhances the user experience, making the interface more interactive and responsive while supporting submissions in multiple formats, including URLs and wiki pages, for seamless review and evaluation.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* The prior implementation effectively created user interfaces for managing roles and institutions but missed certain critical specifications.&lt;br /&gt;
* The project was not merged due to unnecessary dynamic role creation; only administrators required the ability to add roles, so this feature was removed to simplify the design.&lt;br /&gt;
* The institution management interface lacked proper authorization, allowing all users access to manage institutions, which conflicted with intended role-based permissions.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
* &amp;lt;b&amp;gt;Modernize the Frontend:&amp;lt;/b&amp;gt; Re-implement the existing Institutions UI from Ruby on Rails to TypeScript and ReactJS for improved modularity, performance, and maintainability.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Authorization-Optimized UIs:&amp;lt;/b&amp;gt; Ensure role-based access by allowing only designated roles (e.g., TAs, Instructors) to manage specific functionalities in Institutions and Notifications.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Enhanced Notifications Feature:&amp;lt;/b&amp;gt; Introduce a robust notification management system that enables course-specific notifications creation for higher roles and displays relevant notifications to enrolled students.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Toggle and Filter Options:&amp;lt;/b&amp;gt; Implement a toggle for notifications to control active/inactive status and filter notifications for students to display only active, course-relevant alerts.&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
=== Enhanced the Manage Institutions page UI ===&lt;br /&gt;
&lt;br /&gt;
Improved the layout and styling of the Manage Institutions page to provide a more user-friendly interface. Adjusted table centering, optimized spacing, and updated visual elements for better alignment and readability.&lt;br /&gt;
[[File:Manage institutions.PNG|center|800px]]&lt;br /&gt;
&lt;br /&gt;
===Added authorization for Institutions [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/0eb2a19b2aa2454f4e5e51b3a02afd28ec79e63c commit]===&lt;br /&gt;
&lt;br /&gt;
Implemented role-based access control to ensure only users with Instructor or higher roles can manage institutions, aligning permissions with user roles and preventing unauthorized access.&lt;br /&gt;
[[File: Authentication for institution.PNG|center|800px]]&lt;br /&gt;
&lt;br /&gt;
===Added Manage Notifications Page [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/de6b0d635cc1a0446928dbe7c838be3ad913f73d commit]===&lt;br /&gt;
&lt;br /&gt;
Developed a dedicated page where authorized users, such as TAs and Instructors, can create, edit, and delete course-specific notifications to streamline communication and course updates.&lt;br /&gt;
[[File:Manage notifications.PNG|center|800px]]&lt;br /&gt;
Following pop-up window appears on clicking create button. the Close/ Create Notification button will redirect to the Manage Notifications page.&lt;br /&gt;
[[File:Manage notifications - create.png|center|800px]]&lt;br /&gt;
Following pop-up window appears on clicking edit button for an existing notification. the Close/ Update Notification button will redirect to the Manage Notifications page.&lt;br /&gt;
[[File:Manage notifications - update.png|center|800px]]&lt;br /&gt;
Following pop-up window appears on clicking delete button. the Delete button will redirect to the Manage Notifications page and dispatch an alert message on top of the page that the notification was deleted successfully.&lt;br /&gt;
[[File:Manage notifications - delete.png|center|800px]]&lt;br /&gt;
&lt;br /&gt;
===Added My Notifications Page [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/c998ced0962c1d786d5e137c638f9cf051488e20 commit]===&lt;br /&gt;
&lt;br /&gt;
Created a page for students to view relevant, active notifications for courses they are enrolled in, ensuring they receive timely updates on assignments, exams, and other course events.&lt;br /&gt;
[[File:My notifications.PNG|center|800px]]&lt;br /&gt;
&lt;br /&gt;
===Added Toggle Notification Feature [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/d341cdfea89b85a24fb5c9be4340981b46bccba5 commit]===&lt;br /&gt;
&lt;br /&gt;
Implemented a toggle option for authorized users to activate or deactivate notifications, allowing control over the visibility of notifications for students based on course requirements.&lt;br /&gt;
[[File:Toggle notifications.PNG|center|300px]]&lt;br /&gt;
&lt;br /&gt;
===Added Notification Badge [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/a66f55a3907c6bf969a2b1751624cf81ab353583 commit]===&lt;br /&gt;
&lt;br /&gt;
Introduced a notification badge on the &amp;quot;My Notifications&amp;quot; menu item, displaying the count of new or unread notifications to keep users informed of recent updates at a glance.&lt;br /&gt;
[[File:Notification badge.PNG|center|600px]]&lt;br /&gt;
&lt;br /&gt;
===Added Alert on Home Page===&lt;br /&gt;
&lt;br /&gt;
Implemented an alert on the home page to notify users of any unread notifications upon login, ensuring important updates are immediately visible.&lt;br /&gt;
[[File:Notification Alert.PNG|center|900px]]&lt;br /&gt;
&lt;br /&gt;
=Testing=&lt;br /&gt;
Added mock data for verifying the pages are rendered as expected. There is currently no backend implemented, so the tests does not involve calling relevant API endpoints; this will be considered as future work.&lt;br /&gt;
[[File:mock data.png|center|800px]]&lt;br /&gt;
Following is the video demonstrating the UI workflows. Since this is a UI project, the functionality is tested manually.&lt;br /&gt;
* '''Test Video Link:''' https://youtu.be/h7CiRxTgctA&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/SoubarnicaSuresh/reimplementation-front-end&lt;br /&gt;
* '''Pull Request:''' https://github.com/expertiza/reimplementation-front-end/pull/67&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2465._UI_for_Institutions_and_Notification&amp;diff=157624</id>
		<title>CSC/ECE 517 Fall 2024 - E2465. UI for Institutions and Notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2465._UI_for_Institutions_and_Notification&amp;diff=157624"/>
		<updated>2024-10-29T20:48:50Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=About Expertiza=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza], an open-source project built on Ruby on Rails, serves as a versatile learning management platform, enabling instructors to design and customize assignments. It facilitates collaborative learning by allowing students to select topics, form teams, and participate in peer reviews. Recently, the platform has expanded to incorporate modern frontend technologies, with components being refactored to use React.js and Typescript. This upgrade enhances the user experience, making the interface more interactive and responsive while supporting submissions in multiple formats, including URLs and wiki pages, for seamless review and evaluation.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* The prior implementation effectively created user interfaces for managing roles and institutions but missed certain critical specifications.&lt;br /&gt;
* The project was not merged due to unnecessary dynamic role creation; only administrators required the ability to add roles, so this feature was removed to simplify the design.&lt;br /&gt;
* The institution management interface lacked proper authorization, allowing all users access to manage institutions, which conflicted with intended role-based permissions.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
* &amp;lt;b&amp;gt;Modernize the Frontend:&amp;lt;/b&amp;gt; Re-implement the existing Institutions UI from Ruby on Rails to TypeScript and ReactJS for improved modularity, performance, and maintainability.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Authorization-Optimized UIs:&amp;lt;/b&amp;gt; Ensure role-based access by allowing only designated roles (e.g., TAs, Instructors) to manage specific functionalities in Institutions and Notifications.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Enhanced Notifications Feature:&amp;lt;/b&amp;gt; Introduce a robust notification management system that enables course-specific notifications creation for higher roles and displays relevant notifications to enrolled students.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Toggle and Filter Options:&amp;lt;/b&amp;gt; Implement a toggle for notifications to control active/inactive status and filter notifications for students to display only active, course-relevant alerts.&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
=== Enhanced the Manage Institutions page UI ===&lt;br /&gt;
&lt;br /&gt;
Improved the layout and styling of the Manage Institutions page to provide a more user-friendly interface. Adjusted table centering, optimized spacing, and updated visual elements for better alignment and readability.&lt;br /&gt;
[[File:Manage institutions.PNG|center|800px]]&lt;br /&gt;
&lt;br /&gt;
===Added authorization for Institutions [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/0eb2a19b2aa2454f4e5e51b3a02afd28ec79e63c commit]===&lt;br /&gt;
&lt;br /&gt;
Implemented role-based access control to ensure only users with Instructor or higher roles can manage institutions, aligning permissions with user roles and preventing unauthorized access.&lt;br /&gt;
[[File: Authentication for institution.PNG|center|800px]]&lt;br /&gt;
&lt;br /&gt;
===Added Manage Notifications Page [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/de6b0d635cc1a0446928dbe7c838be3ad913f73d commit]===&lt;br /&gt;
&lt;br /&gt;
Developed a dedicated page where authorized users, such as TAs and Instructors, can create, edit, and delete course-specific notifications to streamline communication and course updates.&lt;br /&gt;
[[File:Manage notifications.PNG|center|800px]]&lt;br /&gt;
&lt;br /&gt;
===Added My Notifications Page [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/c998ced0962c1d786d5e137c638f9cf051488e20 commit]===&lt;br /&gt;
&lt;br /&gt;
Created a page for students to view relevant, active notifications for courses they are enrolled in, ensuring they receive timely updates on assignments, exams, and other course events.&lt;br /&gt;
[[File:My notifications.PNG|center|800px]]&lt;br /&gt;
&lt;br /&gt;
===Added Toggle Notification Feature [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/d341cdfea89b85a24fb5c9be4340981b46bccba5 commit]===&lt;br /&gt;
&lt;br /&gt;
Implemented a toggle option for authorized users to activate or deactivate notifications, allowing control over the visibility of notifications for students based on course requirements.&lt;br /&gt;
[[File:Toggle notifications.PNG|center|300px]]&lt;br /&gt;
&lt;br /&gt;
===Added Notification Badge [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/a66f55a3907c6bf969a2b1751624cf81ab353583 commit]===&lt;br /&gt;
&lt;br /&gt;
Introduced a notification badge on the &amp;quot;My Notifications&amp;quot; menu item, displaying the count of new or unread notifications to keep users informed of recent updates at a glance.&lt;br /&gt;
[[File:Notification badge.PNG|center|600px]]&lt;br /&gt;
&lt;br /&gt;
===Added Alert on Home Page===&lt;br /&gt;
&lt;br /&gt;
Implemented an alert on the home page to notify users of any unread notifications upon login, ensuring important updates are immediately visible.&lt;br /&gt;
[[File:Notification Alert.PNG|center|900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Team=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;Mentor&amp;lt;/b&amp;gt; Jay Patel : jhpatel9@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
* '''Vaibhavi Shetty:''' vshetty2@ncsu.edu&lt;br /&gt;
* '''Soubarnica Suresh''' ssomang@ncsu.edu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Relevant Links=&lt;br /&gt;
* '''Github Repository:''' https://github.com/SoubarnicaSuresh/reimplementation-front-end&lt;br /&gt;
* '''Pull Request:''' &lt;br /&gt;
* '''Test Video Link:'''&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Notification_Alert.PNG&amp;diff=157604</id>
		<title>File:Notification Alert.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Notification_Alert.PNG&amp;diff=157604"/>
		<updated>2024-10-29T20:35:00Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Notification_badge.PNG&amp;diff=157602</id>
		<title>File:Notification badge.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Notification_badge.PNG&amp;diff=157602"/>
		<updated>2024-10-29T20:33:21Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:My_notifications.PNG&amp;diff=157601</id>
		<title>File:My notifications.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:My_notifications.PNG&amp;diff=157601"/>
		<updated>2024-10-29T20:32:04Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Toggle_notifications.PNG&amp;diff=157595</id>
		<title>File:Toggle notifications.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Toggle_notifications.PNG&amp;diff=157595"/>
		<updated>2024-10-29T20:28:20Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Manage_notifications.PNG&amp;diff=157593</id>
		<title>File:Manage notifications.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Manage_notifications.PNG&amp;diff=157593"/>
		<updated>2024-10-29T20:25:29Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Manage_institutions.PNG&amp;diff=157584</id>
		<title>File:Manage institutions.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Manage_institutions.PNG&amp;diff=157584"/>
		<updated>2024-10-29T20:10:45Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Authentication_for_institution.PNG&amp;diff=157560</id>
		<title>File:Authentication for institution.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Authentication_for_institution.PNG&amp;diff=157560"/>
		<updated>2024-10-29T19:33:18Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:NC_State.jpg&amp;diff=157530</id>
		<title>File:NC State.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:NC_State.jpg&amp;diff=157530"/>
		<updated>2024-10-29T18:36:53Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2465._UI_for_Institutions_and_Notification&amp;diff=157394</id>
		<title>CSC/ECE 517 Fall 2024 - E2465. UI for Institutions and Notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2465._UI_for_Institutions_and_Notification&amp;diff=157394"/>
		<updated>2024-10-29T06:03:52Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
=About Expertiza=&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza], an open-source project built on Ruby on Rails, serves as a versatile learning management platform, enabling instructors to design and customize assignments. It facilitates collaborative learning by allowing students to select topics, form teams, and participate in peer reviews. Recently, the platform has expanded to incorporate modern frontend technologies, with components being refactored to use React.js and Typescript. This upgrade enhances the user experience, making the interface more interactive and responsive while supporting submissions in multiple formats, including URLs and wiki pages, for seamless review and evaluation.&lt;br /&gt;
&lt;br /&gt;
=Issues with previous Functionality=&lt;br /&gt;
* The prior implementation effectively created user interfaces for managing roles and institutions but missed certain critical specifications.&lt;br /&gt;
* The project was not merged due to unnecessary dynamic role creation; only administrators required the ability to add roles, so this feature was removed to simplify the design.&lt;br /&gt;
* The institution management interface lacked proper authorization, allowing all users access to manage institutions, which conflicted with intended role-based permissions.&lt;br /&gt;
&lt;br /&gt;
=Design Goals=&lt;br /&gt;
* &amp;lt;b&amp;gt;Modernize the Frontend:&amp;lt;/b&amp;gt; Re-implement the existing Institutions UI from Ruby on Rails to TypeScript and ReactJS for improved modularity, performance, and maintainability.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Authorization-Optimized UIs:&amp;lt;/b&amp;gt; Ensure role-based access by allowing only designated roles (e.g., TAs, Instructors) to manage specific functionalities in Institutions and Notifications.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Enhanced Notifications Feature:&amp;lt;/b&amp;gt; Introduce a robust notification management system that enables course-specific notifications creation for higher roles and displays relevant notifications to enrolled students.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b&amp;gt;Toggle and Filter Options:&amp;lt;/b&amp;gt; Implement a toggle for notifications to control active/inactive status and filter notifications for students to display only active, course-relevant alerts.&lt;br /&gt;
&lt;br /&gt;
=Implementation=&lt;br /&gt;
&lt;br /&gt;
===Added authorization for Institutions [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/0eb2a19b2aa2454f4e5e51b3a02afd28ec79e63c commit]===&lt;br /&gt;
&lt;br /&gt;
Implemented role-based access control to ensure only users with Instructor or higher roles can manage institutions, aligning permissions with user roles and preventing unauthorized access.&lt;br /&gt;
&lt;br /&gt;
===Added Manage Notifications Page [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/de6b0d635cc1a0446928dbe7c838be3ad913f73d commit]===&lt;br /&gt;
&lt;br /&gt;
Developed a dedicated page where authorized users, such as TAs and Instructors, can create, edit, and delete course-specific notifications to streamline communication and course updates.&lt;br /&gt;
&lt;br /&gt;
===Added View Notifications Page [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/c998ced0962c1d786d5e137c638f9cf051488e20 commit]===&lt;br /&gt;
&lt;br /&gt;
Created a page for students to view relevant, active notifications for courses they are enrolled in, ensuring they receive timely updates on assignments, exams, and other course events.&lt;br /&gt;
&lt;br /&gt;
===Added Toggle Notification Feature [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/d341cdfea89b85a24fb5c9be4340981b46bccba5 commit]===&lt;br /&gt;
&lt;br /&gt;
Implemented a toggle option for authorized users to activate or deactivate notifications, allowing control over the visibility of notifications for students based on course requirements.&lt;br /&gt;
&lt;br /&gt;
===Added Notification Badge [https://github.com/SoubarnicaSuresh/reimplementation-front-end/commit/a66f55a3907c6bf969a2b1751624cf81ab353583 commit]===&lt;br /&gt;
&lt;br /&gt;
Introduced a notification badge on the &amp;quot;My Notifications&amp;quot; menu item, displaying the count of new or unread notifications to keep users informed of recent updates at a glance.&lt;br /&gt;
&lt;br /&gt;
===Added Alert on Home Page===&lt;br /&gt;
&lt;br /&gt;
Implemented an alert on the home page to notify users of any unread notifications upon login, ensuring important updates are immediately visible.&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2465._UI_for_Institutions_and_Notification&amp;diff=157248</id>
		<title>CSC/ECE 517 Fall 2024 - E2465. UI for Institutions and Notification</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024_-_E2465._UI_for_Institutions_and_Notification&amp;diff=157248"/>
		<updated>2024-10-28T04:25:21Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: Created page with &amp;quot; __TOC__  ==About Expertiza==  [http://expertiza.ncsu.edu/ Expertiza], an open-source project built on Ruby on Rails, serves as a versatile learning management platform, enabling instructors to design and customize assignments. It facilitates collaborative learning by allowing students to select topics, form teams, and participate in peer reviews. Recently, the platform has expanded to incorporate modern frontend technologies, with components being refactored to use Reac...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
==About Expertiza==&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza], an open-source project built on Ruby on Rails, serves as a versatile learning management platform, enabling instructors to design and customize assignments. It facilitates collaborative learning by allowing students to select topics, form teams, and participate in peer reviews. Recently, the platform has expanded to incorporate modern frontend technologies, with components being refactored to use React.js and Typescript. This upgrade enhances the user experience, making the interface more interactive and responsive while supporting submissions in multiple formats, including URLs and wiki pages, for seamless review and evaluation.&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=157246</id>
		<title>CSC/ECE 517 Fall 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2024&amp;diff=157246"/>
		<updated>2024-10-28T03:40:34Z</updated>

		<summary type="html">&lt;p&gt;Vshetty2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2024 - E2454. Refactor student_task.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2466. UI for Impersonate User]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2456. Refactor teams_user.rb]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2024 - E2465. UI for Institutions and Notification]]&lt;/div&gt;</summary>
		<author><name>Vshetty2</name></author>
	</entry>
</feed>