Skip to content

購入報告をuserIdで登録するようフロントエンドを更新#1061

Open
Chikuwa0141 wants to merge 3 commits intodevelopfrom
feat/Chikuwa/buy-report-paid-by-user-id-frontend
Open

購入報告をuserIdで登録するようフロントエンドを更新#1061
Chikuwa0141 wants to merge 3 commits intodevelopfrom
feat/Chikuwa/buy-report-paid-by-user-id-frontend

Conversation

@Chikuwa0141
Copy link
Collaborator

対応Issue

https://nut-m-e-g.slack.com/archives/C020WQ3GY07/p1766662579010449

概要

  • 購入報告の立替者を、手入力文字列中心から paidByUserId 中心に変更しました
  • 購入報告の「立替者」欄は手入力を廃止し、表示専用(readOnly)に変更しました。見た目も編集画面と同じ薄いグレーにしています

画面スクリーンショット等

image image

テスト項目

  • 購入報告が正常に行われること
  • 購入報告一覧より、立替者名が表示されること
  • 購入報告一覧より、購入報告の編集が行えること

備考

  • テストの際は、http://localhost:3000/yearperiodsにアクセスして2026を作成、予算管理ページで新たに部門、物品を作成、userへの部門割り当てを行わないとMy Pageから購入報告できないと思います

@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

このプルリクエストは、購入報告システムにおける立替者の管理を強化し、ユーザーエクスペリエンスを向上させることを目的としています。具体的には、立替者をユーザーIDで追跡するように変更し、新規報告作成時にはログインユーザーを自動的に設定し、このフィールドを読み取り専用にすることで、データの正確性を高めています。また、購入報告一覧画面での表示もこの新しいユーザーIDベースのロジックに対応しています。

Highlights

  • 購入報告の立替者管理の改善: 購入報告における立替者の管理方法を、手入力の文字列からユーザーIDを基盤とする方式に更新しました。これにより、データの整合性が向上し、ユーザーエクスペリエンスが改善されます。
  • フロントエンドの入力フォーム変更: 購入報告の作成・編集画面において、「立替者」フィールドが読み取り専用となり、ログイン中のユーザー名が自動的に設定されるようになりました。これにより、手入力の手間が省かれ、入力ミスが減少します。
  • APIモデルの更新: BuyReport、BuyReportDetail、BuyReportWithDivisionIdの各APIモデルにpaidByUserIdフィールドが追加され、立替者をユーザーIDで管理できるようになりました。
  • 購入報告一覧での立替者表示の改善: 購入報告一覧画面で、立替者名がpaidByUserIdに基づいて表示されるようになり、より正確な情報が提供されます。paidByUserIdがない場合は既存のpaidByがフォールバックとして表示されます。
  • コードフォーマットの統一: 多数のファイルでclassName属性の記述方法が統一され、コードの可読性と保守性が向上しました。
Changelog
  • view/next-project/src/components/auth/SignInView.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/auth/SignUpView.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/budget_managements/AddBudgetManagementModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/budget_managements/BudgetManagement.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/budget_managements/DeleteBudgetManagementModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/budget_managements/EditBudgetManagementModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/common/Dropdown.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/common/Header/Header.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/common/Loading/Loading.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/common/PulldownButton.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/common/Radio/Radio.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/common/RegistModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/common/Select/Select.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/common/SideNav.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/common/Tooltip/Tooltip.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/common/UserDropdown.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/create_purchase_report/FileUploadField.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/create_purchase_report/usePurchaseReportForm.ts
    • useGetDivisionsIdをインポートしました。
    • purchaseReportの初期状態にpaidByUserIdを追加し、paidByuserNameで初期化しました。
    • 編集モード時にdivisionDataを取得するロジックを追加しました。
    • 新規作成時にログインユーザーを立替者として自動設定するuseEffectフックを追加しました。
    • submitBuyReport関数にpaidByUserIdを含めるように更新しました。
  • view/next-project/src/components/fund_information/FundInformationHeader.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/layout/LoginLayout.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/layout/MainLayout/MainLayout.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/mypage/TableSection.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/purchasereports/DetailEditModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/purchasereports/DetailPage1.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/purchasereports/DetailPage2.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/purchasereports/EditModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/purchasereports/PurchaseOrderListModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/purchasereports/PurchaseReportAddModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/purchasereports/PurchaseReportConfirmModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/purchasereports/ReceiptModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/purchasereports/UploadFileModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/sponsoractivities/AddBlankInvoiceModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/sponsoractivities/AddBlankReceiptModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/sponsoractivities/AddPdfDetailModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/sponsoractivities/DetailPage1.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/sponsoractivities/DetailPage2.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/sponsoractivities/FilterModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/sponsoractivities/PaymentDayModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/sponsoractivities/SponsorActivitiesAddModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/sponsoractivities/UploadFileModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/sponsors/SponsorEditModal.tsx
    • 不要な空行を削除しました。
  • view/next-project/src/components/teacher/AddModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/teacher/EditModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/components/users/DeleteModal.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/generated/model/buyReport.ts
    • paidByフィールドをオプショナルに変更し、paidByUserIdフィールドを追加しました。
  • view/next-project/src/generated/model/buyReportDetail.ts
    • paidByUserIdフィールドを追加しました。
  • view/next-project/src/generated/model/buyReportWithDivisionId.ts
    • paidByUserIdフィールドを追加しました。
  • view/next-project/src/pages/404.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/500.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/_app.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/create_purchase_report/index.tsx
    • setPurchaseReportの分割代入を削除しました。
    • isFormValidのチェックからpaidByの検証を削除しました。
    • 「立替者」フィールドを読み取り専用にし、paidByUserIdに基づいて表示するように更新しました。
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/fund_informations/[id]/edit.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/fund_informations/create/index.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/index.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/purchase_report_list/index.tsx
    • @api/api_methodsからgetを、@type/commonからUser型をインポートしました。
    • ユーザー名マップを管理するための状態を追加しました。
    • すべてのユーザーを取得してユーザー名マップを作成するロジックを追加しました。
    • 「立替者」列の表示をpaidByUserIduserNameMapに基づいて更新しました。
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/reset_password/[id]/index.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/reset_password/request/index.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/sponsoractivities/index.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/sponsors/index.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/sponsorstyles/index.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/teachers/index.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/users/index.tsx
    • className属性のフォーマットを修正しました。
  • view/next-project/src/pages/yearperiods/index.tsx
    • className属性のフォーマットを修正しました。
Activity
  • プルリクエストが作成されました。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 6, 2026

Deploying finansu with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3c208de
Status: ✅  Deploy successful!
Preview URL: https://f897ad24.finansu.pages.dev
Branch Preview URL: https://feat-chikuwa-buy-report-paid-b6ba.finansu.pages.dev

View logs

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

このプルリクエストでは、購入報告の立替者をuserIdで管理するようにフロントエンドが更新されていますね。全体的に、ロジックの変更は適切で、特にusePurchaseReportFormフックのリファクタリングはコードの堅牢性を高める良い改善だと感じました。
いくつか、コードの可読性と保守性をさらに向上させるための提案をコメントしましたので、確認してみてください。

@Chikuwa0141 Chikuwa0141 requested a review from hikahana March 8, 2026 15:40
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.

1 participant