Skip to content

fix(stats): Exclude transfer transactions from aggregation statistics#67

Merged
nfebe merged 1 commit intodevfrom
fix/exclude-transfers-from-stats
Apr 3, 2026
Merged

fix(stats): Exclude transfer transactions from aggregation statistics#67
nfebe merged 1 commit intodevfrom
fix/exclude-transfers-from-stats

Conversation

@nfebe
Copy link
Copy Markdown
Contributor

@nfebe nfebe commented Apr 3, 2026

Transfers between accounts were incorrectly counted as income/expense in client-side calculations, causing wrong top sources.

@sourceant
Copy link
Copy Markdown

sourceant bot commented Apr 3, 2026

Code Review Summary

The PR fixes a bug where internal transfers were inflating income and expense statistics. It updates several client-side aggregation functions and enhances the API data transformation logic to include more detailed activity metrics.

🚀 Key Improvements

  • Excluded transfers from PartyBreakdown and CategoryBreakdown calculations.
  • Optimized transaction iteration in the statistics calculation logic.
  • Improved the WalletStatistics transformation by mapping new fields like transaction_count, average_transaction, and frequency_analysis.

💡 Minor Suggestions

  • Centralize the transfer filtering logic to avoid repetition.
  • Use object destructuring with defaults for cleaner API data handling.
  • Ensure amount and percentage are handled correctly for 'most used' items instead of defaulting to 0.

Copy link
Copy Markdown

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. See the overview comment for a summary.

Comment thread composables/useStatistics.ts Outdated
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 3, 2026

Deploying webui with  Cloudflare Pages  Cloudflare Pages

Latest commit: f1480ee
Status: ✅  Deploy successful!
Preview URL: https://1e245b3b.webui-9fh.pages.dev
Branch Preview URL: https://fix-exclude-transfers-from-s.webui-9fh.pages.dev

View logs

@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Apr 3, 2026

Deploying trakli-dev with  Cloudflare Pages  Cloudflare Pages

Latest commit: f1480ee
Status: ✅  Deploy successful!
Preview URL: https://934e545a.trakli-dev.pages.dev
Branch Preview URL: https://fix-exclude-transfers-from-s.trakli-dev.pages.dev

View logs

@nfebe nfebe force-pushed the fix/exclude-transfers-from-stats branch from 2d02bf3 to c0f3857 Compare April 3, 2026 11:32
Copy link
Copy Markdown

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. No specific code suggestions were generated. See the overview comment for a summary.

@nfebe nfebe force-pushed the fix/exclude-transfers-from-stats branch from c0f3857 to 84d82c4 Compare April 3, 2026 11:59
Copy link
Copy Markdown

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. See the overview comment for a summary.

Comment thread tests/composables/useStatistics.test.ts
@nfebe nfebe force-pushed the fix/exclude-transfers-from-stats branch from 84d82c4 to f145282 Compare April 3, 2026 12:02
Copy link
Copy Markdown

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. See the overview comment for a summary.

Comment thread composables/useStatistics.ts Outdated
Transfers between accounts were incorrectly counted as income/expense
in client-side calculations, causing wrong top sources.
@nfebe nfebe force-pushed the fix/exclude-transfers-from-stats branch from f145282 to f1480ee Compare April 3, 2026 12:23
Copy link
Copy Markdown

@sourceant sourceant bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review complete. See the overview comment for a summary.

Comment thread composables/useStatistics.ts
Comment thread composables/useStatistics.ts
@nfebe nfebe merged commit 455276b into dev Apr 3, 2026
5 checks passed
@nfebe nfebe deleted the fix/exclude-transfers-from-stats branch April 3, 2026 12:44
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