Skip to content

Commit

Permalink
Initial IRP journey wire up
Browse files Browse the repository at this point in the history
This commit adds the initial set up for IRP along with a some feature
test.
So far the IRP journey lets a user click "Start now" and then
shows the check your answers page where they can submit a claim.
The feature test has some temporary hacks, where we update the database
model, this is just required to get the answers in a state that passes
the validations on the claim. We'll be removing the
`teacher_reference_number` question and (probably) the `payroll_gender`
question from the IRP journey but they're currently required.
  • Loading branch information
rjlynch committed Jun 20, 2024
1 parent abcde18 commit 0451af4
Show file tree
Hide file tree
Showing 26 changed files with 537 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module Journeys
module GetATeacherRelocationPayment
class ClaimSubmissionForm < ::ClaimSubmissionBaseForm
private

def main_eligibility
@main_eligibility ||= eligibilities.first
end

def calculate_award_amount(eligibility)
# NOOP
# This is just for compatibility with the AdditionalPaymentsForTeaching
# claim submission form.
end

def generate_policy_options_provided
[]
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 @@ -7,7 +7,8 @@ def self.table_name_prefix

JOURNEYS = [
AdditionalPaymentsForTeaching,
TeacherStudentLoanReimbursement
TeacherStudentLoanReimbursement,
GetATeacherRelocationPayment
].freeze

def all
Expand Down
14 changes: 14 additions & 0 deletions app/models/journeys/get_a_teacher_relocation_payment.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module Journeys
module GetATeacherRelocationPayment
extend Base
extend self

ROUTING_NAME = "get-a-teacher-relocation-payment"
VIEW_PATH = "get_a_teacher_relocation_payment"
I18N_NAMESPACE = "get_a_teacher_relocation_payment"
POLICIES = [Policies::InternationalRelocationPayments]
FORMS = {
"claims" => {}
}
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Journeys
module GetATeacherRelocationPayment
class EligibilityChecker < Journeys::EligibilityChecker
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Journeys
module GetATeacherRelocationPayment
class Session < Journeys::Session
attribute :answers, SessionAnswersType.new
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Journeys
module GetATeacherRelocationPayment
class SessionAnswers < Journeys::SessionAnswers
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module Journeys
module GetATeacherRelocationPayment
class SessionAnswersType < ::Journeys::SessionAnswersType; end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module Journeys
module GetATeacherRelocationPayment
class SlugSequence
# FIXME RL due to how the page sequence works we need a minimum of 2
# slugs otherwise there's no next slug to go to. Once we have added
# another page remove the duplicate "check-your-answers" slug.
RESULTS_SLUGS = [
"check-your-answers",
"check-your-answers"
].freeze

SLUGS = RESULTS_SLUGS

