振替も登録できるようにする - #12
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
PayPay CSV 取込の mappingRules を拡張し、既存のカテゴリ付与ルールに加えて振替登録ルールも同一配列で扱えるようにする変更です。あわせてルール競合時の優先順位(priority、同値は記述順)を仕様化し、テストで固定しています。
Changes:
mappingRulesに振替メタデータ(isTransfer,transferAccount)を追加し、旧キー(振替?,振替元・先)の互換正規化を実装- Money Forward 手入力モーダルで振替タブを使った登録フロー(振替元/先 select)を追加
- 仕様・ドキュメント・lint 対象拡張(README + docs)と、振替/競合優先順位のテスト追加
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| test/import-core.test.js | 振替ルール正規化・適用・口座解決・競合優先順位のテストを追加 |
| src/mfme.config.json | 振替タブ用の UI セレクタ(transfer/payment/from/to)を設定に追加 |
| src/import-paypay-to-mfme.js | 振替取引の場合に振替タブへ切り替え、振替元/先口座を選択する分岐を追加 |
| src/import-core.js | 振替ルールの正規化/適用、振替元/先解決ロジックを追加 |
| README.md | mappingRules の正式スキーマ、優先順位方針、振替ルール例を追記 |
| package.json | markdownlint 対象を README のみ→README + docs 配下へ拡張 |
| docs/test-spec.md | 振替ルールと競合優先順位の観点をテスト仕様に追加 |
| config_sample.json | 振替ルールの設定例を追加 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
テストケースを追加して、振替の文字列処理を検証
Shinoryo
commented
May 10, 2026
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.
概要
変更内容
実装
mappingRules に振替メタデータ(isTransfer, transferAccount)を追加対応。
振替時は Money Forward 手入力モーダルの振替タブを使い、振替元・振替先を入力する分岐を追加。
振替用 selector を設定ファイルへ追加(実装コードへのハードコード回避)。
仕様明文化
同一取引に複数ルールが一致した場合は priority の高い順で評価。
priority が同値の場合は mappingRules の記述順(上から)を優先。
ドキュメント
README に正式な mappingRules スキーマ(カテゴリルール/振替ルール)を追記。
config_sample.json に振替ルールの実例を追加。
test-spec.md に振替関連観点と競合優先順位観点を追加。
package.json の lint:md を README + docs 配下に拡張。
テスト
競合優先順位テストを追加。
高 priority 優先ケース。
同 priority は記述順優先ケース。
振替ルール正規化・適用・口座解決テストを追加済み。
動作確認
実行手順
npm ci
npm run lint:md
npm test
npm run smoke:dry-run
実行結果
lint:md 成功
test 成功(45件 pass / 0 fail)
smoke:dry-run 成功(合計=2, 解析失敗=0, 除外=0, 重複=0, 対象=2)
動作確認に使用した環境
OS: Windows
Node.js: 20 以上(プロジェクト要件準拠)
Browser: Microsoft Edge(振替 UI 対応は selector ベースで実装)
補足: headed での実登録確認(expense/income 振替 各1件)は未実施
関連するIssue
チェックリスト