feat: Beefed up debt log#85
Conversation
There was a problem hiding this comment.
💡 Codex Review
CompoundInterestCalculator/src/web/src/DebtLogPage.tsx
Lines 667 to 668 in 8171874
After a strategy has been run, this success path refreshes the stored debt list but leaves the existing strategy state intact; adding another debt therefore keeps showing the old payoff order and totals in the Planner tab until the user manually reruns the comparison. Clear or recompute the strategy on successful debt/ledger mutations so the displayed plan matches the current balances.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| var monthDebts = states | ||
| .Where(state => state.Balance > 0m) | ||
| .ToDictionary( | ||
| state => state.ClientDebtId, | ||
| state => new DebtStrategyMonthDebtAccumulator(state.ClientDebtId, state.Name, state.Balance)); |
There was a problem hiding this comment.
Reject duplicate debt strategy IDs before simulating
When an API client submits two debts with the same clientDebtId, this ToDictionary throws for the duplicate key; the validator only checks that IDs are non-empty, so CalculateStrategy falls into its generic exception handler and returns a 500 instead of a validation problem. Since the IDs are caller-provided and are used as map keys throughout the response, validate uniqueness up front or avoid keying the simulation by a non-unique field.
Useful? React with 👍 / 👎.
No description provided.