Skip to content

Fix budget expense ordering - #272

Open
ryanduguid wants to merge 1 commit into
pledger-io:masterfrom
ryanduguid:fix-budget-expense-ordering
Open

Fix budget expense ordering#272
ryanduguid wants to merge 1 commit into
pledger-io:masterfrom
ryanduguid:fix-budget-expense-ordering

Conversation

@ryanduguid

Copy link
Copy Markdown

Proposed change

Sort mapped budget expenses case-insensitively by name before publishing the domain list. Expense IDs provide a deterministic tie-breaker when names compare equally.

This keeps budget cards in the same order across reloads even though the persisted expenses originate from an unordered set. Focused mapper tests cover reverse source order and duplicate names.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the application)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Verification

  • ./gradlew test --tests 'com.jongsoft.finance.budget.domain.jpa.mapper.BudgetMapperTest' --tests 'com.jongsoft.finance.budget.domain.jpa.BudgetProviderJpaIT' --rerun-tasks -q — passed (6 tests)
  • ./gradlew classes -q — passed
  • ./gradlew check -x classes -q — 234 tests completed with one unrelated failure: BankAccountTest.createSavingsAccountWithGoals expects monthsLeft 6 but receives 5. The same failure was reproduced on untouched master.

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

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.

[Bug]: Budget ordering different every page load

1 participant