Skip to content

Conversation

@r4ai
Copy link
Member

@r4ai r4ai commented Nov 18, 2025

close #209

@r4ai r4ai requested a review from sou1118 as a code owner November 18, 2025 15:33
Copilot AI review requested due to automatic review settings November 18, 2025 15:33
@r4ai r4ai requested a review from 3w36zj6 as a code owner November 18, 2025 15:33
Copy link
Contributor

Copilot AI left a 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追加(未使用)

Copy link
Contributor

Copilot AI left a 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.

r4ai and others added 3 commits November 19, 2025 17:44
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>
Copy link
Contributor

Copilot AI left a 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.

Comment on lines 40 to 51
export type FindOrderStatusCounts = QueryRepositoryFunction<
Record<string, never>,
OrderStatusCount[]
>

export type FindDailyOrderAggregations = QueryRepositoryFunction<
{
from: Date
to: Date
},
OrderDailyAggregation[]
>
Copy link
Member

Choose a reason for hiding this comment

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

配列を返す関数の型定義の命名はFindAllから始まり、PaginatedQueryRepositoryFunctionを利用して定義されます。
from, tooffset, limitに変換するのはユースケース関数の責務です。

@3w36zj6 3w36zj6 self-requested a review November 22, 2025 00:00
@3w36zj6 3w36zj6 marked this pull request as draft November 22, 2025 02:18
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.

ダッシュボードに表示する情報を増やす

4 participants