<?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=Kmalick</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=Kmalick"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Kmalick"/>
	<updated>2026-06-27T19:40:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=MainPage&amp;diff=152963</id>
		<title>MainPage</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=MainPage&amp;diff=152963"/>
		<updated>2024-03-18T21:01:49Z</updated>

		<summary type="html">&lt;p&gt;Kmalick: /* Expertiza */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
* [[Expertiza documentation]]&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Summer 2008]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2010]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2011]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2012]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2013]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2014]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2015]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2016]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2014]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2015]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2016]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2017]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2017]]&lt;br /&gt;
* [[CSC/Independent Study Spring 2018]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2018]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2019]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2019]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2020]]&lt;br /&gt;
* [[CSC/ECE 517 Summer 2020]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2020]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2021]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2022]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2023]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2023]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2024]]&lt;br /&gt;
* [[CSC 456 Spring 2011|CSC 456 Spring 2012]]&lt;br /&gt;
* [[ECE 633]]&lt;br /&gt;
* [[KCU]]&lt;br /&gt;
* [[Progress reports]]&lt;br /&gt;
* [[ReactJs Frontend]]&lt;br /&gt;
* [[Front-End/Back-End]]&lt;br /&gt;
&lt;br /&gt;
==Application Behavior==&lt;br /&gt;
* [[Grading]]&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming==&lt;br /&gt;
* [[CSC/ECE_517_Spring_2013/ch1b_1k_hf|Lecture on Metaprogramming]]&lt;br /&gt;
&lt;br /&gt;
==Development==&lt;br /&gt;
&lt;br /&gt;
''Expertiza now has a Java dependency, so the machine you are using to develop Expertiza on should have the JVM installed.''&lt;br /&gt;
&lt;br /&gt;
* [[Setting Up a Development Machine]]&lt;br /&gt;
* [[Creating a Linux Development Environment for Expertiza - Installation Guide]]&lt;br /&gt;
* [[Using git and github for projects]]&lt;br /&gt;
* [[Using heroku to deploy your projects]]&lt;br /&gt;
* [[How to Begin a Project from the Current Expertiza Repository]]&lt;br /&gt;
* [[Git]]&lt;br /&gt;
* [[How to Change a User's Password on a Development Machine]]&lt;br /&gt;
* [[Debugging Rails]]&lt;br /&gt;
* [http://rajanalwan.com/ui_guidelines/ Design Template]&lt;br /&gt;
&lt;br /&gt;
==Production==&lt;br /&gt;
* [[Deploying to Production]]&lt;br /&gt;
* [[Downloading Production Data]]&lt;br /&gt;
* [[Accessing the Production Server]]&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
* [[Using Cucumber with Expertiza]]&lt;br /&gt;
* [[Rails Testing Overview]]&lt;br /&gt;
* [[Expertiza Continuous Integration]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [[Object-Oriented Design and Programming]]&lt;/div&gt;</summary>
		<author><name>Kmalick</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151616</id>
		<title>CSC/ECE 517 Fall 2023 - E2386. Reimplement teams users backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151616"/>
		<updated>2023-11-16T02:41:03Z</updated>

		<summary type="html">&lt;p&gt;Kmalick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Description of Project===&lt;br /&gt;
&lt;br /&gt;
The focal point of the project is the teams_user model, capturing information about mentors, team members, and affiliations with other models such as Users and Teams. This model undertakes various responsibilities, including the formation of teams with enrolled students and the display of team members. Oversight of team management falls under the purview of the teams_user_controller, which orchestrates CRUD operations on the teams_user model. Its duties span the creation, modification, and deletion of teams, along with the administration of team members through additions or removals. Furthermore, the controller provides a list of mentors associated with teams_users.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The project involves creating a backend system for seamless CRUD operations on a relational database, specifically focusing on interactions between teams and users. This requires defining &amp;quot;teams_users&amp;quot; model with suitable attributes and relationships, establishing controllers to manage CRUD actions, and setting up corresponding routes. Emphasis is placed on rigorous testing, covering model validations and associations, as well as controller actions to ensure accurate execution of CRUD operations. A key project aspect involves refining code to produce precise JSON responses. Adhering to RESTful conventions, the re-implementation includes appropriate HTTP response codes. RSpec tests are mandatory for both the teams_users model and TeamUsersController, covering all endpoints and incorporating HTTP response codes. These controller tests are designed to integrate seamlessly with RSwag for generating API documentation and testing REST APIs through the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
===Objectives===&lt;br /&gt;
&lt;br /&gt;
*Craft RESTful endpoints for creating, displaying, and deleting invitations, along with approving new invitations. Additionally, provide functionality for listing pending invitations, creating new invitations, and notifying students about newly formed team invitations.&lt;br /&gt;
&lt;br /&gt;
*Develop and integrate methods within the teams_users_controller to facilitate invitation-related operations, including creating, accepting, declining, and canceling invitations. Ensure thorough checks of user and team statuses before initiating or accepting invitations.&lt;br /&gt;
&lt;br /&gt;
*Establish a user-invitation system that empowers invited users to accept, decline, or cancel invitations, triggering corresponding updates to the associated teams_user records. This should seamlessly manage the addition or removal of users from teams.&lt;br /&gt;
&lt;br /&gt;
*Implement an email notification system within the user-invitation framework, sending email notifications to invited users upon the issuance of new invitations.&lt;br /&gt;
&lt;br /&gt;
*Enforce the use of proper status codes and robust validation mechanisms for all RESTful endpoints.&lt;br /&gt;
&lt;br /&gt;
*Construct models and controllers for the teams_user model, incorporating contemporary approaches to writing Ruby code. This involves leveraging language features and adhering to best practices for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
*Compose comprehensive RSpec tests covering all APIs, models, and controllers to ensure the robustness and reliability of the entire system.&lt;br /&gt;
&lt;br /&gt;
===Development Strategy===&lt;br /&gt;
&lt;br /&gt;
Our development strategy adheres to the principles of Test-Driven Development (TDD) for the implementation of both the Invitation model and the Invitation Controller. The process begins with the creation of a failing test case, followed by the addition of code to address the identified issues and ensure the successful passage of the test.&lt;br /&gt;
&lt;br /&gt;
Furthermore, we align with the Rails philosophy of &amp;quot;Fat models,&amp;quot; aiming to migrate substantial business logic from the controller to the model. This approach is intended to maintain a clean and organized controller codebase while promoting code reusability throughout the application.&lt;br /&gt;
&lt;br /&gt;
===Project Design and Implementation===&lt;br /&gt;
&lt;br /&gt;
Considering the existing functionality of the teams_user model and controller, we have outlined a set of RESTful endpoints along with their corresponding request types for implementation. In the controller, we plan to adopt the Strategy Pattern, leveraging its ability to encapsulate controller actions and facilitate easy extensibility and usability. This pattern will enable a structured approach to defining and managing the various operations the controller can perform.&lt;br /&gt;
&lt;br /&gt;
==== Functionality ====&lt;br /&gt;
In this project, we aim to add functions for the following:&lt;br /&gt;
&lt;br /&gt;
1. Retrieve and display team members.&lt;br /&gt;
&lt;br /&gt;
2. Add a new team member with checks for user existence and team limits.&lt;br /&gt;
&lt;br /&gt;
3. Delete a specific team member.&lt;br /&gt;
&lt;br /&gt;
4. Delete multiple selected team members based on item IDs.&lt;br /&gt;
&lt;br /&gt;
5. Autocomplete functionality for user names within a team.&lt;br /&gt;
&lt;br /&gt;
6. Updating duties of a team member.&lt;br /&gt;
&lt;br /&gt;
===Code Snippets===&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
The `TeamsUser` model in the Expertiza code represents a user's association with a team within the context of a collaborative assignment or project. It utilizes ActiveRecord associations to establish relationships with the `User` and `Team` models, indicating that a user belongs to a team. The model includes methods for deleting a team user, retrieving team members, removing a user from a team, checking if a team is empty, and adding a member to an invited team based on certain conditions. Additionally, there's a method for determining the team ID associated with a user in a specific assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class TeamsUser &amp;lt; ApplicationRecord&lt;br /&gt;
  belongs_to :user&lt;br /&gt;
  belongs_to :team&lt;br /&gt;
  has_one :team_user_node, foreign_key: 'node_object_id', dependent: :destroy&lt;br /&gt;
  has_paper_trail&lt;br /&gt;
  # attr_accessible :user_id, :team_id # unnecessary protected attributes&lt;br /&gt;
&lt;br /&gt;
  def name(ip_address = nil)&lt;br /&gt;
    name = user.name(ip_address)&lt;br /&gt;
&lt;br /&gt;
    # E2115 Mentor Management&lt;br /&gt;
    # Indicate that someone is a Mentor in the UI. The view code is&lt;br /&gt;
    # often hard to follow, and this is the best place we could find&lt;br /&gt;
    # for this to go.&lt;br /&gt;
    name += ' (Mentor)' if MentorManagement.user_a_mentor?(user)&lt;br /&gt;
    name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete&lt;br /&gt;
    TeamUserNode.find_by(node_object_id: id).destroy&lt;br /&gt;
    team = self.team&lt;br /&gt;
    destroy&lt;br /&gt;
    team.delete if team.teams_users.empty?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def get_team_members(team_id); end&lt;br /&gt;
&lt;br /&gt;
  # Removes entry in the TeamUsers table for the given user and given team id&lt;br /&gt;
  def self.remove_team(user_id, team_id)&lt;br /&gt;
    team_user = TeamsUser.where('user_id = ? and team_id = ?', user_id, team_id).first&lt;br /&gt;
    team_user&amp;amp;.destroy&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Returns the first entry in the TeamUsers table for a given team id&lt;br /&gt;
  def self.first_by_team_id(team_id)&lt;br /&gt;
    TeamsUser.where('team_id = ?', team_id).first&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Determines whether a team is empty of not&lt;br /&gt;
  def self.team_empty?(team_id)&lt;br /&gt;
    team_members = TeamsUser.where('team_id = ?', team_id)&lt;br /&gt;
    team_members.blank?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Add member to the team they were invited to and accepted the invite for&lt;br /&gt;
  def self.add_member_to_invited_team(invitee_user_id, invited_user_id, assignment_id)&lt;br /&gt;
    can_add_member = false&lt;br /&gt;
    users_teams = TeamsUser.where(['user_id = ?', invitee_user_id])&lt;br /&gt;
    users_teams.each do |team|&lt;br /&gt;
      new_team = AssignmentTeam.where(['id = ? and parent_id = ?', team.team_id, assignment_id]).first&lt;br /&gt;
      unless new_team.nil?&lt;br /&gt;
        can_add_member = new_team.add_member(User.find(invited_user_id), assignment_id)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    can_add_member&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # 2015-5-27 [zhewei]:&lt;br /&gt;
  # We just remove the topic_id field from the participants table.&lt;br /&gt;
  def self.team_id(assignment_id, user_id)&lt;br /&gt;
    # team_id variable represents the team_id for this user in this assignment&lt;br /&gt;
    team_id = nil&lt;br /&gt;
    teams_users = TeamsUser.where(user_id: user_id)&lt;br /&gt;
    teams_users.each do |teams_user|&lt;br /&gt;
      if teams_user.team_id == nil&lt;br /&gt;
        next&lt;br /&gt;
      end&lt;br /&gt;
      team = Team.find(teams_user.team_id)&lt;br /&gt;
      if team.parent_id == assignment_id&lt;br /&gt;
        team_id = teams_user.team_id&lt;br /&gt;
        break&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    team_id&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Controller====&lt;br /&gt;
The `TeamsUsersController` handles various actions related to team management within the application. It includes methods for authorization checks, auto-completion of user names, updating team member duties, listing team members, creating new team members, deleting individual team members, and bulk deletion of selected team members. The controller also interacts with models such as `Team`, `Assignment`, `User`, and `TeamsUser` to manage teams, assignments, and users. Notably, the `create` method involves adding new team members, performing checks on user participation in assignments or courses, and triggering additional actions such as mentor assignments. The code emphasizes error handling and provides flash messages to communicate issues or successful operations to users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class TeamsUsersController &amp;lt; ApplicationController&lt;br /&gt;
  include AuthorizationHelper&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    # Allow duty updation for a team if current user is student, else require TA or above Privileges.&lt;br /&gt;
    if %w[update_duties].include? params[:action]&lt;br /&gt;
      current_user_has_student_privileges?&lt;br /&gt;
    else&lt;br /&gt;
      current_user_has_ta_privileges?&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def auto_complete_for_user_name&lt;br /&gt;
    team = Team.find(session[:team_id])&lt;br /&gt;
    @users = team.get_possible_team_members(params[:user][:name])&lt;br /&gt;
    render inline: &amp;quot;&amp;lt;%= auto_complete_result @users, 'name' %&amp;gt;&amp;quot;, layout: false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Example of duties: manager, designer, programmer, tester. Finds TeamsUser and save preferred Duty&lt;br /&gt;
  def update_duties&lt;br /&gt;
    team_user = TeamsUser.find(params[:teams_user_id])&lt;br /&gt;
    team_user.update_attribute(:duty_id, params[:teams_user]['duty_id'])&lt;br /&gt;
    redirect_to controller: 'student_teams', action: 'view', student_id: params[:participant_id]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def list&lt;br /&gt;
    @team = Team.find(params[:id])&lt;br /&gt;
    @assignment = Assignment.find(@team.parent_id)&lt;br /&gt;
    @teams_users = TeamsUser.page(params[:page]).per_page(10).where(['team_id = ?', params[:id]])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    @team = Team.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def create&lt;br /&gt;
    user = User.find_by(name: params[:user][:name].strip)&lt;br /&gt;
    unless user&lt;br /&gt;
      urlCreate = url_for controller: 'users', action: 'new'&lt;br /&gt;
      flash[:error] = &amp;quot;\&amp;quot;#{params[:user][:name].strip}\&amp;quot; is not defined. Please &amp;lt;a href=\&amp;quot;#{urlCreate}\&amp;quot;&amp;gt;create&amp;lt;/a&amp;gt; this user before continuing.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    unless user.nil?&lt;br /&gt;
      if team.is_a?(AssignmentTeam)&lt;br /&gt;
        assignment = Assignment.find(team.parent_id)&lt;br /&gt;
        if assignment.user_on_team?(user)&lt;br /&gt;
          flash[:error] = &amp;quot;This user is already assigned to a team for this assignment&amp;quot;&lt;br /&gt;
          redirect_back fallback_location: root_path&lt;br /&gt;
          return&lt;br /&gt;
        end&lt;br /&gt;
        if AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id).nil?&lt;br /&gt;
          urlAssignmentParticipantList = url_for controller: 'participants', action: 'list', id: assignment.id, model: 'Assignment', authorization: 'participant'&lt;br /&gt;
          flash[:error] = &amp;quot;\&amp;quot;#{user.name}\&amp;quot; is not a participant of the current assignment. Please &amp;lt;a href=\&amp;quot;#{urlAssignmentParticipantList}\&amp;quot;&amp;gt;add&amp;lt;/a&amp;gt; this user before continuing.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          begin&lt;br /&gt;
            add_member_return = team.add_member(user, team.parent_id)&lt;br /&gt;
          rescue&lt;br /&gt;
            flash[:error] = &amp;quot;The user #{user.name} is already a member of the team #{team.name}&amp;quot;&lt;br /&gt;
            redirect_back fallback_location: root_path&lt;br /&gt;
            return&lt;br /&gt;
          end&lt;br /&gt;
          flash[:error] = 'This team already has the maximum number of members.' if add_member_return == false&lt;br /&gt;
          # E2115 Mentor Management&lt;br /&gt;
          # Kick off the Mentor Management workflow&lt;br /&gt;
          # Note: this is _not_ supported for CourseTeams which is why the other&lt;br /&gt;
          # half of this if block does not include the same code&lt;br /&gt;
          if add_member_return&lt;br /&gt;
            user = TeamsUser.last&lt;br /&gt;
            undo_link(&amp;quot;The team @teams_user \&amp;quot;#{user.name}\&amp;quot; has been successfully added to \&amp;quot;#{team.name}\&amp;quot;.&amp;quot;)&lt;br /&gt;
            MentorManagement.assign_mentor(assignment.id, team.id)&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      else # CourseTeam&lt;br /&gt;
        course = Course.find(team.parent_id)&lt;br /&gt;
        if course.user_on_team?(user)&lt;br /&gt;
          flash[:error] = &amp;quot;This user is already assigned to a team for this course&amp;quot;&lt;br /&gt;
          redirect_back fallback_location: root_path&lt;br /&gt;
          return&lt;br /&gt;
        end&lt;br /&gt;
        if CourseParticipant.find_by(user_id: user.id, parent_id: course.id).nil?&lt;br /&gt;
          urlCourseParticipantList = url_for controller: 'participants', action: 'list', id: course.id, model: 'Course', authorization: 'participant'&lt;br /&gt;
          flash[:error] = &amp;quot;\&amp;quot;#{user.name}\&amp;quot; is not a participant of the current course. Please &amp;lt;a href=\&amp;quot;#{urlCourseParticipantList}\&amp;quot;&amp;gt;add&amp;lt;/a&amp;gt; this user before continuing.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          begin&lt;br /&gt;
            add_member_return = team.add_member(user, team.parent_id)&lt;br /&gt;
          rescue&lt;br /&gt;
            flash[:error] = &amp;quot;The user #{user.name} is already a member of the team #{team.name}&amp;quot;&lt;br /&gt;
            redirect_back fallback_location: root_path&lt;br /&gt;
            return&lt;br /&gt;
          end&lt;br /&gt;
          flash[:error] = 'This team already has the maximum number of members.' if add_member_return == false&lt;br /&gt;
          if add_member_return&lt;br /&gt;
            @teams_user = TeamsUser.last&lt;br /&gt;
            undo_link(&amp;quot;The team user \&amp;quot;#{user.name}\&amp;quot; has been successfully added to \&amp;quot;#{team.name}\&amp;quot;.&amp;quot;)&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to controller: 'teams', action: 'list', id: team.parent_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete&lt;br /&gt;
    @teams_user = TeamsUser.find(params[:id])&lt;br /&gt;
    parent_id = Team.find(@teams_user.team_id).parent_id&lt;br /&gt;
    @user = User.find(@teams_user.user_id)&lt;br /&gt;
    @teams_user.destroy&lt;br /&gt;
    undo_link(&amp;quot;The team user \&amp;quot;#{@user.name}\&amp;quot; has been successfully removed. &amp;quot;)&lt;br /&gt;
    redirect_to controller: 'teams', action: 'list', id: parent_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete_selected&lt;br /&gt;
    params[:item].each do |item_id|&lt;br /&gt;
      team_user = TeamsUser.find(item_id).first&lt;br /&gt;
      team_user.destroy&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'list', id: params[:id]&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Schema====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  create_table &amp;quot;teams_users&amp;quot;, id: :integer, force: :cascade, options: &amp;quot;ENGINE=InnoDB DEFAULT CHARSET=latin1&amp;quot; do |t|&lt;br /&gt;
    t.integer &amp;quot;team_id&amp;quot;&lt;br /&gt;
    t.integer &amp;quot;user_id&amp;quot;&lt;br /&gt;
    t.integer &amp;quot;duty_id&amp;quot;&lt;br /&gt;
    t.string &amp;quot;pair_programming_status&amp;quot;, limit: 1&lt;br /&gt;
    t.integer &amp;quot;participant_id&amp;quot;&lt;br /&gt;
    t.index [&amp;quot;duty_id&amp;quot;], name: &amp;quot;index_teams_participants_on_duty_id&amp;quot;&lt;br /&gt;
    t.index [&amp;quot;participant_id&amp;quot;], name: &amp;quot;fk_rails_f4d20198de&amp;quot;&lt;br /&gt;
    t.index [&amp;quot;team_id&amp;quot;], name: &amp;quot;fk_users_teams&amp;quot;&lt;br /&gt;
    t.index [&amp;quot;user_id&amp;quot;], name: &amp;quot;fk_teams_users&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing Plan===&lt;br /&gt;
The TeamsUsers model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of TeamsUsers model and controller we have defined the following test which are implemented to test the reimplemented code of teams_users model and controller.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if `#update_duties` updates duties for a participant successfully and redirects to '/student_teams/view?student_id=1'.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if `#list` renders the list of users under Assignment team teams#users.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if `#new` sets the Team object to an instance variable.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if `#create` (User Not Defined) throws an error and redirects to 'http://test.host/teams/list?id=1' when a user is not defined.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if `#create` (User Not a Participant) throws an error and redirects to 'http://test.host/teams/list?id=1' when the user added is not a participant of the current assignment.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if `#create` (Assignment Team Full) throws an error 'This team already has the maximum number of members.' and redirects to 'http://test.host/teams/list?id=1'.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if `#create` (User Successfully Added) new user gets successfully added to the assignment and redirects to 'http://test.host/teams/list?id=1'.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if `#delete` deletes a user and redirects to 'http://test.host/teams/list?id=1'.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if `#delete_selected` deletes selected users and redirects to 'http://test.host/teams_users/list'.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relevant Links===&lt;br /&gt;
Github Repository: https://github.com/Kashika08/reimplementation-back-end&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
*Jay Shah (github: jayjshah2000)&lt;br /&gt;
&lt;br /&gt;
*Kashika Malick (github: kashika08)&lt;br /&gt;
&lt;br /&gt;
*Riya Gori (github: riyagori1203)&lt;br /&gt;
&lt;br /&gt;
===Mentor===&lt;br /&gt;
Kartiki Bhandakkar&lt;/div&gt;</summary>
		<author><name>Kmalick</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151607</id>
		<title>CSC/ECE 517 Fall 2023 - E2386. Reimplement teams users backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151607"/>
		<updated>2023-11-16T02:36:26Z</updated>

		<summary type="html">&lt;p&gt;Kmalick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Description of Project===&lt;br /&gt;
&lt;br /&gt;
The focal point of the project is the teams_user model, capturing information about mentors, team members, and affiliations with other models such as Users and Teams. This model undertakes various responsibilities, including the formation of teams with enrolled students and the display of team members. Oversight of team management falls under the purview of the teams_user_controller, which orchestrates CRUD operations on the teams_user model. Its duties span the creation, modification, and deletion of teams, along with the administration of team members through additions or removals. Furthermore, the controller provides a list of mentors associated with teams_users.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The project involves creating a backend system for seamless CRUD operations on a relational database, specifically focusing on interactions between teams and users. This requires defining &amp;quot;teams_users&amp;quot; model with suitable attributes and relationships, establishing controllers to manage CRUD actions, and setting up corresponding routes. Emphasis is placed on rigorous testing, covering model validations and associations, as well as controller actions to ensure accurate execution of CRUD operations. A key project aspect involves refining code to produce precise JSON responses. Adhering to RESTful conventions, the re-implementation includes appropriate HTTP response codes. RSpec tests are mandatory for both the teams_Users model and TeamUsersController, covering all endpoints and incorporating HTTP response codes. These controller tests are designed to integrate seamlessly with RSwag for generating API documentation and testing REST APIs through the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
===Objectives===&lt;br /&gt;
&lt;br /&gt;
*Craft RESTful endpoints for creating, displaying, and deleting invitations, along with approving new invitations. Additionally, provide functionality for listing pending invitations, creating new invitations, and notifying students about newly formed team invitations.&lt;br /&gt;
&lt;br /&gt;
*Develop and integrate methods within the teams_users_controller to facilitate invitation-related operations, including creating, accepting, declining, and canceling invitations. Ensure thorough checks of user and team statuses before initiating or accepting invitations.&lt;br /&gt;
&lt;br /&gt;
*Establish a user-invitation system that empowers invited users to accept, decline, or cancel invitations, triggering corresponding updates to the associated teams_user records. This should seamlessly manage the addition or removal of users from teams.&lt;br /&gt;
&lt;br /&gt;
*Implement an email notification system within the user-invitation framework, sending email notifications to invited users upon the issuance of new invitations.&lt;br /&gt;
&lt;br /&gt;
*Enforce the use of proper status codes and robust validation mechanisms for all RESTful endpoints.&lt;br /&gt;
&lt;br /&gt;
*Construct models and controllers for the teams_user model, incorporating contemporary approaches to writing Ruby code. This involves leveraging language features and adhering to best practices for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
*Compose comprehensive RSpec tests covering all APIs, models, and controllers to ensure the robustness and reliability of the entire system.&lt;br /&gt;
&lt;br /&gt;
===Development Strategy===&lt;br /&gt;
&lt;br /&gt;
Our development strategy adheres to the principles of Test-Driven Development (TDD) for the implementation of both the Invitation model and the Invitation Controller. The process begins with the creation of a failing test case, followed by the addition of code to address the identified issues and ensure the successful passage of the test.&lt;br /&gt;
&lt;br /&gt;
Furthermore, we align with the Rails philosophy of &amp;quot;Fat models,&amp;quot; aiming to migrate substantial business logic from the controller to the model. This approach is intended to maintain a clean and organized controller codebase while promoting code reusability throughout the application.&lt;br /&gt;
&lt;br /&gt;
===Project Design and Implementation===&lt;br /&gt;
&lt;br /&gt;
Considering the existing functionality of the teams_user model and controller, we have outlined a set of RESTful endpoints along with their corresponding request types for implementation. In the controller, we plan to adopt the Strategy Pattern, leveraging its ability to encapsulate controller actions and facilitate easy extensibility and usability. This pattern will enable a structured approach to defining and managing the various operations the controller can perform.&lt;br /&gt;
&lt;br /&gt;
==== Functionality ====&lt;br /&gt;
In this project, we aim to add functions for the following:&lt;br /&gt;
&lt;br /&gt;
1. Retrieve and display team members.&lt;br /&gt;
&lt;br /&gt;
2. Add a new team member with checks for user existence and team limits.&lt;br /&gt;
&lt;br /&gt;
3. Delete a specific team member.&lt;br /&gt;
&lt;br /&gt;
4. Delete multiple selected team members based on item IDs.&lt;br /&gt;
&lt;br /&gt;
5. Autocomplete functionality for user names within a team.&lt;br /&gt;
&lt;br /&gt;
6. Updating duties of a team member.&lt;br /&gt;
&lt;br /&gt;
===Code Snippets===&lt;br /&gt;
&lt;br /&gt;
====Model====&lt;br /&gt;
The `TeamsUser` model in the Expertiza code represents a user's association with a team within the context of a collaborative assignment or project. It utilizes ActiveRecord associations to establish relationships with the `User` and `Team` models, indicating that a user belongs to a team. The model includes methods for deleting a team user, retrieving team members, removing a user from a team, checking if a team is empty, and adding a member to an invited team based on certain conditions. Additionally, there's a method for determining the team ID associated with a user in a specific assignment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class TeamsUser &amp;lt; ApplicationRecord&lt;br /&gt;
  belongs_to :user&lt;br /&gt;
  belongs_to :team&lt;br /&gt;
  has_one :team_user_node, foreign_key: 'node_object_id', dependent: :destroy&lt;br /&gt;
  has_paper_trail&lt;br /&gt;
  # attr_accessible :user_id, :team_id # unnecessary protected attributes&lt;br /&gt;
&lt;br /&gt;
  def name(ip_address = nil)&lt;br /&gt;
    name = user.name(ip_address)&lt;br /&gt;
&lt;br /&gt;
    # E2115 Mentor Management&lt;br /&gt;
    # Indicate that someone is a Mentor in the UI. The view code is&lt;br /&gt;
    # often hard to follow, and this is the best place we could find&lt;br /&gt;
    # for this to go.&lt;br /&gt;
    name += ' (Mentor)' if MentorManagement.user_a_mentor?(user)&lt;br /&gt;
    name&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete&lt;br /&gt;
    TeamUserNode.find_by(node_object_id: id).destroy&lt;br /&gt;
    team = self.team&lt;br /&gt;
    destroy&lt;br /&gt;
    team.delete if team.teams_users.empty?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def get_team_members(team_id); end&lt;br /&gt;
&lt;br /&gt;
  # Removes entry in the TeamUsers table for the given user and given team id&lt;br /&gt;
  def self.remove_team(user_id, team_id)&lt;br /&gt;
    team_user = TeamsUser.where('user_id = ? and team_id = ?', user_id, team_id).first&lt;br /&gt;
    team_user&amp;amp;.destroy&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Returns the first entry in the TeamUsers table for a given team id&lt;br /&gt;
  def self.first_by_team_id(team_id)&lt;br /&gt;
    TeamsUser.where('team_id = ?', team_id).first&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Determines whether a team is empty of not&lt;br /&gt;
  def self.team_empty?(team_id)&lt;br /&gt;
    team_members = TeamsUser.where('team_id = ?', team_id)&lt;br /&gt;
    team_members.blank?&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Add member to the team they were invited to and accepted the invite for&lt;br /&gt;
  def self.add_member_to_invited_team(invitee_user_id, invited_user_id, assignment_id)&lt;br /&gt;
    can_add_member = false&lt;br /&gt;
    users_teams = TeamsUser.where(['user_id = ?', invitee_user_id])&lt;br /&gt;
    users_teams.each do |team|&lt;br /&gt;
      new_team = AssignmentTeam.where(['id = ? and parent_id = ?', team.team_id, assignment_id]).first&lt;br /&gt;
      unless new_team.nil?&lt;br /&gt;
        can_add_member = new_team.add_member(User.find(invited_user_id), assignment_id)&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    can_add_member&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # 2015-5-27 [zhewei]:&lt;br /&gt;
  # We just remove the topic_id field from the participants table.&lt;br /&gt;
  def self.team_id(assignment_id, user_id)&lt;br /&gt;
    # team_id variable represents the team_id for this user in this assignment&lt;br /&gt;
    team_id = nil&lt;br /&gt;
    teams_users = TeamsUser.where(user_id: user_id)&lt;br /&gt;
    teams_users.each do |teams_user|&lt;br /&gt;
      if teams_user.team_id == nil&lt;br /&gt;
        next&lt;br /&gt;
      end&lt;br /&gt;
      team = Team.find(teams_user.team_id)&lt;br /&gt;
      if team.parent_id == assignment_id&lt;br /&gt;
        team_id = teams_user.team_id&lt;br /&gt;
        break&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    team_id&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Controller====&lt;br /&gt;
The `TeamsUsersController` handles various actions related to team management within the application. It includes methods for authorization checks, auto-completion of user names, updating team member duties, listing team members, creating new team members, deleting individual team members, and bulk deletion of selected team members. The controller also interacts with models such as `Team`, `Assignment`, `User`, and `TeamsUser` to manage teams, assignments, and users. Notably, the `create` method involves adding new team members, performing checks on user participation in assignments or courses, and triggering additional actions such as mentor assignments. The code emphasizes error handling and provides flash messages to communicate issues or successful operations to users.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class TeamsUsersController &amp;lt; ApplicationController&lt;br /&gt;
  include AuthorizationHelper&lt;br /&gt;
&lt;br /&gt;
  def action_allowed?&lt;br /&gt;
    # Allow duty updation for a team if current user is student, else require TA or above Privileges.&lt;br /&gt;
    if %w[update_duties].include? params[:action]&lt;br /&gt;
      current_user_has_student_privileges?&lt;br /&gt;
    else&lt;br /&gt;
      current_user_has_ta_privileges?&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def auto_complete_for_user_name&lt;br /&gt;
    team = Team.find(session[:team_id])&lt;br /&gt;
    @users = team.get_possible_team_members(params[:user][:name])&lt;br /&gt;
    render inline: &amp;quot;&amp;lt;%= auto_complete_result @users, 'name' %&amp;gt;&amp;quot;, layout: false&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  # Example of duties: manager, designer, programmer, tester. Finds TeamsUser and save preferred Duty&lt;br /&gt;
  def update_duties&lt;br /&gt;
    team_user = TeamsUser.find(params[:teams_user_id])&lt;br /&gt;
    team_user.update_attribute(:duty_id, params[:teams_user]['duty_id'])&lt;br /&gt;
    redirect_to controller: 'student_teams', action: 'view', student_id: params[:participant_id]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def list&lt;br /&gt;
    @team = Team.find(params[:id])&lt;br /&gt;
    @assignment = Assignment.find(@team.parent_id)&lt;br /&gt;
    @teams_users = TeamsUser.page(params[:page]).per_page(10).where(['team_id = ?', params[:id]])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def new&lt;br /&gt;
    @team = Team.find(params[:id])&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def create&lt;br /&gt;
    user = User.find_by(name: params[:user][:name].strip)&lt;br /&gt;
    unless user&lt;br /&gt;
      urlCreate = url_for controller: 'users', action: 'new'&lt;br /&gt;
      flash[:error] = &amp;quot;\&amp;quot;#{params[:user][:name].strip}\&amp;quot; is not defined. Please &amp;lt;a href=\&amp;quot;#{urlCreate}\&amp;quot;&amp;gt;create&amp;lt;/a&amp;gt; this user before continuing.&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    team = Team.find(params[:id])&lt;br /&gt;
    unless user.nil?&lt;br /&gt;
      if team.is_a?(AssignmentTeam)&lt;br /&gt;
        assignment = Assignment.find(team.parent_id)&lt;br /&gt;
        if assignment.user_on_team?(user)&lt;br /&gt;
          flash[:error] = &amp;quot;This user is already assigned to a team for this assignment&amp;quot;&lt;br /&gt;
          redirect_back fallback_location: root_path&lt;br /&gt;
          return&lt;br /&gt;
        end&lt;br /&gt;
        if AssignmentParticipant.find_by(user_id: user.id, parent_id: assignment.id).nil?&lt;br /&gt;
          urlAssignmentParticipantList = url_for controller: 'participants', action: 'list', id: assignment.id, model: 'Assignment', authorization: 'participant'&lt;br /&gt;
          flash[:error] = &amp;quot;\&amp;quot;#{user.name}\&amp;quot; is not a participant of the current assignment. Please &amp;lt;a href=\&amp;quot;#{urlAssignmentParticipantList}\&amp;quot;&amp;gt;add&amp;lt;/a&amp;gt; this user before continuing.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          begin&lt;br /&gt;
            add_member_return = team.add_member(user, team.parent_id)&lt;br /&gt;
          rescue&lt;br /&gt;
            flash[:error] = &amp;quot;The user #{user.name} is already a member of the team #{team.name}&amp;quot;&lt;br /&gt;
            redirect_back fallback_location: root_path&lt;br /&gt;
            return&lt;br /&gt;
          end&lt;br /&gt;
          flash[:error] = 'This team already has the maximum number of members.' if add_member_return == false&lt;br /&gt;
          # E2115 Mentor Management&lt;br /&gt;
          # Kick off the Mentor Management workflow&lt;br /&gt;
          # Note: this is _not_ supported for CourseTeams which is why the other&lt;br /&gt;
          # half of this if block does not include the same code&lt;br /&gt;
          if add_member_return&lt;br /&gt;
            user = TeamsUser.last&lt;br /&gt;
            undo_link(&amp;quot;The team @teams_user \&amp;quot;#{user.name}\&amp;quot; has been successfully added to \&amp;quot;#{team.name}\&amp;quot;.&amp;quot;)&lt;br /&gt;
            MentorManagement.assign_mentor(assignment.id, team.id)&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      else # CourseTeam&lt;br /&gt;
        course = Course.find(team.parent_id)&lt;br /&gt;
        if course.user_on_team?(user)&lt;br /&gt;
          flash[:error] = &amp;quot;This user is already assigned to a team for this course&amp;quot;&lt;br /&gt;
          redirect_back fallback_location: root_path&lt;br /&gt;
          return&lt;br /&gt;
        end&lt;br /&gt;
        if CourseParticipant.find_by(user_id: user.id, parent_id: course.id).nil?&lt;br /&gt;
          urlCourseParticipantList = url_for controller: 'participants', action: 'list', id: course.id, model: 'Course', authorization: 'participant'&lt;br /&gt;
          flash[:error] = &amp;quot;\&amp;quot;#{user.name}\&amp;quot; is not a participant of the current course. Please &amp;lt;a href=\&amp;quot;#{urlCourseParticipantList}\&amp;quot;&amp;gt;add&amp;lt;/a&amp;gt; this user before continuing.&amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
          begin&lt;br /&gt;
            add_member_return = team.add_member(user, team.parent_id)&lt;br /&gt;
          rescue&lt;br /&gt;
            flash[:error] = &amp;quot;The user #{user.name} is already a member of the team #{team.name}&amp;quot;&lt;br /&gt;
            redirect_back fallback_location: root_path&lt;br /&gt;
            return&lt;br /&gt;
          end&lt;br /&gt;
          flash[:error] = 'This team already has the maximum number of members.' if add_member_return == false&lt;br /&gt;
          if add_member_return&lt;br /&gt;
            @teams_user = TeamsUser.last&lt;br /&gt;
            undo_link(&amp;quot;The team user \&amp;quot;#{user.name}\&amp;quot; has been successfully added to \&amp;quot;#{team.name}\&amp;quot;.&amp;quot;)&lt;br /&gt;
          end&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to controller: 'teams', action: 'list', id: team.parent_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete&lt;br /&gt;
    @teams_user = TeamsUser.find(params[:id])&lt;br /&gt;
    parent_id = Team.find(@teams_user.team_id).parent_id&lt;br /&gt;
    @user = User.find(@teams_user.user_id)&lt;br /&gt;
    @teams_user.destroy&lt;br /&gt;
    undo_link(&amp;quot;The team user \&amp;quot;#{@user.name}\&amp;quot; has been successfully removed. &amp;quot;)&lt;br /&gt;
    redirect_to controller: 'teams', action: 'list', id: parent_id&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def delete_selected&lt;br /&gt;
    params[:item].each do |item_id|&lt;br /&gt;
      team_user = TeamsUser.find(item_id).first&lt;br /&gt;
      team_user.destroy&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    redirect_to action: 'list', id: params[:id]&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Testing Plan===&lt;br /&gt;
The TeamsUsers model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of TeamsUsers model and controller we have defined the following test which are implemented to test the reimplemented code of teams_users model and controller.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if `#update_duties` updates duties for a participant successfully and redirects to '/student_teams/view?student_id=1'.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if `#list` renders the list of users under Assignment team teams#users.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if `#new` sets the Team object to an instance variable.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if `#create` (User Not Defined) throws an error and redirects to 'http://test.host/teams/list?id=1' when a user is not defined.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if `#create` (User Not a Participant) throws an error and redirects to 'http://test.host/teams/list?id=1' when the user added is not a participant of the current assignment.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if `#create` (Assignment Team Full) throws an error 'This team already has the maximum number of members.' and redirects to 'http://test.host/teams/list?id=1'.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if `#create` (User Successfully Added) new user gets successfully added to the assignment and redirects to 'http://test.host/teams/list?id=1'.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if `#delete` deletes a user and redirects to 'http://test.host/teams/list?id=1'.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if `#delete_selected` deletes selected users and redirects to 'http://test.host/teams_users/list'.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relevant Links===&lt;br /&gt;
Github Repository: https://github.com/Kashika08/reimplementation-back-end&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
*Jay Shah (github: jayjshah2000)&lt;br /&gt;
&lt;br /&gt;
*Kashika Malick (github: kashika08)&lt;br /&gt;
&lt;br /&gt;
*Riya Gori (github: riyagori1203)&lt;br /&gt;
&lt;br /&gt;
===Mentor===&lt;br /&gt;
Kartiki Bhandakkar&lt;/div&gt;</summary>
		<author><name>Kmalick</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151592</id>
		<title>CSC/ECE 517 Fall 2023 - E2386. Reimplement teams users backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151592"/>
		<updated>2023-11-16T02:26:14Z</updated>

		<summary type="html">&lt;p&gt;Kmalick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Description of Project===&lt;br /&gt;
&lt;br /&gt;
The focal point of the project is the Team_user model, capturing information about mentors, team members, and affiliations with other models such as Users and Teams. This model undertakes various responsibilities, including the formation of teams with enrolled students and the display of team members. Oversight of team management falls under the purview of the Team_user_controller, which orchestrates CRUD operations on the Team_user model. Its duties span the creation, modification, and deletion of teams, along with the administration of team members through additions or removals. Furthermore, the controller provides a list of mentors associated with Team_users.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The project involves creating a backend system for seamless CRUD operations on a relational database, specifically focusing on interactions between teams and users. This requires defining &amp;quot;Team_Users&amp;quot; model with suitable attributes and relationships, establishing controllers to manage CRUD actions, and setting up corresponding routes. Emphasis is placed on rigorous testing, covering model validations and associations, as well as controller actions to ensure accurate execution of CRUD operations. A key project aspect involves refining code to produce precise JSON responses. Adhering to RESTful conventions, the re-implementation includes appropriate HTTP response codes. RSpec tests are mandatory for both the Team_Users model and TeamUsersController, covering all endpoints and incorporating HTTP response codes. These controller tests are designed to integrate seamlessly with RSwag for generating API documentation and testing REST APIs through the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
===Objectives===&lt;br /&gt;
&lt;br /&gt;
*Craft RESTful endpoints for creating, displaying, and deleting invitations, along with approving new invitations. Additionally, provide functionality for listing pending invitations, creating new invitations, and notifying students about newly formed team invitations.&lt;br /&gt;
&lt;br /&gt;
*Develop and integrate methods within the Team_usersController to facilitate invitation-related operations, including creating, accepting, declining, and canceling invitations. Ensure thorough checks of user and team statuses before initiating or accepting invitations.&lt;br /&gt;
&lt;br /&gt;
*Establish a user-invitation system that empowers invited users to accept, decline, or cancel invitations, triggering corresponding updates to the associated Team_user records. This should seamlessly manage the addition or removal of users from teams.&lt;br /&gt;
&lt;br /&gt;
*Implement an email notification system within the user-invitation framework, sending email notifications to invited users upon the issuance of new invitations.&lt;br /&gt;
&lt;br /&gt;
*Enforce the use of proper status codes and robust validation mechanisms for all RESTful endpoints.&lt;br /&gt;
&lt;br /&gt;
*Construct models and controllers for the Team_user model, incorporating contemporary approaches to writing Ruby code. This involves leveraging language features and adhering to best practices for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
*Compose comprehensive RSpec tests covering all APIs, models, and controllers to ensure the robustness and reliability of the entire system.&lt;br /&gt;
&lt;br /&gt;
===Development Strategy===&lt;br /&gt;
&lt;br /&gt;
Our development strategy adheres to the principles of Test-Driven Development (TDD) for the implementation of both the Invitation model and the Invitation Controller. The process begins with the creation of a failing test case, followed by the addition of code to address the identified issues and ensure the successful passage of the test.&lt;br /&gt;
&lt;br /&gt;
Furthermore, we align with the Rails philosophy of &amp;quot;Fat models,&amp;quot; aiming to migrate substantial business logic from the controller to the model. This approach is intended to maintain a clean and organized controller codebase while promoting code reusability throughout the application.&lt;br /&gt;
&lt;br /&gt;
===Project Design and Implementation===&lt;br /&gt;
&lt;br /&gt;
Considering the existing functionality of the Team_user model and controller, we have outlined a set of RESTful endpoints along with their corresponding request types for implementation. In the controller, we plan to adopt the Strategy Pattern, leveraging its ability to encapsulate controller actions and facilitate easy extensibility and usability. This pattern will enable a structured approach to defining and managing the various operations the controller can perform.&lt;br /&gt;
&lt;br /&gt;
==== Functionality ====&lt;br /&gt;
In this project, we aim to add functions for the following:&lt;br /&gt;
&lt;br /&gt;
1. Retrieve and display team members.&lt;br /&gt;
&lt;br /&gt;
2. Add a new team member with checks for user existence and team limits.&lt;br /&gt;
&lt;br /&gt;
3. Delete a specific team member.&lt;br /&gt;
&lt;br /&gt;
4. Delete multiple selected team members based on item IDs.&lt;br /&gt;
&lt;br /&gt;
5. Autocomplete functionality for user names within a team.&lt;br /&gt;
&lt;br /&gt;
6. Updating duties of a team member.&lt;br /&gt;
&lt;br /&gt;
===Testing Plan===&lt;br /&gt;
The TeamsUsers model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of TeamsUsers model and controller we have defined the following test which are implemented to test the reimplemented code of teams_users model and controller.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin-left:40px&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Test No. !! Description &lt;br /&gt;
|-&lt;br /&gt;
| 1 || Tests if `#update_duties` updates duties for a participant successfully and redirects to '/student_teams/view?student_id=1'.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || Tests if `#list` renders the list of users under Assignment team teams#users.&lt;br /&gt;
|-&lt;br /&gt;
| 3 || Tests if `#new` sets the Team object to an instance variable.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Tests if `#create` (User Not Defined) throws an error and redirects to 'http://test.host/teams/list?id=1' when a user is not defined.&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Tests if `#create` (User Not a Participant) throws an error and redirects to 'http://test.host/teams/list?id=1' when the user added is not a participant of the current assignment.&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Tests if `#create` (Assignment Team Full) throws an error 'This team already has the maximum number of members.' and redirects to 'http://test.host/teams/list?id=1'.&lt;br /&gt;
|-&lt;br /&gt;
| 7 || Tests if `#create` (User Successfully Added) new user gets successfully added to the assignment and redirects to 'http://test.host/teams/list?id=1'.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Tests if `#delete` deletes a user and redirects to 'http://test.host/teams/list?id=1'.&lt;br /&gt;
|-&lt;br /&gt;
| 9 || Tests if `#delete_selected` deletes selected users and redirects to 'http://test.host/teams_users/list'.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relevant Links===&lt;br /&gt;
Github Repository: https://github.com/Kashika08/reimplementation-back-end&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
*Jay Shah (github: jayjshah2000)&lt;br /&gt;
&lt;br /&gt;
*Kashika Malick (github: kashika08)&lt;br /&gt;
&lt;br /&gt;
*Riya Gori (github: riyagori1203)&lt;br /&gt;
&lt;br /&gt;
===Mentor===&lt;br /&gt;
Kartiki Bhandakkar&lt;/div&gt;</summary>
		<author><name>Kmalick</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151588</id>
		<title>CSC/ECE 517 Fall 2023 - E2386. Reimplement teams users backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151588"/>
		<updated>2023-11-16T02:23:46Z</updated>

		<summary type="html">&lt;p&gt;Kmalick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Description of Project===&lt;br /&gt;
&lt;br /&gt;
The focal point of the project is the Team_user model, capturing information about mentors, team members, and affiliations with other models such as Users and Teams. This model undertakes various responsibilities, including the formation of teams with enrolled students and the display of team members. Oversight of team management falls under the purview of the Team_user_controller, which orchestrates CRUD operations on the Team_user model. Its duties span the creation, modification, and deletion of teams, along with the administration of team members through additions or removals. Furthermore, the controller provides a list of mentors associated with Team_users.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The project involves creating a backend system for seamless CRUD operations on a relational database, specifically focusing on interactions between teams and users. This requires defining &amp;quot;Team_Users&amp;quot; model with suitable attributes and relationships, establishing controllers to manage CRUD actions, and setting up corresponding routes. Emphasis is placed on rigorous testing, covering model validations and associations, as well as controller actions to ensure accurate execution of CRUD operations. A key project aspect involves refining code to produce precise JSON responses. Adhering to RESTful conventions, the re-implementation includes appropriate HTTP response codes. RSpec tests are mandatory for both the Team_Users model and TeamUsersController, covering all endpoints and incorporating HTTP response codes. These controller tests are designed to integrate seamlessly with RSwag for generating API documentation and testing REST APIs through the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
===Objectives===&lt;br /&gt;
&lt;br /&gt;
*Craft RESTful endpoints for creating, displaying, and deleting invitations, along with approving new invitations. Additionally, provide functionality for listing pending invitations, creating new invitations, and notifying students about newly formed team invitations.&lt;br /&gt;
&lt;br /&gt;
*Develop and integrate methods within the Team_usersController to facilitate invitation-related operations, including creating, accepting, declining, and canceling invitations. Ensure thorough checks of user and team statuses before initiating or accepting invitations.&lt;br /&gt;
&lt;br /&gt;
*Establish a user-invitation system that empowers invited users to accept, decline, or cancel invitations, triggering corresponding updates to the associated Team_user records. This should seamlessly manage the addition or removal of users from teams.&lt;br /&gt;
&lt;br /&gt;
*Implement an email notification system within the user-invitation framework, sending email notifications to invited users upon the issuance of new invitations.&lt;br /&gt;
&lt;br /&gt;
*Enforce the use of proper status codes and robust validation mechanisms for all RESTful endpoints.&lt;br /&gt;
&lt;br /&gt;
*Construct models and controllers for the Team_user model, incorporating contemporary approaches to writing Ruby code. This involves leveraging language features and adhering to best practices for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
*Compose comprehensive RSpec tests covering all APIs, models, and controllers to ensure the robustness and reliability of the entire system.&lt;br /&gt;
&lt;br /&gt;
===Development Strategy===&lt;br /&gt;
&lt;br /&gt;
Our development strategy adheres to the principles of Test-Driven Development (TDD) for the implementation of both the Invitation model and the Invitation Controller. The process begins with the creation of a failing test case, followed by the addition of code to address the identified issues and ensure the successful passage of the test.&lt;br /&gt;
&lt;br /&gt;
Furthermore, we align with the Rails philosophy of &amp;quot;Fat models,&amp;quot; aiming to migrate substantial business logic from the controller to the model. This approach is intended to maintain a clean and organized controller codebase while promoting code reusability throughout the application.&lt;br /&gt;
&lt;br /&gt;
===Project Design and Implementation===&lt;br /&gt;
&lt;br /&gt;
Considering the existing functionality of the Team_user model and controller, we have outlined a set of RESTful endpoints along with their corresponding request types for implementation. In the controller, we plan to adopt the Strategy Pattern, leveraging its ability to encapsulate controller actions and facilitate easy extensibility and usability. This pattern will enable a structured approach to defining and managing the various operations the controller can perform.&lt;br /&gt;
&lt;br /&gt;
==== Functionality ====&lt;br /&gt;
In this project, we aim to add functions for the following:&lt;br /&gt;
&lt;br /&gt;
1. Retrieve and display team members.&lt;br /&gt;
&lt;br /&gt;
2. Add a new team member with checks for user existence and team limits.&lt;br /&gt;
&lt;br /&gt;
3. Delete a specific team member.&lt;br /&gt;
&lt;br /&gt;
4. Delete multiple selected team members based on item IDs.&lt;br /&gt;
&lt;br /&gt;
5. Autocomplete functionality for user names within a team.&lt;br /&gt;
&lt;br /&gt;
6. Updating duties of a team member.&lt;br /&gt;
&lt;br /&gt;
===Testing Plan===&lt;br /&gt;
The TeamsUsers model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of TeamsUsers model and controller we have defined the following test which are implemented to test the reimplemented code of teams_users model and controller.&lt;br /&gt;
&lt;br /&gt;
|| Sr No || Test || Description ||&lt;br /&gt;
| 1 | `#update_duties` | Updates duties for a participant successfully and redirects to '/student_teams/view?student_id=1'. |&lt;br /&gt;
| 2 | `#list` | Renders the list of users under Assignment team teams#users. |&lt;br /&gt;
| 3 | `#new` | Sets the Team object to an instance variable. |&lt;br /&gt;
| 4 | `#create` (User Not Defined) | Throws an error and redirects to 'http://test.host/teams/list?id=1' when a user is not defined. |&lt;br /&gt;
| 5 | `#create` (User Not a Participant) | Throws an error and redirects to 'http://test.host/teams/list?id=1' when the user added is not a participant of the current assignment. |&lt;br /&gt;
| 6 | `#create` (Assignment Team Full) | Throws an error 'This team already has the maximum number of members.' and redirects to 'http://test.host/teams/list?id=1'. |&lt;br /&gt;
| 7 | `#create` (User Successfully Added) | New user gets successfully added to the assignment and redirects to 'http://test.host/teams/list?id=1'. |&lt;br /&gt;
| 8 | `#delete` | Deletes a user and redirects to 'http://test.host/teams/list?id=1'. |&lt;br /&gt;
| 9 | `#delete_selected` | Deletes selected users and redirects to 'http://test.host/teams_users/list'. |&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Relevant Links===&lt;br /&gt;
Github Repository: https://github.com/Kashika08/reimplementation-back-end&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
*Jay Shah (github: jayjshah2000)&lt;br /&gt;
&lt;br /&gt;
*Kashika Malick (github: kashika08)&lt;br /&gt;
&lt;br /&gt;
*Riya Gori (github: riyagori1203)&lt;br /&gt;
&lt;br /&gt;
===Mentor===&lt;br /&gt;
Kartiki Bhandakkar&lt;/div&gt;</summary>
		<author><name>Kmalick</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151508</id>
		<title>CSC/ECE 517 Fall 2023 - E2386. Reimplement teams users backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151508"/>
		<updated>2023-11-16T00:02:33Z</updated>

		<summary type="html">&lt;p&gt;Kmalick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Description of Project===&lt;br /&gt;
&lt;br /&gt;
The focal point of the project is the Team_user model, capturing information about mentors, team members, and affiliations with other models such as Users and Teams. This model undertakes various responsibilities, including the formation of teams with enrolled students and the display of team members. Oversight of team management falls under the purview of the Team_user_controller, which orchestrates CRUD operations on the Team_user model. Its duties span the creation, modification, and deletion of teams, along with the administration of team members through additions or removals. Furthermore, the controller provides a list of mentors associated with Team_users.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The project involves creating a backend system for seamless CRUD operations on a relational database, specifically focusing on interactions between teams and users. This requires defining &amp;quot;Team_Users&amp;quot; model with suitable attributes and relationships, establishing controllers to manage CRUD actions, and setting up corresponding routes. Emphasis is placed on rigorous testing, covering model validations and associations, as well as controller actions to ensure accurate execution of CRUD operations. A key project aspect involves refining code to produce precise JSON responses. Adhering to RESTful conventions, the re-implementation includes appropriate HTTP response codes. RSpec tests are mandatory for both the Team_Users model and TeamUsersController, covering all endpoints and incorporating HTTP response codes. These controller tests are designed to integrate seamlessly with RSwag for generating API documentation and testing REST APIs through the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
===Objectives===&lt;br /&gt;
&lt;br /&gt;
*Craft RESTful endpoints for creating, displaying, and deleting invitations, along with approving new invitations. Additionally, provide functionality for listing pending invitations, creating new invitations, and notifying students about newly formed team invitations.&lt;br /&gt;
&lt;br /&gt;
*Develop and integrate methods within the Team_usersController to facilitate invitation-related operations, including creating, accepting, declining, and canceling invitations. Ensure thorough checks of user and team statuses before initiating or accepting invitations.&lt;br /&gt;
&lt;br /&gt;
*Establish a user-invitation system that empowers invited users to accept, decline, or cancel invitations, triggering corresponding updates to the associated Team_user records. This should seamlessly manage the addition or removal of users from teams.&lt;br /&gt;
&lt;br /&gt;
*Implement an email notification system within the user-invitation framework, sending email notifications to invited users upon the issuance of new invitations.&lt;br /&gt;
&lt;br /&gt;
*Enforce the use of proper status codes and robust validation mechanisms for all RESTful endpoints.&lt;br /&gt;
&lt;br /&gt;
*Construct models and controllers for the Team_user model, incorporating contemporary approaches to writing Ruby code. This involves leveraging language features and adhering to best practices for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
*Compose comprehensive RSpec tests covering all APIs, models, and controllers to ensure the robustness and reliability of the entire system.&lt;br /&gt;
&lt;br /&gt;
===Development Strategy===&lt;br /&gt;
&lt;br /&gt;
Our development strategy adheres to the principles of Test-Driven Development (TDD) for the implementation of both the Invitation model and the Invitation Controller. The process begins with the creation of a failing test case, followed by the addition of code to address the identified issues and ensure the successful passage of the test.&lt;br /&gt;
&lt;br /&gt;
Furthermore, we align with the Rails philosophy of &amp;quot;Fat models,&amp;quot; aiming to migrate substantial business logic from the controller to the model. This approach is intended to maintain a clean and organized controller codebase while promoting code reusability throughout the application.&lt;br /&gt;
&lt;br /&gt;
===Project Design and Implementation===&lt;br /&gt;
&lt;br /&gt;
Considering the existing functionality of the Team_user model and controller, we have outlined a set of RESTful endpoints along with their corresponding request types for implementation. In the controller, we plan to adopt the Strategy Pattern, leveraging its ability to encapsulate controller actions and facilitate easy extensibility and usability. This pattern will enable a structured approach to defining and managing the various operations the controller can perform.&lt;br /&gt;
&lt;br /&gt;
==== Functionality ====&lt;br /&gt;
In this project, we aim to add functions for the following:&lt;br /&gt;
&lt;br /&gt;
1. Retrieve and display team members.&lt;br /&gt;
&lt;br /&gt;
2. Add a new team member with checks for user existence and team limits.&lt;br /&gt;
&lt;br /&gt;
3. Delete a specific team member.&lt;br /&gt;
&lt;br /&gt;
4. Delete multiple selected team members based on item IDs.&lt;br /&gt;
&lt;br /&gt;
5. Autocomplete functionality for user names within a team.&lt;br /&gt;
&lt;br /&gt;
6. Updating duties of a team member.&lt;br /&gt;
&lt;br /&gt;
===Testing Plan===&lt;br /&gt;
The TeamsUsers model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of TeamsUsers model and controller we have defined the following test which are implemented to test the reimplemented code of teams_users model and controller.&lt;br /&gt;
&lt;br /&gt;
===Relevant Links===&lt;br /&gt;
Github Repository: https://github.com/Kashika08/reimplementation-back-end&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
*Jay Shah (github: jayjshah2000)&lt;br /&gt;
&lt;br /&gt;
*Kashika Malick (github: kashika08)&lt;br /&gt;
&lt;br /&gt;
*Riya Gori (github: riyagori1203)&lt;br /&gt;
&lt;br /&gt;
===Mentor===&lt;br /&gt;
Kartiki Bhandakkar&lt;/div&gt;</summary>
		<author><name>Kmalick</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151506</id>
		<title>CSC/ECE 517 Fall 2023 - E2386. Reimplement teams users backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151506"/>
		<updated>2023-11-16T00:01:59Z</updated>

		<summary type="html">&lt;p&gt;Kmalick: /* Team Members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Description of Project===&lt;br /&gt;
&lt;br /&gt;
The focal point of the project is the Team_user model, capturing information about mentors, team members, and affiliations with other models such as Users and Teams. This model undertakes various responsibilities, including the formation of teams with enrolled students and the display of team members. Oversight of team management falls under the purview of the Team_user_controller, which orchestrates CRUD operations on the Team_user model. Its duties span the creation, modification, and deletion of teams, along with the administration of team members through additions or removals. Furthermore, the controller provides a list of mentors associated with Team_users.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The project involves creating a backend system for seamless CRUD operations on a relational database, specifically focusing on interactions between teams and users. This requires defining &amp;quot;Team_Users&amp;quot; model with suitable attributes and relationships, establishing controllers to manage CRUD actions, and setting up corresponding routes. Emphasis is placed on rigorous testing, covering model validations and associations, as well as controller actions to ensure accurate execution of CRUD operations. A key project aspect involves refining code to produce precise JSON responses. Adhering to RESTful conventions, the re-implementation includes appropriate HTTP response codes. RSpec tests are mandatory for both the Team_Users model and TeamUsersController, covering all endpoints and incorporating HTTP response codes. These controller tests are designed to integrate seamlessly with RSwag for generating API documentation and testing REST APIs through the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
===Objectives===&lt;br /&gt;
&lt;br /&gt;
*Craft RESTful endpoints for creating, displaying, and deleting invitations, along with approving new invitations. Additionally, provide functionality for listing pending invitations, creating new invitations, and notifying students about newly formed team invitations.&lt;br /&gt;
&lt;br /&gt;
*Develop and integrate methods within the Team_usersController to facilitate invitation-related operations, including creating, accepting, declining, and canceling invitations. Ensure thorough checks of user and team statuses before initiating or accepting invitations.&lt;br /&gt;
&lt;br /&gt;
*Establish a user-invitation system that empowers invited users to accept, decline, or cancel invitations, triggering corresponding updates to the associated Team_user records. This should seamlessly manage the addition or removal of users from teams.&lt;br /&gt;
&lt;br /&gt;
*Implement an email notification system within the user-invitation framework, sending email notifications to invited users upon the issuance of new invitations.&lt;br /&gt;
&lt;br /&gt;
*Enforce the use of proper status codes and robust validation mechanisms for all RESTful endpoints.&lt;br /&gt;
&lt;br /&gt;
*Construct models and controllers for the Team_user model, incorporating contemporary approaches to writing Ruby code. This involves leveraging language features and adhering to best practices for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
*Compose comprehensive RSpec tests covering all APIs, models, and controllers to ensure the robustness and reliability of the entire system.&lt;br /&gt;
&lt;br /&gt;
===Development Strategy===&lt;br /&gt;
&lt;br /&gt;
Our development strategy adheres to the principles of Test-Driven Development (TDD) for the implementation of both the Invitation model and the Invitation Controller. The process begins with the creation of a failing test case, followed by the addition of code to address the identified issues and ensure the successful passage of the test.&lt;br /&gt;
&lt;br /&gt;
Furthermore, we align with the Rails philosophy of &amp;quot;Fat models,&amp;quot; aiming to migrate substantial business logic from the controller to the model. This approach is intended to maintain a clean and organized controller codebase while promoting code reusability throughout the application.&lt;br /&gt;
&lt;br /&gt;
===Project Design and Implementation===&lt;br /&gt;
&lt;br /&gt;
Considering the existing functionality of the Team_user model and controller, we have outlined a set of RESTful endpoints along with their corresponding request types for implementation. In the controller, we plan to adopt the Strategy Pattern, leveraging its ability to encapsulate controller actions and facilitate easy extensibility and usability. This pattern will enable a structured approach to defining and managing the various operations the controller can perform.&lt;br /&gt;
&lt;br /&gt;
==== Functionality ====&lt;br /&gt;
In this project, we aim to add functions for the following:&lt;br /&gt;
&lt;br /&gt;
1. Retrieve and display team members.&lt;br /&gt;
&lt;br /&gt;
2. Add a new team member with checks for user existence and team limits.&lt;br /&gt;
&lt;br /&gt;
3. Delete a specific team member.&lt;br /&gt;
&lt;br /&gt;
4. Delete multiple selected team members based on item IDs.&lt;br /&gt;
&lt;br /&gt;
5. Autocomplete functionality for user names within a team.&lt;br /&gt;
&lt;br /&gt;
6. Updating duties of a team member.&lt;br /&gt;
&lt;br /&gt;
===Testing Plan===&lt;br /&gt;
The TeamsUsers model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of TeamsUsers model and controller we have defined the following test which are implemented to test the reimplemented code of teams_users model and controller.&lt;br /&gt;
&lt;br /&gt;
===Relevant Links===&lt;br /&gt;
Github Repository: https://github.com/Kashika08/reimplementation-back-end&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Jay Shah (github: jayjshah2000)&lt;br /&gt;
&lt;br /&gt;
Kashika Malick (github: kashika08)&lt;br /&gt;
&lt;br /&gt;
Riya Gori (github: riyagori1203)&lt;br /&gt;
&lt;br /&gt;
===Mentor===&lt;br /&gt;
Kartiki Bhandakkar&lt;/div&gt;</summary>
		<author><name>Kmalick</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151505</id>
		<title>CSC/ECE 517 Fall 2023 - E2386. Reimplement teams users backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151505"/>
		<updated>2023-11-16T00:01:20Z</updated>

		<summary type="html">&lt;p&gt;Kmalick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Description of Project===&lt;br /&gt;
&lt;br /&gt;
The focal point of the project is the Team_user model, capturing information about mentors, team members, and affiliations with other models such as Users and Teams. This model undertakes various responsibilities, including the formation of teams with enrolled students and the display of team members. Oversight of team management falls under the purview of the Team_user_controller, which orchestrates CRUD operations on the Team_user model. Its duties span the creation, modification, and deletion of teams, along with the administration of team members through additions or removals. Furthermore, the controller provides a list of mentors associated with Team_users.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The project involves creating a backend system for seamless CRUD operations on a relational database, specifically focusing on interactions between teams and users. This requires defining &amp;quot;Team_Users&amp;quot; model with suitable attributes and relationships, establishing controllers to manage CRUD actions, and setting up corresponding routes. Emphasis is placed on rigorous testing, covering model validations and associations, as well as controller actions to ensure accurate execution of CRUD operations. A key project aspect involves refining code to produce precise JSON responses. Adhering to RESTful conventions, the re-implementation includes appropriate HTTP response codes. RSpec tests are mandatory for both the Team_Users model and TeamUsersController, covering all endpoints and incorporating HTTP response codes. These controller tests are designed to integrate seamlessly with RSwag for generating API documentation and testing REST APIs through the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
===Objectives===&lt;br /&gt;
&lt;br /&gt;
*Craft RESTful endpoints for creating, displaying, and deleting invitations, along with approving new invitations. Additionally, provide functionality for listing pending invitations, creating new invitations, and notifying students about newly formed team invitations.&lt;br /&gt;
&lt;br /&gt;
*Develop and integrate methods within the Team_usersController to facilitate invitation-related operations, including creating, accepting, declining, and canceling invitations. Ensure thorough checks of user and team statuses before initiating or accepting invitations.&lt;br /&gt;
&lt;br /&gt;
*Establish a user-invitation system that empowers invited users to accept, decline, or cancel invitations, triggering corresponding updates to the associated Team_user records. This should seamlessly manage the addition or removal of users from teams.&lt;br /&gt;
&lt;br /&gt;
*Implement an email notification system within the user-invitation framework, sending email notifications to invited users upon the issuance of new invitations.&lt;br /&gt;
&lt;br /&gt;
*Enforce the use of proper status codes and robust validation mechanisms for all RESTful endpoints.&lt;br /&gt;
&lt;br /&gt;
*Construct models and controllers for the Team_user model, incorporating contemporary approaches to writing Ruby code. This involves leveraging language features and adhering to best practices for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
*Compose comprehensive RSpec tests covering all APIs, models, and controllers to ensure the robustness and reliability of the entire system.&lt;br /&gt;
&lt;br /&gt;
===Development Strategy===&lt;br /&gt;
&lt;br /&gt;
Our development strategy adheres to the principles of Test-Driven Development (TDD) for the implementation of both the Invitation model and the Invitation Controller. The process begins with the creation of a failing test case, followed by the addition of code to address the identified issues and ensure the successful passage of the test.&lt;br /&gt;
&lt;br /&gt;
Furthermore, we align with the Rails philosophy of &amp;quot;Fat models,&amp;quot; aiming to migrate substantial business logic from the controller to the model. This approach is intended to maintain a clean and organized controller codebase while promoting code reusability throughout the application.&lt;br /&gt;
&lt;br /&gt;
===Project Design and Implementation===&lt;br /&gt;
&lt;br /&gt;
Considering the existing functionality of the Team_user model and controller, we have outlined a set of RESTful endpoints along with their corresponding request types for implementation. In the controller, we plan to adopt the Strategy Pattern, leveraging its ability to encapsulate controller actions and facilitate easy extensibility and usability. This pattern will enable a structured approach to defining and managing the various operations the controller can perform.&lt;br /&gt;
&lt;br /&gt;
==== Functionality ====&lt;br /&gt;
In this project, we aim to add functions for the following:&lt;br /&gt;
&lt;br /&gt;
1. Retrieve and display team members.&lt;br /&gt;
&lt;br /&gt;
2. Add a new team member with checks for user existence and team limits.&lt;br /&gt;
&lt;br /&gt;
3. Delete a specific team member.&lt;br /&gt;
&lt;br /&gt;
4. Delete multiple selected team members based on item IDs.&lt;br /&gt;
&lt;br /&gt;
5. Autocomplete functionality for user names within a team.&lt;br /&gt;
&lt;br /&gt;
6. Updating duties of a team member.&lt;br /&gt;
&lt;br /&gt;
===Testing Plan===&lt;br /&gt;
The TeamsUsers model and controller will be tested using Rspec. FactoryBot will be utilized to create test fixtures and to build the required models. As the methods in the controller are defined as RESTful endpoints. The test take into consideration that the methods return the correct status codes for the output. Based on the current functionality of TeamsUsers model and controller we have defined the following test which are implemented to test the reimplemented code of teams_users model and controller.&lt;br /&gt;
&lt;br /&gt;
===Relevant Links===&lt;br /&gt;
Github Repository: https://github.com/Kashika08/reimplementation-back-end&lt;br /&gt;
&lt;br /&gt;
===Team Members===&lt;br /&gt;
Jay Shah (github: jayjshah2000)&lt;br /&gt;
Kashika Malick (github: kashika08)&lt;br /&gt;
Riya Gori (github: riyagori1203)&lt;br /&gt;
&lt;br /&gt;
===Mentor===&lt;br /&gt;
Kartiki Bhandakkar&lt;/div&gt;</summary>
		<author><name>Kmalick</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151504</id>
		<title>CSC/ECE 517 Fall 2023 - E2386. Reimplement teams users backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151504"/>
		<updated>2023-11-15T23:52:51Z</updated>

		<summary type="html">&lt;p&gt;Kmalick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Description of Project===&lt;br /&gt;
&lt;br /&gt;
The focal point of the project is the Team_user model, capturing information about mentors, team members, and affiliations with other models such as Users and Teams. This model undertakes various responsibilities, including the formation of teams with enrolled students and the display of team members. Oversight of team management falls under the purview of the Team_user_controller, which orchestrates CRUD operations on the Team_user model. Its duties span the creation, modification, and deletion of teams, along with the administration of team members through additions or removals. Furthermore, the controller provides a list of mentors associated with Team_users.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The project involves creating a backend system for seamless CRUD operations on a relational database, specifically focusing on interactions between teams and users. This requires defining &amp;quot;Team_Users&amp;quot; model with suitable attributes and relationships, establishing controllers to manage CRUD actions, and setting up corresponding routes. Emphasis is placed on rigorous testing, covering model validations and associations, as well as controller actions to ensure accurate execution of CRUD operations. A key project aspect involves refining code to produce precise JSON responses. Adhering to RESTful conventions, the re-implementation includes appropriate HTTP response codes. RSpec tests are mandatory for both the Team_Users model and TeamUsersController, covering all endpoints and incorporating HTTP response codes. These controller tests are designed to integrate seamlessly with RSwag for generating API documentation and testing REST APIs through the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
===Objectives===&lt;br /&gt;
&lt;br /&gt;
*Craft RESTful endpoints for creating, displaying, and deleting invitations, along with approving new invitations. Additionally, provide functionality for listing pending invitations, creating new invitations, and notifying students about newly formed team invitations.&lt;br /&gt;
&lt;br /&gt;
*Develop and integrate methods within the Team_usersController to facilitate invitation-related operations, including creating, accepting, declining, and canceling invitations. Ensure thorough checks of user and team statuses before initiating or accepting invitations.&lt;br /&gt;
&lt;br /&gt;
*Establish a user-invitation system that empowers invited users to accept, decline, or cancel invitations, triggering corresponding updates to the associated Team_user records. This should seamlessly manage the addition or removal of users from teams.&lt;br /&gt;
&lt;br /&gt;
*Implement an email notification system within the user-invitation framework, sending email notifications to invited users upon the issuance of new invitations.&lt;br /&gt;
&lt;br /&gt;
*Enforce the use of proper status codes and robust validation mechanisms for all RESTful endpoints.&lt;br /&gt;
&lt;br /&gt;
*Construct models and controllers for the Team_user model, incorporating contemporary approaches to writing Ruby code. This involves leveraging language features and adhering to best practices for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
*Compose comprehensive RSpec tests covering all APIs, models, and controllers to ensure the robustness and reliability of the entire system.&lt;br /&gt;
&lt;br /&gt;
===Development Strategy===&lt;br /&gt;
&lt;br /&gt;
Our development strategy adheres to the principles of Test-Driven Development (TDD) for the implementation of both the Invitation model and the Invitation Controller. The process begins with the creation of a failing test case, followed by the addition of code to address the identified issues and ensure the successful passage of the test.&lt;br /&gt;
&lt;br /&gt;
Furthermore, we align with the Rails philosophy of &amp;quot;Fat models,&amp;quot; aiming to migrate substantial business logic from the controller to the model. This approach is intended to maintain a clean and organized controller codebase while promoting code reusability throughout the application.&lt;br /&gt;
&lt;br /&gt;
===Project Design and Implementation===&lt;br /&gt;
&lt;br /&gt;
Considering the existing functionality of the Team_user model and controller, we have outlined a set of RESTful endpoints along with their corresponding request types for implementation. In the controller, we plan to adopt the Strategy Pattern, leveraging its ability to encapsulate controller actions and facilitate easy extensibility and usability. This pattern will enable a structured approach to defining and managing the various operations the controller can perform.&lt;br /&gt;
&lt;br /&gt;
==== Functionality =====&lt;br /&gt;
In this project, we aim to add functions for the following:&lt;br /&gt;
&lt;br /&gt;
1. Retrieve and display team members.&lt;br /&gt;
&lt;br /&gt;
2. Add a new team member with checks for user existence and team limits.&lt;br /&gt;
&lt;br /&gt;
3. Delete a specific team member.&lt;br /&gt;
&lt;br /&gt;
4. Delete multiple selected team members based on item IDs.&lt;br /&gt;
&lt;br /&gt;
5. Autocomplete functionality for user names within a team.&lt;br /&gt;
&lt;br /&gt;
6. Updating duties of a team member.&lt;/div&gt;</summary>
		<author><name>Kmalick</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151459</id>
		<title>CSC/ECE 517 Fall 2023 - E2386. Reimplement teams users backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151459"/>
		<updated>2023-11-15T18:48:32Z</updated>

		<summary type="html">&lt;p&gt;Kmalick: /* Description of Project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Description of Project===&lt;br /&gt;
&lt;br /&gt;
The focal point of the project is the Team_user model, capturing information about mentors, team members, and affiliations with other models such as Users and Teams. This model undertakes various responsibilities, including the formation of teams with enrolled students and the display of team members. Oversight of team management falls under the purview of the Team_user_controller, which orchestrates CRUD operations on the Team_user model. Its duties span the creation, modification, and deletion of teams, along with the administration of team members through additions or removals. Furthermore, the controller provides a list of mentors associated with Team_users.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The project involves creating a backend system for seamless CRUD operations on a relational database, specifically focusing on interactions between teams and users. This requires defining &amp;quot;Team_Users&amp;quot; model with suitable attributes and relationships, establishing controllers to manage CRUD actions, and setting up corresponding routes. Emphasis is placed on rigorous testing, covering model validations and associations, as well as controller actions to ensure accurate execution of CRUD operations. A key project aspect involves refining code to produce precise JSON responses. Adhering to RESTful conventions, the re-implementation includes appropriate HTTP response codes. RSpec tests are mandatory for both the Team_Users model and TeamUsersController, covering all endpoints and incorporating HTTP response codes. These controller tests are designed to integrate seamlessly with RSwag for generating API documentation and testing REST APIs through the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
===Objectives===&lt;br /&gt;
&lt;br /&gt;
*Craft RESTful endpoints for creating, displaying, and deleting invitations, along with approving new invitations. Additionally, provide functionality for listing pending invitations, creating new invitations, and notifying students about newly formed team invitations.&lt;br /&gt;
&lt;br /&gt;
*Develop and integrate methods within the Team_usersController to facilitate invitation-related operations, including creating, accepting, declining, and canceling invitations. Ensure thorough checks of user and team statuses before initiating or accepting invitations.&lt;br /&gt;
&lt;br /&gt;
*Establish a user-invitation system that empowers invited users to accept, decline, or cancel invitations, triggering corresponding updates to the associated Team_user records. This should seamlessly manage the addition or removal of users from teams.&lt;br /&gt;
&lt;br /&gt;
*Implement an email notification system within the user-invitation framework, sending email notifications to invited users upon the issuance of new invitations.&lt;br /&gt;
&lt;br /&gt;
*Enforce the use of proper status codes and robust validation mechanisms for all RESTful endpoints.&lt;br /&gt;
&lt;br /&gt;
*Construct models and controllers for the Team_user model, incorporating contemporary approaches to writing Ruby code. This involves leveraging language features and adhering to best practices for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
*Compose comprehensive RSpec tests covering all APIs, models, and controllers to ensure the robustness and reliability of the entire system.&lt;br /&gt;
&lt;br /&gt;
===Development Strategy===&lt;br /&gt;
&lt;br /&gt;
Our development strategy adheres to the principles of Test-Driven Development (TDD) for the implementation of both the Invitation model and the Invitation Controller. The process begins with the creation of a failing test case, followed by the addition of code to address the identified issues and ensure the successful passage of the test.&lt;br /&gt;
&lt;br /&gt;
Furthermore, we align with the Rails philosophy of &amp;quot;Fat models,&amp;quot; aiming to migrate substantial business logic from the controller to the model. This approach is intended to maintain a clean and organized controller codebase while promoting code reusability throughout the application.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
Considering the existing functionality of the Team_user model and controller, we have outlined a set of RESTful endpoints along with their corresponding request types for implementation. In the controller, we plan to adopt the Strategy Pattern, leveraging its ability to encapsulate controller actions and facilitate easy extensibility and usability. This pattern will enable a structured approach to defining and managing the various operations the controller can perform.&lt;/div&gt;</summary>
		<author><name>Kmalick</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151458</id>
		<title>CSC/ECE 517 Fall 2023 - E2386. Reimplement teams users backend</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2023_-_E2386._Reimplement_teams_users_backend&amp;diff=151458"/>
		<updated>2023-11-15T18:48:15Z</updated>

		<summary type="html">&lt;p&gt;Kmalick: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;===Description of Project===&lt;br /&gt;
&lt;br /&gt;
The focal point of the project is the Team_user model, capturing information about mentors, team members, and affiliations with other models such as Users and Teams. This model undertakes various responsibilities, including the formation of teams with enrolled students and the display of team members. Oversight of team management falls under the purview of the Team_user_controller, which orchestrates CRUD operations on the Team_user model. Its duties span the creation, modification, and deletion of teams, along with the administration of team members through additions or removals. Furthermore, the controller provides a list of mentors associated with Team_users.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
&lt;br /&gt;
The project involves creating a backend system for seamless CRUD operations on a relational database, specifically focusing on interactions between teams and users. This requires defining &amp;quot;Team_Users&amp;quot; model with suitable attributes and relationships, establishing controllers to manage CRUD actions, and setting up corresponding routes. Emphasis is placed on rigorous testing, covering model validations and associations, as well as controller actions to ensure accurate execution of CRUD operations. A key project aspect involves refining code to produce precise JSON responses. Adhering to RESTful conventions, the re-implementation includes appropriate HTTP response codes. RSpec tests are mandatory for both the Team_Users model and TeamUsersController, covering all endpoints and incorporating HTTP response codes. These controller tests are designed to integrate seamlessly with RSwag for generating API documentation and testing REST APIs through the Swagger UI.&lt;br /&gt;
&lt;br /&gt;
===Objectives===&lt;br /&gt;
&lt;br /&gt;
*Craft RESTful endpoints for creating, displaying, and deleting invitations, along with approving new invitations. Additionally, provide functionality for listing pending invitations, creating new invitations, and notifying students about newly formed team invitations.&lt;br /&gt;
&lt;br /&gt;
*Develop and integrate methods within the Team_usersController to facilitate invitation-related operations, including creating, accepting, declining, and canceling invitations. Ensure thorough checks of user and team statuses before initiating or accepting invitations.&lt;br /&gt;
&lt;br /&gt;
*Establish a user-invitation system that empowers invited users to accept, decline, or cancel invitations, triggering corresponding updates to the associated Team_user records. This should seamlessly manage the addition or removal of users from teams.&lt;br /&gt;
&lt;br /&gt;
*Implement an email notification system within the user-invitation framework, sending email notifications to invited users upon the issuance of new invitations.&lt;br /&gt;
&lt;br /&gt;
*Enforce the use of proper status codes and robust validation mechanisms for all RESTful endpoints.&lt;br /&gt;
&lt;br /&gt;
*Construct models and controllers for the Team_user model, incorporating contemporary approaches to writing Ruby code. This involves leveraging language features and adhering to best practices for object-oriented design.&lt;br /&gt;
&lt;br /&gt;
*Compose comprehensive RSpec tests covering all APIs, models, and controllers to ensure the robustness and reliability of the entire system.&lt;br /&gt;
&lt;br /&gt;
===Development Strategy===&lt;br /&gt;
&lt;br /&gt;
Our development strategy adheres to the principles of Test-Driven Development (TDD) for the implementation of both the Invitation model and the Invitation Controller. The process begins with the creation of a failing test case, followed by the addition of code to address the identified issues and ensure the successful passage of the test.&lt;br /&gt;
&lt;br /&gt;
Furthermore, we align with the Rails philosophy of &amp;quot;Fat models,&amp;quot; aiming to migrate substantial business logic from the controller to the model. This approach is intended to maintain a clean and organized controller codebase while promoting code reusability throughout the application.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
Considering the existing functionality of the Team_user model and controller, we have outlined a set of RESTful endpoints along with their corresponding request types for implementation. In the controller, we plan to adopt the Strategy Pattern, leveraging its ability to encapsulate controller actions and facilitate easy extensibility and usability. This pattern will enable a structured approach to defining and managing the various operations the controller can perform.&lt;/div&gt;</summary>
		<author><name>Kmalick</name></author>
	</entry>
</feed>