-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use new reminders controller + remove old version
- Loading branch information
Showing
27 changed files
with
121 additions
and
635 deletions.
There are no files selected for viewing
96 changes: 0 additions & 96 deletions
96
app/controllers/journeys/additional_payments_for_teaching/reminders_controller.rb
This file was deleted.
Oops, something went wrong.
81 changes: 0 additions & 81 deletions
81
app/controllers/journeys/additional_payments_for_teaching/reminders_form_callbacks.rb
This file was deleted.
Oops, something went wrong.
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
67 changes: 0 additions & 67 deletions
67
app/forms/journeys/additional_payments_for_teaching/reminders/email_verification_form.rb
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
app/forms/journeys/additional_payments_for_teaching/reminders/personal_details_form.rb
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,44 @@ | ||
module Reminders | ||
class ConfirmationForm < Form | ||
def reminder | ||
@reminder ||= Reminder.find_by( | ||
full_name: journey_session.answers.reminder_full_name, | ||
email_address: journey_session.answers.reminder_email_address, | ||
email_verified: true, | ||
itt_academic_year: next_academic_year.to_s | ||
) | ||
@reminder ||= if submitted_claim | ||
Reminder.find_by( | ||
full_name: submitted_claim.full_name, | ||
email_address: submitted_claim.email_address, | ||
email_verified: true, | ||
itt_subject: itt_subject_for_submitted_claim, | ||
itt_academic_year: next_academic_year.to_s | ||
) | ||
else | ||
Reminder.find_by( | ||
full_name: journey_session.answers.reminder_full_name, | ||
email_address: journey_session.answers.reminder_email_address, | ||
email_verified: true, | ||
itt_subject:, | ||
itt_academic_year: next_academic_year.to_s | ||
) | ||
end | ||
end | ||
|
||
def set_reminder_from_claim | ||
end | ||
|
||
private | ||
|
||
def itt_subject | ||
journey_session.answers.eligible_itt_subject | ||
end | ||
|
||
def itt_subject_for_submitted_claim | ||
submitted_claim.eligible_itt_subject | ||
end | ||
|
||
def submitted_claim | ||
Claim.find_by(id: session["submitted_claim_id"]) | ||
end | ||
|
||
def next_academic_year | ||
AcademicYear.next | ||
journey.configuration.current_academic_year + 1 | ||
end | ||
end | ||
end |
Oops, something went wrong.