Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EY practitioner scaffolding #3230

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Journeys
module EarlyYearsPayment
module Practitioner
class FindReferenceForm < Form
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Journeys
module EarlyYearsPayment
module Practitioner
class SessionForm < Journeys::SessionForm; end
end
end
end
3 changes: 2 additions & 1 deletion app/models/journeys.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions app/models/journeys/early_years_payment/practitioner.rb
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module Journeys
module EarlyYearsPayment
module Practitioner
class EligibilityChecker < Journeys::EligibilityChecker
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Journeys
module EarlyYearsPayment
module Practitioner
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 Practitioner
class SessionAnswers < Journeys::SessionAnswers
def policy
nil
end
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Journeys
module EarlyYearsPayment
module Practitioner
class SessionAnswersType < ::Journeys::SessionAnswersType; end
end
end
end
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
landing pages goes here
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
activerecord:
errors:
models:
Expand Down
1 change: 1 addition & 0 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 4 additions & 2 deletions spec/models/journeys_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down