diff --git a/app/forms/journeys/early_years_payment/provider/claim_submission_form.rb b/app/forms/journeys/early_years_payment/provider/claim_submission_form.rb new file mode 100644 index 0000000000..01ff2b9c93 --- /dev/null +++ b/app/forms/journeys/early_years_payment/provider/claim_submission_form.rb @@ -0,0 +1,23 @@ +module Journeys + module EarlyYearsPayment + module Provider + class ClaimSubmissionForm < ::ClaimSubmissionBaseForm + private + + def main_eligibility + @main_eligibility ||= Policies::EarlyYearsPayment::Eligibility.new + end + + def calculate_award_amount(eligibility) + # NOOP + # This is just for compatibility with the AdditionalPaymentsForTeaching + # claim submission form. + end + + def generate_policy_options_provided + [] + end + end + end + end +end diff --git a/app/forms/journeys/early_years_payment/provider/consent_form.rb b/app/forms/journeys/early_years_payment/provider/consent_form.rb new file mode 100644 index 0000000000..d84a940586 --- /dev/null +++ b/app/forms/journeys/early_years_payment/provider/consent_form.rb @@ -0,0 +1,19 @@ +module Journeys + module EarlyYearsPayment + module Provider + class ConsentForm < Form + attribute :consent_given, :boolean + + validates :consent_given, + presence: {message: i18n_error_message(:presence)} + + def save + return false if invalid? + + journey_session.answers.assign_attributes(consent_given:) + journey_session.save! + end + end + end + end +end diff --git a/app/models/journeys/early_years_payment/provider.rb b/app/models/journeys/early_years_payment/provider.rb index 3611606b21..61a5fbdaf1 100644 --- a/app/models/journeys/early_years_payment/provider.rb +++ b/app/models/journeys/early_years_payment/provider.rb @@ -9,7 +9,9 @@ module Provider I18N_NAMESPACE = "early_years_payment_provider" POLICIES = [Policies::EarlyYearsPayment] FORMS = { - "claims" => {} + "claims" => { + "consent" => ConsentForm + } } end end diff --git a/app/models/journeys/early_years_payment/provider/session_answers.rb b/app/models/journeys/early_years_payment/provider/session_answers.rb index aed76440e2..c520efea98 100644 --- a/app/models/journeys/early_years_payment/provider/session_answers.rb +++ b/app/models/journeys/early_years_payment/provider/session_answers.rb @@ -2,6 +2,8 @@ module Journeys module EarlyYearsPayment module Provider class SessionAnswers < Journeys::SessionAnswers + attribute :consent_given, :boolean + def policy Policies::EarlyYearsPayment end diff --git a/app/models/journeys/early_years_payment/provider/slug_sequence.rb b/app/models/journeys/early_years_payment/provider/slug_sequence.rb index 72a238301d..f9b60d5a6b 100644 --- a/app/models/journeys/early_years_payment/provider/slug_sequence.rb +++ b/app/models/journeys/early_years_payment/provider/slug_sequence.rb @@ -2,7 +2,10 @@ module Journeys module EarlyYearsPayment module Provider class SlugSequence - SLUGS = %w[].freeze + SLUGS = %w[ + consent + current-nursery + ].freeze def self.start_page_url Rails.application.routes.url_helpers.landing_page_path("early-years-payment-provider") diff --git a/app/views/early_years_payment/provider/claims/consent.html.erb b/app/views/early_years_payment/provider/claims/consent.html.erb new file mode 100644 index 0000000000..36ccf348a7 --- /dev/null +++ b/app/views/early_years_payment/provider/claims/consent.html.erb @@ -0,0 +1,49 @@ +<% content_for(:page_title, page_title(@form.t(:question), journey: current_journey_routing_name, show_error: @form.errors.any?)) %> + +
+ You need to confirm that you’ve got consent from your employee before + you can continue with a claim. +
+ ++ By continuing you’re confirming that you’ve: +
+ + <%= govuk_list [ + "obtained written consent from your employee to share their personal information (full name, start date, email address)", + "provided your employee with a privacy notice that explains what information will be collected, why it is being collected and who it will be shared with" + ], type: :bullet %> + ++ You do not need to send us the consent forms, but you should keep them + for your records. +
+ ++ If you have any questions, or need further guidance, contact our support + team at + <%= govuk_link_to t("early_years_payment_provider.feedback_email"), "mailto:#{t("early_years_payment_provider.feedback_email")}", no_visited_state: true %>. +
+ +