Skip to content

Commit

Permalink
Namespace journey to EarlyYearsPayment::Provider
Browse files Browse the repository at this point in the history
Change the journey from EarlyYearsPayment to EarlyYearsPayment::Provider since
there will be a second journey relating to the practitioner answers
  • Loading branch information
AbigailMcP committed Jul 29, 2024
1 parent 81b4bb4 commit 7d85bdf
Show file tree
Hide file tree
Showing 21 changed files with 117 additions and 103 deletions.
2 changes: 1 addition & 1 deletion app/models/journeys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def self.table_name_prefix
TeacherStudentLoanReimbursement,
GetATeacherRelocationPayment,
FurtherEducationPayments,
EarlyYearsPayment
EarlyYearsPayment::Provider
].freeze

def all
Expand Down
14 changes: 0 additions & 14 deletions app/models/journeys/early_years_payment.rb

This file was deleted.

This file was deleted.

16 changes: 16 additions & 0 deletions app/models/journeys/early_years_payment/provider.rb
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Journeys
module EarlyYearsPayment
module Provider
class EligibilityChecker < Journeys::EligibilityChecker
end
end
end
end
9 changes: 9 additions & 0 deletions app/models/journeys/early_years_payment/provider/session.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Journeys
module EarlyYearsPayment
module Provider
class Session < Journeys::Session
attribute :answers, SessionAnswersType.new
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module Journeys
module EarlyYearsPayment
module Provider
class SessionAnswers < Journeys::SessionAnswers
def policy
Policies::EarlyYearsPayment
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Journeys
module EarlyYearsPayment
module Provider
class SessionAnswersType < ::Journeys::SessionAnswersType; end
end
end
end
42 changes: 42 additions & 0 deletions app/models/journeys/early_years_payment/provider/slug_sequence.rb
Original file line number Diff line number Diff line change
@@ -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
7 changes: 0 additions & 7 deletions app/models/journeys/early_years_payment/session.rb

This file was deleted.

9 changes: 0 additions & 9 deletions app/models/journeys/early_years_payment/session_answers.rb

This file was deleted.

This file was deleted.

40 changes: 0 additions & 40 deletions app/models/journeys/early_years_payment/slug_sequence.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-xl"><%= t("early_years_payment.journey_name") %></h1>
<h1 class="govuk-heading-xl"><%= t("early_years_payment_provider.landing_page.title") %></h1>

<p class="govuk-body-l">
Use this service to make an early years financial incentive payment claim
Expand Down Expand Up @@ -124,7 +124,7 @@

<p class="govuk-body">
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 %>.
</p>

<p class="govuk-body">
Expand Down
6 changes: 4 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1044,8 +1044,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: "[email protected]"
activerecord:
errors:
Expand Down
2 changes: 1 addition & 1 deletion db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions spec/factories/journey_configurations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 0 additions & 10 deletions spec/features/early_years_payment/happy_path_spec.rb

This file was deleted.

10 changes: 10 additions & 0 deletions spec/features/early_years_payment/provider/happy_path_spec.rb
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions spec/models/journeys_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Journeys::TeacherStudentLoanReimbursement,
Journeys::GetATeacherRelocationPayment,
Journeys::FurtherEducationPayments,
Journeys::EarlyYearsPayment
Journeys::EarlyYearsPayment::Provider
])
end
end
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/support/steps/journey_configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 7d85bdf

Please sign in to comment.