Add tests for Purchases aggregate in Balance View detailed balance #237
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nidde/parenting-tool!237
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "copilot/fix-purchases-category-in-balance-view"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After the previous update grouping purchases into a single aggregate item on the Balance View, the "Purchases" category was not appearing. Root cause: stale 24-hour cache from before the update. The code itself was correct — the aggregate entry is only pushed when
$purchasesTotal > 0, so the item appears correctly once cache expires or a purchase is modified.Description
BalanceTest.phpverifyinggetDetailedMonthlyBalance()behavior:is_purchase: true, andcategory->name: 'Purchases'when purchases exist in the periodBalanceService::getDetailedMonthlyBalance()that still referenced "individual purchase records" instead of the single aggregate approachType of Change
Testing
Code Quality
CI/CD Checks
Additional Notes
The "Purchases" category not appearing immediately after deployment is a cache issue, not a code bug. The cached detailed balance result (24h TTL) was generated before the aggregation change. It self-resolves when
PurchaseObserverinvalidates the cache on any purchase mutation, or after TTL expiry.Comment
@coderabbitai helpto get the list of available commands and usage tips.Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.