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

CAPT 2121/expand topup functionality #3527

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rjlynch
Copy link
Contributor

@rjlynch rjlynch commented Jan 22, 2025

Allow topups for all policies

  • Updates the app to support topups for all policies
  • Adds a note to the case when a topup is created / removed
  • Fixes an edge case in displaying the payroll run.

Probably easiest to review each commit separately, or at least the bug fix on
the payroll run.

Now we need to check the number of topups for each policy we make a few extra
trips to the db when showing the payroll run. I investigated caching the line
items and performing the policy filtering in Ruby which saves ~200ms but makes
the code harder to follow. Opted against including this in the pr as the page
loads in about 500ms, but something to bear in mind if we want a bit of extra
performance.

@rjlynch rjlynch force-pushed the CAPT-2121/expand-topup-functionality branch 2 times, most recently from 4a5c587 to e7986ec Compare January 23, 2025 14:33
We'll be making topups availble on all polices so we don't want any
policy specific logic in the topup.
There was a bug in the previous payroll logic that couldn't handle the
following scenario

* Claimant paid for a claim (Claim A) in Jan payroll
* Claimant paid a topup on Claim A in Feb payroll
* Claimant paid for a claim (Claim B) in Feb payroll

In that scenario the claimant would receive the topup payment twice as
both Claim A and Claim B have the same payment and so when we joined
claims to payments and left joined payments to topup both rows would
have a topup, causing the coalesce to pick the topup amount.
@rjlynch rjlynch force-pushed the CAPT-2121/expand-topup-functionality branch from e7986ec to 6dec200 Compare January 23, 2025 15:18
Thankfully the original topup code used `Claim#topupable?` in most
places so supporting additional policies was straightforward.
A requirement is to add a note to the claim when we add or remove a
topup. We've introduced two form objects to handle generating the note
and amending the claim's topups.
@rjlynch rjlynch force-pushed the CAPT-2121/expand-topup-functionality branch from d8529d0 to a4af10f Compare January 24, 2025 13:27
@rjlynch rjlynch added the deploy Deploy a review app for this PR label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy Deploy a review app for this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant