diff --git a/app/forms/journeys/early_years_payment/practitioner/claim_submission_form.rb b/app/forms/journeys/early_years_payment/practitioner/claim_submission_form.rb new file mode 100644 index 0000000000..fe0eaf093b --- /dev/null +++ b/app/forms/journeys/early_years_payment/practitioner/claim_submission_form.rb @@ -0,0 +1,19 @@ +module Journeys + module EarlyYearsPayment + module Practitioner + class ClaimSubmissionForm < ::ClaimSubmissionBaseForm + def main_eligibility + @main_eligibility ||= eligibilities.detect { |e| e.policy == main_policy } + end + + def calculate_award_amount(eligibility) + 0 + end + + def main_policy + Policies::EarlyYearsPayments + end + end + end + end +end diff --git a/app/forms/journeys/early_years_payment/practitioner/find_reference_form.rb b/app/forms/journeys/early_years_payment/practitioner/find_reference_form.rb new file mode 100644 index 0000000000..1511006318 --- /dev/null +++ b/app/forms/journeys/early_years_payment/practitioner/find_reference_form.rb @@ -0,0 +1,8 @@ +module Journeys + module EarlyYearsPayment + module Practitioner + class FindReferenceForm < Form + end + end + end +end diff --git a/app/forms/journeys/early_years_payment/practitioner/session_form.rb b/app/forms/journeys/early_years_payment/practitioner/session_form.rb new file mode 100644 index 0000000000..8fca617266 --- /dev/null +++ b/app/forms/journeys/early_years_payment/practitioner/session_form.rb @@ -0,0 +1,7 @@ +module Journeys + module EarlyYearsPayment + module Practitioner + class SessionForm < Journeys::SessionForm; end + end + end +end diff --git a/app/models/journeys.rb b/app/models/journeys.rb index 14f48c25ae..998095363d 100644 --- a/app/models/journeys.rb +++ b/app/models/journeys.rb @@ -12,7 +12,8 @@ def self.table_name_prefix FurtherEducationPayments, FurtherEducationPayments::Provider, EarlyYearsPayment::Provider::Start, - EarlyYearsPayment::Provider::Authenticated + EarlyYearsPayment::Provider::Authenticated, + EarlyYearsPayment::Practitioner ].freeze def all diff --git a/app/models/journeys/early_years_payment/practitioner.rb b/app/models/journeys/early_years_payment/practitioner.rb new file mode 100644 index 0000000000..ba53f0bb9f --- /dev/null +++ b/app/models/journeys/early_years_payment/practitioner.rb @@ -0,0 +1,18 @@ +module Journeys + module EarlyYearsPayment + module Practitioner + extend Base + extend self + + ROUTING_NAME = "early-years-payment-practitioner" + VIEW_PATH = "early_years_payment/practitioner" + I18N_NAMESPACE = "early_years_payment_practitioner" + POLICIES = [Policies::EarlyYearsPayments] + FORMS = { + "claims" => { + "find-reference" => FindReferenceForm + } + } + end + end +end diff --git a/app/models/journeys/early_years_payment/practitioner/eligibility_checker.rb b/app/models/journeys/early_years_payment/practitioner/eligibility_checker.rb new file mode 100644 index 0000000000..ae05c13f42 --- /dev/null +++ b/app/models/journeys/early_years_payment/practitioner/eligibility_checker.rb @@ -0,0 +1,8 @@ +module Journeys + module EarlyYearsPayment + module Practitioner + class EligibilityChecker < Journeys::EligibilityChecker + end + end + end +end diff --git a/app/models/journeys/early_years_payment/practitioner/session.rb b/app/models/journeys/early_years_payment/practitioner/session.rb new file mode 100644 index 0000000000..c4ccdc7d91 --- /dev/null +++ b/app/models/journeys/early_years_payment/practitioner/session.rb @@ -0,0 +1,9 @@ +module Journeys + module EarlyYearsPayment + module Practitioner + class Session < Journeys::Session + attribute :answers, SessionAnswersType.new + end + end + end +end diff --git a/app/models/journeys/early_years_payment/practitioner/session_answers.rb b/app/models/journeys/early_years_payment/practitioner/session_answers.rb new file mode 100644 index 0000000000..2d4065923d --- /dev/null +++ b/app/models/journeys/early_years_payment/practitioner/session_answers.rb @@ -0,0 +1,11 @@ +module Journeys + module EarlyYearsPayment + module Practitioner + class SessionAnswers < Journeys::SessionAnswers + def policy + nil + end + end + end + end +end diff --git a/app/models/journeys/early_years_payment/practitioner/session_answers_type.rb b/app/models/journeys/early_years_payment/practitioner/session_answers_type.rb new file mode 100644 index 0000000000..4c6a187669 --- /dev/null +++ b/app/models/journeys/early_years_payment/practitioner/session_answers_type.rb @@ -0,0 +1,7 @@ +module Journeys + module EarlyYearsPayment + module Practitioner + class SessionAnswersType < ::Journeys::SessionAnswersType; end + end + end +end diff --git a/app/models/journeys/early_years_payment/practitioner/slug_sequence.rb b/app/models/journeys/early_years_payment/practitioner/slug_sequence.rb new file mode 100644 index 0000000000..907ffa53b2 --- /dev/null +++ b/app/models/journeys/early_years_payment/practitioner/slug_sequence.rb @@ -0,0 +1,27 @@ +module Journeys + module EarlyYearsPayment + module Practitioner + class SlugSequence + SLUGS = %w[ + find-reference + ].freeze + + def self.start_page_url + Rails.application.routes.url_helpers.landing_page_path("early-years-payment-practitioner") + 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/views/early_years_payment/practitioner/landing_page.html.erb b/app/views/early_years_payment/practitioner/landing_page.html.erb new file mode 100644 index 0000000000..0a1d7677c5 --- /dev/null +++ b/app/views/early_years_payment/practitioner/landing_page.html.erb @@ -0,0 +1 @@ +landing pages goes here diff --git a/config/locales/en.yml b/config/locales/en.yml index fa32d94db9..4ebdac63b8 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1399,6 +1399,9 @@ en: early_years_payments: <<: *early_years_payment_provider_authenticated claim_subject: "Early Years Payment" + early_years_payment_practitioner: + journey_name: Claim an early years financial incentive payment - practitioner + feedback_email: implementme@example.com activerecord: errors: models: diff --git a/db/seeds.rb b/db/seeds.rb index 96d65f3a7f..a31537c92d 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -14,6 +14,7 @@ Journeys::Configuration.create!(routing_name: Journeys::FurtherEducationPayments::Provider::ROUTING_NAME, current_academic_year: AcademicYear.current) Journeys::Configuration.create!(routing_name: Journeys::EarlyYearsPayment::Provider::Start::ROUTING_NAME, current_academic_year: AcademicYear.current) Journeys::Configuration.create!(routing_name: Journeys::EarlyYearsPayment::Provider::Authenticated::ROUTING_NAME, current_academic_year: AcademicYear.current) + Journeys::Configuration.create!(routing_name: Journeys::EarlyYearsPayment::Practitioner::ROUTING_NAME, current_academic_year: AcademicYear.current) ENV["FIXTURES_PATH"] = "spec/fixtures" ENV["FIXTURES"] = "local_authorities,local_authority_districts,schools" diff --git a/spec/models/journeys_spec.rb b/spec/models/journeys_spec.rb index a7ac57d110..f83ffbcbf7 100644 --- a/spec/models/journeys_spec.rb +++ b/spec/models/journeys_spec.rb @@ -12,7 +12,8 @@ Journeys::FurtherEducationPayments, Journeys::FurtherEducationPayments::Provider, Journeys::EarlyYearsPayment::Provider::Start, - Journeys::EarlyYearsPayment::Provider::Authenticated + Journeys::EarlyYearsPayment::Provider::Authenticated, + Journeys::EarlyYearsPayment::Practitioner ]) end end @@ -26,7 +27,8 @@ Journeys::FurtherEducationPayments::ROUTING_NAME, Journeys::FurtherEducationPayments::Provider::ROUTING_NAME, Journeys::EarlyYearsPayment::Provider::Start::ROUTING_NAME, - Journeys::EarlyYearsPayment::Provider::Authenticated::ROUTING_NAME + Journeys::EarlyYearsPayment::Provider::Authenticated::ROUTING_NAME, + Journeys::EarlyYearsPayment::Practitioner::ROUTING_NAME ]) end end