Skip to content

Add BestDays and TopCustomers tables to StatisticPage#51

Open
IanTheMitten wants to merge 1 commit into
mainfrom
codex/add-bestdaystable-and-topcustomerstable
Open

Add BestDays and TopCustomers tables to StatisticPage#51
IanTheMitten wants to merge 1 commit into
mainfrom
codex/add-bestdaystable-and-topcustomerstable

Conversation

@IanTheMitten

Copy link
Copy Markdown
Owner

Motivation

  • Surface the top-performing dates and students in the Statistic view so operators can quickly see highest revenue days and highest spending customers.
  • Ensure these rankings respect the same sampled weekday selection controlled by the existing statistic date-range and seed controls.

Description

  • Added helper analytics in src/components/statistic/rankingAnalytics.ts with topDaysByRevenue(transactions, limit) and topCustomers(transactions, students, limit) to compute ranked rows.
  • Added UI components src/components/statistic/BestDaysTable.tsx and src/components/statistic/TopCustomersTable.tsx that render the top 10 rows; BestDaysTable shows Date, Weekday, Revenue, Tx Count, and TopCustomersTable shows Student, Grade, Spend, Visits, Avg Spend / Visit.
  • Integrated both tables into src/components/statistic/StatisticPage.tsx by computing filteredTransactions from getSampledTransactionDates(...)/getDayKey(...) and rendering the two tables in a two-column grid below the charts.
  • Updated src/App.tsx to pass students into StatisticPage so customer names/grades can be resolved in the top customers table.

Testing

  • Ran the production build with npm run build, which completed successfully.
  • No automated unit tests were added or run as part of this change.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant