-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add course choice validation on sibling status #8605
Merged
inulty-dfe
merged 10 commits into
main
from
add-course-choice-validation-on-sibling-status
Oct 3, 2023
Merged
Add course choice validation on sibling status #8605
inulty-dfe
merged 10 commits into
main
from
add-course-choice-validation-on-sibling-status
Oct 3, 2023
Conversation
This file contains 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
7 tasks
inulty-dfe
temporarily deployed
to
review_aks
September 29, 2023 08:24 — with
GitHub Actions
Inactive
inulty-dfe
force-pushed
the
add-course-choice-validation-on-sibling-status
branch
from
September 29, 2023 08:41
a5c503a
to
0f4a430
Compare
inulty-dfe
temporarily deployed
to
review_aks
September 29, 2023 08:46 — with
GitHub Actions
Inactive
inulty-dfe
force-pushed
the
add-course-choice-validation-on-sibling-status
branch
from
September 29, 2023 08:46
0f4a430
to
68660c9
Compare
inulty-dfe
temporarily deployed
to
review_aks
September 29, 2023 08:53 — with
GitHub Actions
Inactive
inulty-dfe
requested a deployment
to
review_aks
September 29, 2023 09:17 — with
GitHub Actions
Abandoned
Code Coverage
|
inulty-dfe
commented
Sep 29, 2023
inulty-dfe
commented
Sep 29, 2023
app/validators/candidate_interface/continuous_applications/course_selection_validator.rb
Outdated
Show resolved
Hide resolved
inulty-dfe
temporarily deployed
to
review_aks
September 29, 2023 10:02 — with
GitHub Actions
Inactive
inulty-dfe
force-pushed
the
add-course-choice-validation-on-sibling-status
branch
from
September 29, 2023 10:16
6414c27
to
0e4692c
Compare
inulty-dfe
temporarily deployed
to
review_aks
September 29, 2023 10:21 — with
GitHub Actions
Inactive
inulty-dfe
commented
Sep 29, 2023
..._interface/continuous_applications/course_selection/candidate_reapplying_to_a_course_spec.rb
Outdated
Show resolved
Hide resolved
inulty-dfe
commented
Sep 29, 2023
@@ -4,24 +4,40 @@ module ContinuousApplications | |||
# Conditional exists to remove the course that is being edited from the checks for duplication | |||
class CourseSelectionValidator < ActiveModel::Validator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could rename this to DuplicateCourseValidator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, lets do that in another PR
inulty-dfe
force-pushed
the
add-course-choice-validation-on-sibling-status
branch
2 times, most recently
from
September 29, 2023 16:02
258a754
to
a8b9aec
Compare
inulty-dfe
temporarily deployed
to
review_aks
September 29, 2023 16:07 — with
GitHub Actions
Inactive
inulty-dfe
force-pushed
the
add-course-choice-validation-on-sibling-status
branch
from
September 29, 2023 16:22
a8b9aec
to
fd0f99a
Compare
inulty-dfe
temporarily deployed
to
review_aks
September 29, 2023 16:26 — with
GitHub Actions
Inactive
Code Coverage
|
An application form may only have one "active" (reapplyable) application choice at a time. Validate that the application form and course choice is unique on an application form when the application choice is in an non-reapply status
When two appliations exist for different course choices on the same course and one is reappliable, and the other is not reapplible. It is invalid to update the status of the reappliable to a non-reapplible status. Cannot have two choices for the same course where both are non-reappliable.
When a candidate is changing the course on theire application, they are editing the course choice. A course choice must not duplicate a course choice on an application form unless the existing choices with the same course are in a non-reappliable status. When editing a course choice, the current application may be in a non-reappliable state. When we check for other records in a non-reappliable state it's possible to return the record we are editing. The previous change removed all applications that made an application to the course. We only want to remove the application being edited. This scenario is not possible to reproduce in the UI
inulty-dfe
force-pushed
the
add-course-choice-validation-on-sibling-status
branch
from
October 2, 2023 09:55
fd0f99a
to
42ada3b
Compare
You have one or more flakey tests on this branch! ❄️ ❄️ ❄️Failed 1 out of 3 times at ./spec/system/support_interface/delete_application_spec.rb:7: |
Code Coverage
|
JR-G
approved these changes
Oct 2, 2023
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.
Context
This PR must be merged after #8596
Currently, a database unique index on ApplicationChoice table prevents the creation of a record with the same
application_form_id
andcourse_option_id
.This constraint is preventing a candidate from reapplying to a course.
With Continuous Applications, we want to allow Candidates to reapply to the same course on the same application form if any previous applications on the application form to the same
CourseOption
have a "reapplyable" status. The reapplyable statuses areChanges proposed in this pull request
ApplicationChoice
model which prevent a duplicate application WRT reapply status on siblings.Guidance to review
ReapplyValidator
and theCourseSelectionValidator
. Offer suggestions on how they might share behaviour.Link to Trello card
Trello Ticket
Things to check