From dc5d1d418f3b2976566c8b1b62a6f91d1da1676c Mon Sep 17 00:00:00 2001 From: Richard Lynch Date: Thu, 29 Aug 2024 16:31:42 +0100 Subject: [PATCH] Update the verification due date We want the verification due date to be 2 weeks after the claim is submitted. This commit also moves the knowledge of the due date to the policy (it's a policy concern not eligibility concern) and updates the formatting of the dates in the emails to be consistent with our other emails. --- app/mailers/claim_mailer.rb | 4 ++-- app/models/policies/further_education_payments.rb | 4 ++++ .../policies/further_education_payments/eligibility.rb | 5 ----- .../claim_submission_form_spec.rb | 8 +++++--- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/mailers/claim_mailer.rb b/app/mailers/claim_mailer.rb index 0736e6ed1b..5c6cef5cba 100644 --- a/app/mailers/claim_mailer.rb +++ b/app/mailers/claim_mailer.rb @@ -89,8 +89,8 @@ def further_education_payment_provider_verification_email(claim) recipient_name: claim.school.name, claimant_name: claim.full_name, claim_reference: claim.reference, - claim_submission_date: claim.created_at.to_s(:govuk_date), - verification_due_date: claim.eligibility.verification_deadline.to_s(:govuk_date), + claim_submission_date: l(claim.created_at.to_date), + verification_due_date: l(Policies::FurtherEducationPayments.verification_due_date_for_claim(claim)), verification_url: Journeys::FurtherEducationPayments::Provider::SlugSequence.verify_claim_url(claim) } diff --git a/app/models/policies/further_education_payments.rb b/app/models/policies/further_education_payments.rb index 93b240015a..967c287c49 100644 --- a/app/models/policies/further_education_payments.rb +++ b/app/models/policies/further_education_payments.rb @@ -21,5 +21,9 @@ module FurtherEducationPayments def notify_reply_to_id nil end + + def verification_due_date_for_claim(claim) + (claim.created_at + 2.weeks).to_date + end end end diff --git a/app/models/policies/further_education_payments/eligibility.rb b/app/models/policies/further_education_payments/eligibility.rb index 97a8ff285b..233d9ce9c9 100644 --- a/app/models/policies/further_education_payments/eligibility.rb +++ b/app/models/policies/further_education_payments/eligibility.rb @@ -53,11 +53,6 @@ def fixed_contract? def verified? verification.present? end - - # FIXME LUPEYALPHA-923 - def verification_deadline - created_at + 1.week - end end end end diff --git a/spec/forms/journeys/further_education_payments/claim_submission_form_spec.rb b/spec/forms/journeys/further_education_payments/claim_submission_form_spec.rb index 070055035a..16e4eb58c4 100644 --- a/spec/forms/journeys/further_education_payments/claim_submission_form_spec.rb +++ b/spec/forms/journeys/further_education_payments/claim_submission_form_spec.rb @@ -64,7 +64,9 @@ it "emails the claim provider" do allow(ClaimVerifierJob).to receive(:perform_later) - perform_enqueued_jobs { subject } + travel_to DateTime.new(2024, 3, 1, 0, 0, 0) do + perform_enqueued_jobs { subject } + end claim = form.claim @@ -74,8 +76,8 @@ recipient_name: claim.school.name, claimant_name: [answers.first_name, answers.surname].join(" "), claim_reference: claim.reference, - claim_submission_date: claim.submitted_at.to_s(:govuk_date), - verification_due_date: claim.eligibility.verification_deadline.to_s(:govuk_date), + claim_submission_date: "1 March 2024", + verification_due_date: "15 March 2024", verification_url: Journeys::FurtherEducationPayments::Provider::SlugSequence.verify_claim_url(claim) ) )