-
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.
[LUPEYALPHA-989] EY Practitioner check-your-answers page (#3319)
* EY Practitioner check-your-answers page * EY practitioner submitting claim should update existing claim * set eligibility.practitioner_claim_submitted_at * only populate claim.submitted_at when practitioner submits claim * do not perform DQT check for EY
- Loading branch information
Showing
28 changed files
with
303 additions
and
62 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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,12 +1,14 @@ | ||
class ClaimVerifierJob < ApplicationJob | ||
def perform(claim) | ||
AutomatedChecks::ClaimVerifier.new( | ||
claim:, | ||
dqt_teacher_status: claim.has_dqt_record? ? Dqt::Teacher.new(claim.dqt_teacher_status) : Dqt::Client.new.teacher.find( | ||
claim.eligibility.teacher_reference_number, | ||
birthdate: claim.date_of_birth.to_s, | ||
nino: claim.national_insurance_number | ||
) | ||
).perform | ||
if claim.eligibility.respond_to?(:teacher_reference_number) | ||
AutomatedChecks::ClaimVerifier.new( | ||
claim:, | ||
dqt_teacher_status: claim.has_dqt_record? ? Dqt::Teacher.new(claim.dqt_teacher_status) : Dqt::Client.new.teacher.find( | ||
claim.eligibility.teacher_reference_number, | ||
birthdate: claim.date_of_birth.to_s, | ||
nino: claim.national_insurance_number | ||
) | ||
).perform | ||
end | ||
end | ||
end |
30 changes: 30 additions & 0 deletions
30
app/models/journeys/early_years_payment/practitioner/answers_presenter.rb
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module Journeys | ||
module EarlyYearsPayment | ||
module Practitioner | ||
class AnswersPresenter < BaseAnswersPresenter | ||
include ActionView::Helpers::TranslationHelper | ||
|
||
def identity_answers | ||
[].tap do |a| | ||
a << ["Full name", answers.full_name, "personal-details"] | ||
a << ["Date of birth", date_of_birth_string, "personal-details"] | ||
a << ["National Insurance number", answers.national_insurance_number, "personal-details"] | ||
a << ["Home address", answers.address, "enter-home-address"] | ||
a << ["Preferred email address", answers.email_address, "email-address"] | ||
a << ["Provide mobile number?", answers.provide_mobile_number? ? "Yes" : "No", "provide-mobile-number"] | ||
a << ["Preferred mobile number", answers.mobile_number, "mobile-number"] if answers.provide_mobile_number? | ||
end | ||
end | ||
|
||
def payment_answers | ||
[].tap do |a| | ||
a << ["Name on the account", answers.banking_name, "personal-bank-account"] | ||
a << ["Sort code", answers.bank_sort_code, "personal-bank-account"] | ||
a << ["Account number", answers.bank_account_number, "personal-bank-account"] | ||
a << ["Payroll gender", answers.payroll_gender, "gender"] | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
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
30 changes: 29 additions & 1 deletion
30
app/views/early_years_payment/practitioner/claims/check_your_answers.html.erb
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 +1,29 @@ | ||
placeholder | ||
<% content_for( | ||
:page_title, | ||
page_title( | ||
t("early_years_payment_practitioner.check_your_answers.title"), | ||
journey: current_journey_routing_name, | ||
show_error: @form.errors.any? | ||
) | ||
) %> | ||
|
||
<div class="govuk-grid-row"> | ||
<div class="govuk-grid-column-two-thirds"> | ||
<%# Errors are from the SubmissionsController %> | ||
<% if @form.errors.any? %> | ||
<%= render("shared/error_summary", instance: @form) %> | ||
<% end %> | ||
|
||
<h1 class="govuk-heading-xl"> | ||
<%= t("early_years_payment_practitioner.check_your_answers.title") %> | ||
</h1> | ||
|
||
<%= render partial: "claims/check_your_answers_section", locals: {heading: "Personal details", answers: journey.answers_for_claim(@form.journey_session).identity_answers} %> | ||
|
||
<%= render partial: "claims/check_your_answers_section", locals: {heading: "Bank account information", answers: journey.answers_for_claim(@form.journey_session).payment_answers} %> | ||
|
||
<%= form_with url: claim_submission_path, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %> | ||
<%= f.govuk_submit t("early_years_payment_practitioner.check_your_answers.btn_text") %> | ||
<% end %> | ||
</div> | ||
</div> |
1 change: 1 addition & 0 deletions
1
app/views/early_years_payment/practitioner/submissions/show.html.erb
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
placeholder |
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
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 changes: 7 additions & 0 deletions
7
...te/20241017113701_add_provider_claim_submitted_at_to_early_years_payment_eligibilities.rb
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class AddProviderClaimSubmittedAtToEarlyYearsPaymentEligibilities < ActiveRecord::Migration[7.0] | ||
def change | ||
add_column :early_years_payment_eligibilities, :provider_claim_submitted_at, :datetime | ||
add_column :early_years_payment_eligibilities, :practitioner_claim_started_at, :datetime | ||
remove_column :early_years_payment_eligibilities, :practitioner_claim_submitted_at, :datetime | ||
end | ||
end |
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
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
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,7 +1,7 @@ | ||
FactoryBot.define do | ||
factory :early_years_payments_eligibility, class: "Policies::EarlyYearsPayments::Eligibility" do | ||
trait :practitioner_claim_submitted do | ||
practitioner_claim_submitted_at { Time.zone.now } | ||
trait :provider_claim_submitted do | ||
provider_claim_submitted_at { Time.zone.now } | ||
end | ||
end | ||
end |
21 changes: 21 additions & 0 deletions
21
spec/factories/journeys/early_years_payment/practitioner/answers.rb
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FactoryBot.define do | ||
factory :early_years_payment_practitioner_answers, class: "Journeys::EarlyYearsPayment::Practitioner::SessionAnswers" do | ||
trait :eligible do | ||
academic_year { AcademicYear.current } | ||
email_address { "practitioner@example.com" } | ||
email_verified { true } | ||
first_name { "John" } | ||
surname { "Doe" } | ||
provide_mobile_number { false } | ||
national_insurance_number { generate(:national_insurance_number) } | ||
date_of_birth { 20.years.ago.to_date } | ||
banking_name { "John Doe" } | ||
bank_sort_code { rand(100000..999999) } | ||
bank_account_number { rand(10000000..99999999) } | ||
end | ||
|
||
trait :submittable do | ||
eligible | ||
end | ||
end | ||
end |
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
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
Oops, something went wrong.