Skip to content

Commit

Permalink
WIP RESET running ci
Browse files Browse the repository at this point in the history
  • Loading branch information
rjlynch committed Jan 22, 2025
1 parent 6f0d1cb commit 4a5c587
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 5 additions & 0 deletions app/models/base_policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,9 @@ def task_available?(task)
def require_in_progress_update_emails?
true
end

# Overwrite this in the policies if they set a maximum topup amount
def max_topup_amount(claim)
Float::INFINITY
end
end
8 changes: 2 additions & 6 deletions app/models/claim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,11 @@ def payrolled?
end

def all_payrolled?
if has_lupp_policy?
topups.all? { |t| t.payrolled? } && payrolled?
else
payrolled?
end
topups.all? { |t| t.payrolled? } && payrolled?
end

def topupable?
has_lupp_policy? && submitted? && all_payrolled?
submitted? && all_payrolled?
end

def full_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
payment2 = create(:payment, :confirmed, :with_figures, claims: [claim], scheduled_payment_date: over_1_ago)

if claim.topupable?
user = create(:dfe_signin_user)
create(:topup, payment: payment2, claim: claim, award_amount: 500, created_by: user)
end

Expand Down

0 comments on commit 4a5c587

Please sign in to comment.