def self.start_page_url
if Rails.env.production?
"https://www.gov.uk/government/publications/international-relocation-payments/international-relocation-payments"
else
Rails.application.routes.url_helpers.landing_page_path("get-a-teacher-relocation-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
4 changes: 4 additions & 0 deletions app/models/policies/international_relocation_payments.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module Policies
module InternationalRelocationPayments
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Policies
module InternationalRelocationPayments
class Eligibility < ApplicationRecord
self.table_name = "international_relocation_payments_eligibilities"

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

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

delegate_missing_to :answers

def initialize(answers:)
@answers = answers
end

def status
:eligible_now
end

def ineligible?
false
end
end
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<% content_for(
:page_title,
page_title(
"Check your answers before sending your application",
journey: current_journey_routing_name,
)
) %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-xl">
Check your answers before sending your application
</h1>

<%= form_for @form, url: claim_submission_path, method: :post, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<%= f.govuk_error_summary %>

<h2 class="govuk-heading-m"><%= t("check_your_answers.heading_send_application") %></h2>

<p class="govuk-body"><%= t("check_your_answers.statement") %></p>

<div class="govuk-form-group">
<%= f.govuk_submit t("check_your_answers.btn_text") %>
</div>
<% end %>
</div>
</div>
120 changes: 120 additions & 0 deletions app/views/get_a_teacher_relocation_payment/landing_page.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<h1 class="govuk-heading-xl">Apply for the international relocation payment</h1>
</div>
</div>

<div class="govuk-grid-row">
<div class="govuk-grid-column-full">
<p class="govuk-body">
The international relocation payment (IRP) is a single payment of £10,000,
funded by the UK government, which is available to eligible non-UK trainees and teachers of:
</p>

<ul class="govuk-list govuk-list--bullet">
<li>languages</li>
<li>physics</li>
<li>general or combined science when that includes physics</li>
</ul>

<p class="govuk-body">
Only teachers and salaried trainees need to complete this form.
</p>

<p class="govuk-body">
Before starting your application, visit
<%= govuk_link_to(
"Get an international relocation payment",
"https://getintoteaching.education.gov.uk/non-uk-teachers/get-an-international-relocation-payment",
target: "_blank"
) %>
to check the criteria you must meet to receive the IRP. You need to have started your job or course before you can apply.
</p>

<p class="govuk-body">
You should also get your documents and information ready, as you will
not be able to save your entries and return to the form later. It should
take approximately 15 minutes to complete.
</p>


<h2 class="govuk-heading-l">Documents and information to get ready</h2>

<p class="govuk-body">
You will need:
</p>

<ul class="govuk-list govuk-list--bullet">
<li>
if you are a teacher, your teaching subject and the terms of your employment contract
</li>
<li>
if you are a salaried trainee, details of your teacher training course, including
teaching subject and start date
</li>
<li>
your visa type and when you entered the UK
</li>
<li>
your passport
</li>
<li>
your address in England
</li>
<li>
contact details for the school where you are employed as a teacher or trainee
</li>
</ul>

<p class="govuk-body">
<a href="<%= claim_path(current_journey_routing_name, "claim") %>" role="button" draggable="false" class="govuk-button govuk-button--start" data-module="govuk-button">
Start
<svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" aria-hidden="true" focusable="false">
<path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z"/>
</svg>
</a>
</p>

<h2 class="govuk-heading-l">Deadline for applications</h2>

<p class="govuk-body">
Applications for the international relocation payment (IRP) are open from:
</p>

<ul class="govuk-list govuk-list--bullet">
<li>2 April to 16 June 2024</li>
</ul>

<p class="govuk-body">
If you have started your teaching job or salaried teacher training
course, you should apply now. If you are eligible, you should receive
the money by 30 September 2024.
</p>

<p class="govuk-body">
To remain eligible for the IRP, you must apply in either the first or
second term of your employment as a teacher or salaried trainee.
</p>
<p class="govuk-body">
Applications will re-open later in 2024.
</p>

<h2 class="govuk-heading-l">Not ready to apply?</h2>
<p class="govuk-body">
If you have not started your job or course, please visit
<%= govuk_link_to(
"Get an international relocation payment",
"https://getintoteaching.education.gov.uk/non-uk-teachers/get-an-international-relocation-payment",
target: "_blank"
) %>
for information about future applications.
</p>

<h2 class="govuk-heading-m">Contact us</h2>

<p class="govuk-body">
For help, please email us at
<%= govuk_link_to("[email protected]", "mailto:[email protected]")%>.
</p>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<% content_for(:page_title, page_title("Claim submitted", journey: current_journey_routing_name)) %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">

<div class="govuk-panel govuk-panel--confirmation">
<h1 class="govuk-panel__title" id="submitted-title">Claim submitted</h1>

<div class="govuk-panel__body">
Your reference number<br>
<strong><%= submitted_claim.reference %></strong>
</div>
</div>

<p class="govuk-body">
We have sent you a confirmation email to <%= submitted_claim.email_address %>.
</p>

<h2 class="govuk-heading-m">What happens next</h2>

<%= render partial: "submissions/confirmation" %>

<p class="govuk-body">
<%= link_to "What do you think of this service?", done_page_url, class: "govuk-link" %>
(takes 30 seconds)
</p>
</div>
</div>

4 changes: 4 additions & 0 deletions config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ shared:
- eligible_degree_subject
- induction_completed
- school_somewhere_else
:international_relocation_payments_eligibilities:
- id
- created_at
- updated_at
:schools:
- id
- urn
Expand Down
5 changes: 5 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,11 @@ en:
claim_amount_description: "Additional payment for teaching"
support_email_address: "[email protected]"
information_provided_further_details_link_text: levelling up premium payment (opens in new tab)
get_a_teacher_relocation_payment:
journey_name: "Get a teacher relocation payment"
feedback_email: "[email protected]"
claim_description: "for a get a teacher relocation payment"

activerecord:
errors:
models:
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def matches?(request)
resources :reminders, only: [:show, :update], param: :slug, constraints: {slug: %r{#{Journeys::AdditionalPaymentsForTeaching::SlugSequence::REMINDER_SLUGS.join("|")}}}, controller: "journeys/additional_payments_for_teaching/reminders"
end

scope path: "/", constraints: {journey: /student-loans|additional-payments/} do
scope path: "/", constraints: {journey: /student-loans|additional-payments|get-a-teacher-relocation-payment/} do
get "landing-page", to: "static_pages#landing_page", as: :landing_page
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
class CreatePoliciesRelocationPaymentsEligibilities < ActiveRecord::Migration[7.0]
def change
create_table :international_relocation_payments_eligibilities, id: :uuid do |t|
t.timestamps
end
end
end
7 changes: 6 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.0].define(version: 2024_05_10_144004) do
ActiveRecord::Schema[7.0].define(version: 2024_06_18_143941) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"
enable_extension "pgcrypto"
Expand Down Expand Up @@ -180,6 +180,11 @@
t.datetime "updated_at", null: false
end

create_table "international_relocation_payments_eligibilities", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end

create_table "journey_configurations", primary_key: "routing_name", id: :string, force: :cascade do |t|
t.boolean "open_for_submissions", default: true, null: false
t.string "availability_message"
Expand Down
1 change: 1 addition & 0 deletions db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
if Rails.env.development? || ENV["ENVIRONMENT_NAME"].start_with?("review")
Journeys::Configuration.create!(routing_name: Journeys::TeacherStudentLoanReimbursement::ROUTING_NAME, current_academic_year: AcademicYear.current)
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)

ENV["FIXTURES_PATH"] = "spec/fixtures"
ENV["FIXTURES"] = "local_authorities,local_authority_districts,schools"
Expand Down
Loading

0 comments on commit 0451af4

Please sign in to comment.