-
Notifications
You must be signed in to change notification settings - Fork 155
Refactor ResponseMaps: Centralize Submission Handling, Automate Feedback Emails, and Model Enhancements #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
konetichandrakant
wants to merge
49
commits into
expertiza:main
Choose a base branch
from
riya-bihani:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixed all requests spec and added it to the github workflow (expertiza#167)
…esponse-map Feature/reimplement feedback response map
…-response-map Added skeleton and initial base testcases to feedback_response_map_sp…
…-response-map Test/reimplementation feedback response map
…-response-map Modified testcases logic on feedback_response_map_spec.rb
Added initial methods in response map controller
Integrated email functionality into ResponseMapController using the email service
Refactor response model to make it centralized pattern for all response_maps
Refactored response_map model to follow a centralized pattern for all response_maps
feat: call FeedbackEmailService in submit_response
…p-controller Added logic to feedback_response_map_controller
Test/response map controller
…lers directory to improve code structure and maintainability
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR Description:
Overview:
This PR enhances the response_maps_controller.rb, feedback_response_map_controller.rb, response.rb, and response_map.rb to establish a centralized system for handling response submissions and feedback notifications. Instead of separately managing submission logic in different controllers, response_maps_controller.rb now acts as the unified controller, ensuring consistent behavior when a response is created, updated, or submitted. This required careful coordination with the response.rb and response_map.rb models to maintain correct associations, handle submission flags, and automate email notifications reliably. Additionally, the FeedbackEmailService was moved into the mailers directory and the new FeedbackEmailMailer was introduced to handle email composition and delivery separately.
Key Changes:
Updated
response_maps_controller.rb
:Updated
feedback_response_maps_controller.rb
:Updated
response
Model:Updated
response_map
Model:Testing Challenges:
The transition to centralized submission handling highlighted testing difficulties because of the strong interdependencies between database models. Here’s why:
Complex Database Relationships:
Authentication and Validation Constraints:
Conclusion:
This PR significantly improves the system’s maintainability, scalability, and consistency by introducing a centralized mechanism for managing response submissions and feedback email notifications. Changes to response.rb and response_map.rb were essential to support this new centralized flow—ensuring that all related entities (reviewer, reviewee, assignment) could be accurately accessed through delegation and that responses could correctly participate in submission and notification logic across different types of maps. With these improvements, the system is now more modular, easier to test, and ready for future extensions.