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

[LUPEYALPHA-1173] EY claim rejection reasons #3341

Closed
wants to merge 1 commit into from
Closed
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
3 changes: 2 additions & 1 deletion app/models/policies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ module Policies
EarlyCareerPayments,
LevellingUpPremiumPayments,
InternationalRelocationPayments,
FurtherEducationPayments
FurtherEducationPayments,
EarlyYearsPayments
].freeze

AMENDABLE_ELIGIBILITY_ATTRIBUTES = POLICIES.map do |policy|
Expand Down
9 changes: 9 additions & 0 deletions app/models/policies/early_years_payments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ module EarlyYearsPayments
# NOOP as PERSONAL_DATA_ATTRIBUTES_TO_RETAIN_FOR_EXTENDED_PERIOD is empty
EXTENDED_PERIOD_END_DATE = ->(start_of_academic_year) {}

# Options shown to admins when rejecting a claim
ADMIN_DECISION_REJECTED_REASONS = [
:claim_cancelled_by_employer,
:six_month_retention_check_failed,
:duplicate,
:no_response,
:other
]

# TODO: This is needed once the reply-to email address has been added to Gov Notify
def notify_reply_to_id
nil
Expand Down
2 changes: 2 additions & 0 deletions app/models/policies/early_years_payments/eligibility.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module Policies
module EarlyYearsPayments
class Eligibility < ApplicationRecord
AMENDABLE_ATTRIBUTES = [].freeze

self.table_name = "early_years_payment_eligibilities"

has_one :claim, as: :eligibility, inverse_of: :eligibility
Expand Down
8 changes: 8 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1418,6 +1418,14 @@ en:
early_years_payments:
<<: *early_years_payment_provider_authenticated
claim_subject: "Early Years Payment"
admin:
decision:
rejected_reasons:
claim_cancelled_by_employer: Claim cancelled by employer
six_month_retention_check_failed: 6 month retention check failed
duplicate: Duplicate
no_response: No response
other: Other
early_years_payment_practitioner:
journey_name: Claim an early years financial incentive payment - practitioner
feedback_email: "[email protected]"
Expand Down
36 changes: 36 additions & 0 deletions spec/models/decision_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@
:other
]
end
let(:expected_reasons_ey) do
[
:claim_cancelled_by_employer,
:six_month_retention_check_failed,
:duplicate,
:no_response,
:other
]
end

context "when the claim policy is ECP" do
let(:policy) { Policies::EarlyCareerPayments }
Expand All @@ -156,6 +165,12 @@

it { is_expected.to eq(expected_reasons_tslr) }
end

context "when the claim policy is EY" do
let(:policy) { Policies::EarlyYearsPayments }

it { is_expected.to eq(expected_reasons_ey) }
end
end

describe "#rejected_reasons_hash" do
Expand Down Expand Up @@ -236,6 +251,27 @@
)
end
end

context "with an EY claim" do
let(:rejected_reasons) do
{
rejected_reasons_claim_cancelled_by_employer: "1",
rejected_reasons_six_month_retention_check_failed: "1"
}
end

let(:claim) { create(:claim, policy: Policies::EarlyYearsPayments) }

it do
is_expected.to eq(
reason_claim_cancelled_by_employer: "1",
reason_six_month_retention_check_failed: "1",
reason_duplicate: "0",
reason_no_response: "0",
reason_other: "0"
)
end
end
end

describe "#selected_rejected_reasons" do
Expand Down
Loading