diff --git a/app/models/journeys.rb b/app/models/journeys.rb index 2a731c9efb..f0943fcb55 100644 --- a/app/models/journeys.rb +++ b/app/models/journeys.rb @@ -10,7 +10,7 @@ def self.table_name_prefix TeacherStudentLoanReimbursement, GetATeacherRelocationPayment, FurtherEducationPayments, - EarlyYearsPayment + EarlyYearsPayment::Provider ].freeze def all diff --git a/app/models/journeys/early_years_payment.rb b/app/models/journeys/early_years_payment.rb deleted file mode 100644 index 1a7513b63b..0000000000 --- a/app/models/journeys/early_years_payment.rb +++ /dev/null @@ -1,14 +0,0 @@ -module Journeys - module EarlyYearsPayment - extend Base - extend self - - ROUTING_NAME = "early-years-payment" - VIEW_PATH = "early_years_payment" - I18N_NAMESPACE = "early_years_payment" - POLICIES = [Policies::EarlyYearsPayment] - FORMS = { - "claims" => {} - } - end -end diff --git a/app/models/journeys/early_years_payment/eligibility_checker.rb b/app/models/journeys/early_years_payment/eligibility_checker.rb deleted file mode 100644 index b71f4e0165..0000000000 --- a/app/models/journeys/early_years_payment/eligibility_checker.rb +++ /dev/null @@ -1,6 +0,0 @@ -module Journeys - module EarlyYearsPayment - class EligibilityChecker < Journeys::EligibilityChecker - end - end -end diff --git a/app/models/journeys/early_years_payment/provider.rb b/app/models/journeys/early_years_payment/provider.rb new file mode 100644 index 0000000000..3611606b21 --- /dev/null +++ b/app/models/journeys/early_years_payment/provider.rb @@ -0,0 +1,16 @@ +module Journeys + module EarlyYearsPayment + module Provider + extend Base + extend self + + ROUTING_NAME = "early-years-payment-provider" + VIEW_PATH = "early_years_payment/provider" + I18N_NAMESPACE = "early_years_payment_provider" + POLICIES = [Policies::EarlyYearsPayment] + FORMS = { + "claims" => {} + } + end + end +end diff --git a/app/models/journeys/early_years_payment/provider/eligibility_checker.rb b/app/models/journeys/early_years_payment/provider/eligibility_checker.rb new file mode 100644 index 0000000000..41dc18f9d9 --- /dev/null +++ b/app/models/journeys/early_years_payment/provider/eligibility_checker.rb @@ -0,0 +1,8 @@ +module Journeys + module EarlyYearsPayment + module Provider + class EligibilityChecker < Journeys::EligibilityChecker + end + end + end +end diff --git a/app/models/journeys/early_years_payment/provider/session.rb b/app/models/journeys/early_years_payment/provider/session.rb new file mode 100644 index 0000000000..6bbc126e49 --- /dev/null +++ b/app/models/journeys/early_years_payment/provider/session.rb @@ -0,0 +1,9 @@ +module Journeys + module EarlyYearsPayment + module Provider + class Session < Journeys::Session + attribute :answers, SessionAnswersType.new + end + end + 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 new file mode 100644 index 0000000000..aed76440e2 --- /dev/null +++ b/app/models/journeys/early_years_payment/provider/session_answers.rb @@ -0,0 +1,11 @@ +module Journeys + module EarlyYearsPayment + module Provider + class SessionAnswers < Journeys::SessionAnswers + def policy + Policies::EarlyYearsPayment + end + end + end + end +end diff --git a/app/models/journeys/early_years_payment/provider/session_answers_type.rb b/app/models/journeys/early_years_payment/provider/session_answers_type.rb new file mode 100644 index 0000000000..5ae13b57cd --- /dev/null +++ b/app/models/journeys/early_years_payment/provider/session_answers_type.rb @@ -0,0 +1,7 @@ +module Journeys + module EarlyYearsPayment + module Provider + class SessionAnswersType < ::Journeys::SessionAnswersType; end + end + end +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 new file mode 100644 index 0000000000..14f1357832 --- /dev/null +++ b/app/models/journeys/early_years_payment/provider/slug_sequence.rb @@ -0,0 +1,42 @@ +module Journeys + module EarlyYearsPayment + module Provider + class SlugSequence + ELIGIBILITY_SLUGS = %w[].freeze + + PERSONAL_DETAILS_SLUGS = %w[].freeze + + PAYMENT_DETAILS_SLUGS = %w[].freeze + + RESULTS_SLUGS = %w[].freeze + + SLUGS = ( + ELIGIBILITY_SLUGS + + PERSONAL_DETAILS_SLUGS + + PAYMENT_DETAILS_SLUGS + + RESULTS_SLUGS + ).freeze + + def self.start_page_url + if Rails.env.production? + "https://www.example.com" # TODO: update to correct guidance + else + Rails.application.routes.url_helpers.landing_page_path("early-years-payment-provider") + end + end + + attr_reader :journey_session + + delegate :answers, to: :journey_session + + def initialize(journey_session) + @journey_session = journey_session + end + + def slugs + SLUGS + end + end + end + end +end diff --git a/app/models/journeys/early_years_payment/session.rb b/app/models/journeys/early_years_payment/session.rb deleted file mode 100644 index be4599b33c..0000000000 --- a/app/models/journeys/early_years_payment/session.rb +++ /dev/null @@ -1,7 +0,0 @@ -module Journeys - module EarlyYearsPayment - class Session < Journeys::Session - attribute :answers, SessionAnswersType.new - end - end -end diff --git a/app/models/journeys/early_years_payment/session_answers.rb b/app/models/journeys/early_years_payment/session_answers.rb deleted file mode 100644 index 3bbb00480b..0000000000 --- a/app/models/journeys/early_years_payment/session_answers.rb +++ /dev/null @@ -1,9 +0,0 @@ -module Journeys - module EarlyYearsPayment - class SessionAnswers < Journeys::SessionAnswers - def policy - Policies::EarlyYearsPayment - end - end - end -end diff --git a/app/models/journeys/early_years_payment/session_answers_type.rb b/app/models/journeys/early_years_payment/session_answers_type.rb deleted file mode 100644 index 847947da5e..0000000000 --- a/app/models/journeys/early_years_payment/session_answers_type.rb +++ /dev/null @@ -1,5 +0,0 @@ -module Journeys - module EarlyYearsPayment - class SessionAnswersType < ::Journeys::SessionAnswersType; end - end -end diff --git a/app/models/journeys/early_years_payment/slug_sequence.rb b/app/models/journeys/early_years_payment/slug_sequence.rb deleted file mode 100644 index a1c3b7e049..0000000000 --- a/app/models/journeys/early_years_payment/slug_sequence.rb +++ /dev/null @@ -1,40 +0,0 @@ -module Journeys - module EarlyYearsPayment - class SlugSequence - ELIGIBILITY_SLUGS = %w[].freeze - - PERSONAL_DETAILS_SLUGS = %w[].freeze - - PAYMENT_DETAILS_SLUGS = %w[].freeze - - RESULTS_SLUGS = %w[].freeze - - SLUGS = ( - ELIGIBILITY_SLUGS + - PERSONAL_DETAILS_SLUGS + - PAYMENT_DETAILS_SLUGS + - RESULTS_SLUGS - ).freeze - - def self.start_page_url - if Rails.env.production? - "https://www.example.com" # TODO: update to correct guidance - else - Rails.application.routes.url_helpers.landing_page_path("early-years-payment") - end - end - - attr_reader :journey_session - - delegate :answers, to: :journey_session - - def initialize(journey_session) - @journey_session = journey_session - end - - def slugs - SLUGS - end - end - end -end diff --git a/app/views/early_years_payment/landing_page.html.erb b/app/views/early_years_payment/provider/landing_page.html.erb similarity index 94% rename from app/views/early_years_payment/landing_page.html.erb rename to app/views/early_years_payment/provider/landing_page.html.erb index 2c12d0758a..7af7929ee3 100644 --- a/app/views/early_years_payment/landing_page.html.erb +++ b/app/views/early_years_payment/provider/landing_page.html.erb @@ -1,6 +1,6 @@
Use this service to make an early years financial incentive payment claim @@ -124,7 +124,7 @@
You can cancel a claim or get help on this service by contacting us at - <%= govuk_link_to t("early_years_payment.feedback_email"), "mailto:#{t("early_years_payment.feedback_email")}", no_visited_state: true %>. + <%= govuk_link_to t("early_years_payment_provider.feedback_email"), "mailto:#{t("early_years_payment_provider.feedback_email")}", no_visited_state: true %>.
diff --git a/config/locales/en.yml b/config/locales/en.yml index 079ed1c3c9..b987776a90 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1019,8 +1019,10 @@ en: By submitting this you are confirming that, to the best of your knowledge, the details you are providing are correct. btn_text: Accept and send - early_years_payment: - journey_name: Claim an early years financial incentive payment + early_years_payment_provider: + journey_name: Claim an early years financial incentive payment - provider + landing_page: + title: Claim an early years financial incentive payment feedback_email: "help@opsteam.education.gov.uk" activerecord: errors: diff --git a/db/seeds.rb b/db/seeds.rb index 3ccf91ad6c..cf8141c936 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -11,7 +11,7 @@ Journeys::Configuration.create!(routing_name: Journeys::AdditionalPaymentsForTeaching::ROUTING_NAME, current_academic_year: AcademicYear.current) Journeys::Configuration.create!(routing_name: Journeys::GetATeacherRelocationPayment::ROUTING_NAME, current_academic_year: AcademicYear.current) Journeys::Configuration.create!(routing_name: Journeys::FurtherEducationPayments::ROUTING_NAME, current_academic_year: AcademicYear.current) - Journeys::Configuration.create!(routing_name: Journeys::EarlyYearsPayment::ROUTING_NAME, current_academic_year: AcademicYear.current) + Journeys::Configuration.create!(routing_name: Journeys::EarlyYearsPayment::Provider::ROUTING_NAME, current_academic_year: AcademicYear.current) ENV["FIXTURES_PATH"] = "spec/fixtures" ENV["FIXTURES"] = "local_authorities,local_authority_districts,schools" diff --git a/spec/factories/journey_configurations.rb b/spec/factories/journey_configurations.rb index 87b8e9c22c..b9e008fae8 100644 --- a/spec/factories/journey_configurations.rb +++ b/spec/factories/journey_configurations.rb @@ -30,8 +30,8 @@ routing_name { Journeys::FurtherEducationPayments::ROUTING_NAME } end - trait :early_years_payment do - routing_name { Journeys::EarlyYearsPayment::ROUTING_NAME } + trait :early_years_payment_provider do + routing_name { Journeys::EarlyYearsPayment::Provider::ROUTING_NAME } end trait :closed do diff --git a/spec/features/early_years_payment/happy_path_spec.rb b/spec/features/early_years_payment/happy_path_spec.rb deleted file mode 100644 index 4af011ddae..0000000000 --- a/spec/features/early_years_payment/happy_path_spec.rb +++ /dev/null @@ -1,10 +0,0 @@ -require "rails_helper" - -RSpec.feature "Early years payment" do - scenario "happy path claim" do - when_early_years_payment_journey_configuration_exists - - visit landing_page_path(Journeys::EarlyYearsPayment::ROUTING_NAME) - expect(page).to have_link("Start now") - end -end diff --git a/spec/features/early_years_payment/provider/happy_path_spec.rb b/spec/features/early_years_payment/provider/happy_path_spec.rb new file mode 100644 index 0000000000..3643bb1f86 --- /dev/null +++ b/spec/features/early_years_payment/provider/happy_path_spec.rb @@ -0,0 +1,10 @@ +require "rails_helper" + +RSpec.feature "Early years payment provider" do + scenario "happy path claim" do + when_early_years_payment_provider_journey_configuration_exists + + visit landing_page_path(Journeys::EarlyYearsPayment::Provider::ROUTING_NAME) + expect(page).to have_link("Start now") + end +end diff --git a/spec/models/journeys_spec.rb b/spec/models/journeys_spec.rb index 7df7ac3288..25dbf99a58 100644 --- a/spec/models/journeys_spec.rb +++ b/spec/models/journeys_spec.rb @@ -10,7 +10,7 @@ Journeys::TeacherStudentLoanReimbursement, Journeys::GetATeacherRelocationPayment, Journeys::FurtherEducationPayments, - Journeys::EarlyYearsPayment + Journeys::EarlyYearsPayment::Provider ]) end end @@ -22,7 +22,7 @@ Journeys::TeacherStudentLoanReimbursement::ROUTING_NAME, Journeys::GetATeacherRelocationPayment::ROUTING_NAME, Journeys::FurtherEducationPayments::ROUTING_NAME, - Journeys::EarlyYearsPayment::ROUTING_NAME + Journeys::EarlyYearsPayment::Provider::ROUTING_NAME ]) end end diff --git a/spec/support/steps/journey_configuration.rb b/spec/support/steps/journey_configuration.rb index 35ec4323ea..f187f429c3 100644 --- a/spec/support/steps/journey_configuration.rb +++ b/spec/support/steps/journey_configuration.rb @@ -2,6 +2,6 @@ def when_further_education_payments_journey_configuration_exists create(:journey_configuration, :further_education_payments) end -def when_early_years_payment_journey_configuration_exists - create(:journey_configuration, :early_years_payment) +def when_early_years_payment_provider_journey_configuration_exists + create(:journey_configuration, :early_years_payment_provider) end