feat: カテゴリーフィルタ時に合計金額を表示する#1141
Open
yasumorishima wants to merge 6 commits intoteam-mirai:developfrom
Open
Conversation
カテゴリーフィルタが選択されている場合に、フィルタされた全取引の 合計金額をテーブル上部に表示する機能を追加。 - ITransactionListRepository に getTotalAmount() を追加 - PrismaTransactionRepository で groupBy を用いた合計金額集計を実装 - GetTransactionsBySlugUsecase の結果に totalAmount を追加(categories フィルタなしの場合は null) - InteractiveTransactionTable にフィルター合計表示を追加(収入は緑・ 支出は赤の符号付き表示) - テスト: getTotalAmount の呼び出し有無を検証するケースを追加 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
フォーク専用のセキュリティ解析ワークフロー。 upstream PRには含めない。 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…mountアサーション追加 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
|
@yasumorishima is attempting to deploy a commit to the team-mirai Team on Vercel. A member of the Team first needs to authorize it. |
Walkthroughカテゴリーでフィルタされた取引の合計金額を表示する機能を追加します。UIコンポーネント、ユースケース、リポジトリインターフェース、実装層、テストにわたって、取引の合計額を計算して表示するための機能を統合します。 Changes
Sequence Diagram(s)sequenceDiagram
participant Client as クライアント
participant Page as TransactionsPage
participant UseCase as GetTransactionsBySlugUsecase
participant Repo as PrismaTransactionRepository
participant DB as Database
Client->>Page: トランザクション一覧をリクエスト (カテゴリーフィルタ付き)
Page->>UseCase: execute(filters)を呼び出し
UseCase->>Repo: findAll(filters)でトランザクション一覧を取得
Repo->>DB: フィルタ条件で問い合わせ
DB-->>Repo: トランザクションデータ
Repo-->>UseCase: transactions[]
alt カテゴリーフィルタが存在する場合
UseCase->>Repo: getTotalAmount(filters)で合計額を計算
Repo->>DB: フィルタ条件で集計
DB-->>Repo: 合計額(数値)
Repo-->>UseCase: totalAmount: number
else カテゴリーフィルタが存在しない場合
UseCase->>UseCase: totalAmount = null
end
UseCase-->>Page: GetTransactionsBySlugResult {transactions, totalAmount, ...}
Page->>InteractiveTransactionTable: totalAmountプロップを渡す
InteractiveTransactionTable->>InteractiveTransactionTable: 合計額を通貨フォーマットして表示
InteractiveTransactionTable-->>Client: 取引一覧と合計額を表示
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
概要
Closes #248
カテゴリーフィルタが選択されている場合に、フィルタされた全取引の合計金額をテーブル上部に表示します。
変更内容
transaction-list-repository.interface.ts—getTotalAmount()を追加prisma-transaction.repository.ts— groupByで合計金額を集計get-transactions-by-slug-usecase.ts—totalAmountをresultに追加page.tsx—totalAmountをコンポーネントに渡すInteractiveTransactionTable.tsx— フィルター合計表示UI追加get-transactions-by-slug-usecase.test.ts— テスト追加仕様
テスト
Summary by CodeRabbit
リリースノート