-
Notifications
You must be signed in to change notification settings - Fork 1
feat: display more info in dashboard #214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
このPRは、スタッフ向けダッシュボードに統計情報と可視化機能を追加する機能改善です。
- 注文データの集計機能を実装し、サマリー統計、ステータス別分布、日次トレンドを表示
- Chart.jsを使用したグラフコンポーネントを追加
- 新しいユースケース層とリポジトリクエリを実装
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | chart.jsとuplotの依存関係を追加(uplotは未使用) |
| app/usecases/getStaffDashboardData.ts | ダッシュボードデータ集計のユースケースロジック実装 |
| app/infrastructure/domain/order/orderQueryRepositoryImpl.ts | ステータス集計と日次集計のクエリ実装を追加 |
| app/domain/order/repositories/orderQueryRepository.ts | 新しいクエリ関数の型定義とエクスポート |
| app/components/ui/$chart.tsx | Chart.jsラッパーコンポーネント(324行) |
| app/routes/staff/index.tsx | ダッシュボードページに統計カードとグラフを追加 |
| app/routes/staff/-components/*.tsx | 統計カード、ステータス分布、トレンドグラフのコンポーネント |
| app/style.css | uplotのCSS追加(未使用) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 11 out of 12 changed files in this pull request and generated 12 comments.
Move `addDays`, `startOfDay`, `endOfDay`, `buildDateRange`, and `formatDateKey` from usecase layer to utils layer following architecture guidelines. These functions are domain-agnostic utility functions that can be reused across the application, aligning with the architecture principle that utils should contain "small general-purpose functions and simple processing that can be used anywhere." 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Consolidate order status definitions to prevent duplication across layers: - Define ORDER_STATUSES in domain layer (app/domain/order/entities/order.ts) as single source of truth - Update orderCommandRepository to reference domain definition instead of maintaining separate ALLOWED_ORDER_STATUSES - Update getStaffDashboardData to derive status values from domain definition while keeping UI-specific labels in usecase layer This ensures status changes only require updates in one location, improving maintainability and reducing risk of inconsistencies. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Remove duplicate date manipulation functions from test file and import from app/utils/date.ts instead. This eliminates code duplication between implementation and tests, reducing maintenance burden and risk of bugs. The shared utilities are now consistently defined in a single location. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add minimal JSDoc comments to Chart component and its types for better developer experience. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| export type FindOrderStatusCounts = QueryRepositoryFunction< | ||
| Record<string, never>, | ||
| OrderStatusCount[] | ||
| > | ||
|
|
||
| export type FindDailyOrderAggregations = QueryRepositoryFunction< | ||
| { | ||
| from: Date | ||
| to: Date | ||
| }, | ||
| OrderDailyAggregation[] | ||
| > |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
配列を返す関数の型定義の命名はFindAllから始まり、PaginatedQueryRepositoryFunctionを利用して定義されます。
from, toをoffset, limitに変換するのはユースケース関数の責務です。
close #209