Skip to content

PM-5507: Match repeated engagement payments by date#2010

Draft
jmgasper wants to merge 1 commit into
devfrom
PM-5507
Draft

PM-5507: Match repeated engagement payments by date#2010
jmgasper wants to merge 1 commit into
devfrom
PM-5507

Conversation

@jmgasper

@jmgasper jmgasper commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

What was broken
Billing account detail rows for repeated engagement assignment payments could display member payment and challenge fee values derived from the current billing account markup instead of the actual finance payment split.

Root cause
The modal fetched finance payments by assignment id, but when several payments shared the same assignment and amount, the split matcher could not identify the specific finance row for the consumed billing row. It then fell back to markup-derived math, which drifted from persisted payment amounts when markup changed or finance did not expose a fee.

What was changed
Added day-level finance payment date matching before the existing exact amount and aggregate fallbacks. When a single finance payment date matches the billing ledger row, the modal uses that payment amount and infers the challenge fee from the ledger total if needed.

Any added/updated tests
Added a BillingAccountLineItemsModal regression test for repeated payments on the same engagement assignment. The focused spec passes and verifies the modal shows the actual finance payment amount and inferred fee instead of the markup-derived fallback.

Validation run:

  • yarn test:no-watch src/apps/work/src/lib/components/BillingAccountLineItemsModal/BillingAccountLineItemsModal.spec.tsx
  • yarn test:no-watch --runInBand (fails in unrelated existing suites outside this change)
  • yarn lint
  • yarn run build

What was broken
Billing account detail rows for repeated engagement assignment payments could display member payment and challenge fee values derived from the current billing account markup instead of the actual finance payment split.

Root cause
The modal fetched finance payments by assignment id, but when several payments shared the same assignment and amount, the split matcher could not identify the specific finance row for the consumed billing row. It then fell back to markup-derived math, which drifted from persisted payment amounts when markup changed or finance did not expose a fee.

What was changed
Added day-level finance payment date matching before the existing exact amount and aggregate fallbacks. When a single finance payment date matches the billing ledger row, the modal uses that payment amount and infers the challenge fee from the ledger total if needed.

Any added/updated tests
Added a BillingAccountLineItemsModal regression test that covers repeated engagement payments for the same assignment and verifies the modal shows the actual finance payment amount and inferred fee instead of the markup-derived fallback.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant