feat: implement earnings and payments dashboard with data parsing and…#1
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “Incentives & Earnings” analytics area to the app (alongside existing billing and pricing tooling), including CSV parsing via Web Workers, IndexedDB persistence, and new dashboards/visualizations.
Changes:
- Introduces earnings/payments CSV parsing (Web Workers + parser utilities) and a dedicated
useEarningsStorepersisted in IndexedDB. - Adds a new
EarningsViewanalytics dashboard (charts, drill-downs, exports) and hooks it into app navigation/home dashboard. - Adds a new
RenewalCalendarview and updates docs/metadata to reflect the expanded feature set.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/workers/payments.worker.ts | Parses Partner Center Payments CSVs in a worker (header detection + row mapping). |
| src/workers/earnings.worker.ts | Parses Partner Center Earnings CSVs in a worker (header detection + row mapping). |
| src/utils/paymentsParser.ts | Worker wrapper for payments parsing + summary meta computation. |
| src/utils/earningsParser.ts | Worker wrapper for earnings parsing + summary meta computation. |
| src/utils/earningsDb.ts | IndexedDB schema + persistence helpers for earnings and payments datasets. |
| src/types/EarningsData.ts | Adds typed data models and parse-result/meta contracts for earnings & payments. |
| src/store/earningsStore.ts | Zustand store for earnings/payments with persistence + append/reset/load operations. |
| src/components/HomeDashboard.tsx | Adds an “Incentives & Earnings” entry card and wiring to navigation. |
| src/components/EarningsView.tsx | New analytics dashboard UI (charts, tables, drill-downs, exports, payments tab). |
| src/components/RenewalCalendar.tsx | New renewal calendar/list UI with export and EST/NCE indicators. |
| src/App.tsx | Integrates new views into app navigation and restores earnings state on startup. |
| README.md | Documents incentives/earnings features and Partner Center export locations. |
| package.json | Updates app description to include incentives analytics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Agent-Logs-Url: https://github.com/hardinxcore/CSPInsights.app/sessions/84c0f4ee-4957-4eae-803a-ffc37c508e06 Co-authored-by: hardinxcore <34623288+hardinxcore@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…nts workers Agent-Logs-Url: https://github.com/hardinxcore/CSPInsights.app/sessions/a5327b9b-ade6-4099-a80f-13291322a228 Co-authored-by: hardinxcore <34623288+hardinxcore@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
EST_LAUNCH_DATEcomment inRenewalCalendar.tsxto match the constant value (2025-05-04instead of2025-05-05)earnings.worker.tsandpayments.worker.tsby normalizing both the line and expected column names to lowercase before comparison