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 25, 2024
1 parent 07a2b59 commit d9d8256
Show file tree
Hide file tree
Showing 31 changed files with 186 additions and 166 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::Provider]
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::Provider
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.

14 changes: 0 additions & 14 deletions app/models/policies/early_years_payment.rb

This file was deleted.

17 changes: 0 additions & 17 deletions app/models/policies/early_years_payment/eligibility.rb

This file was deleted.

This file was deleted.

16 changes: 16 additions & 0 deletions app/models/policies/early_years_payment/provider.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module Policies
module EarlyYearsPayment
module Provider
include BasePolicy
extend self

# Percentage of claims to QA
MIN_QA_THRESHOLD = 10

# TODO: This is needed once the reply-to email address has been added to Gov Notify
def notify_reply_to_id
nil
end
end
end
end
19 changes: 19 additions & 0 deletions app/models/policies/early_years_payment/provider/eligibility.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module Policies
module EarlyYearsPayment
module Provider
class Eligibility < ApplicationRecord
self.table_name = "early_years_payment_provider_eligibilities"

has_one :claim, as: :eligibility, inverse_of: :eligibility

def policy
Policies::EarlyYearsPayment::Provider
end

def ineligible?
false
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module Policies
module EarlyYearsPayment
module Provider
class PolicyEligibilityChecker
attr_reader :answers

delegate_missing_to :answers

def initialize(answers:)
@answers = answers
end

def status
return :ineligible if ineligible?

:eligible_now
end

def ineligible?
false
end
end
end
end
end
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
2 changes: 1 addition & 1 deletion config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ shared:
- lower_award_amount
- created_at
- updated_at
:early_years_payment_eligibilities:
:early_years_payment_provider_eligibilities:
- id
- created_at
- updated_at
6 changes: 4 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "[email protected]"
activerecord:
errors:
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class CreateEarlyYearsPaymentProviderEligibilities < ActiveRecord::Migration[7.0]
def change
create_table :early_years_payment_provider_eligibilities, id: :uuid do |t|
t.timestamps
end
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
t.index ["teacher_reference_number"], name: "index_ecp_eligibility_trn"
end

create_table "early_years_payment_eligibilities", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
create_table "early_years_payment_provider_eligibilities", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end
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
Loading

0 comments on commit d9d8256

Please sign in to comment.