refactor(backend): quick-capture API を撤去 - #364
Conversation
#359 で需要不明と判断され #360 で frontend から撤去された quick-capture の backend 側エンドポイント(POST /v1/tenants/{tenant_id}/users/me/tasks)を削除する。 - create_my_task ハンドラーと専用ヘルパー(next_seq_id / default_status_id)を削除 - QuickCaptureRequest とルート登録を削除、openapi.json を再生成 - 統合テストを作り替え: 撤去の回帰テスト(POST が 405。撤去前は 201 のため 撤去前のコードでは fail する)と、通常のタスク作成 + assignees 経由で seeding する assigned-only の一覧テスト(未割り当ての対照付き) GET .../users/me/personal-project と GET .../users/me/tasks(一覧)は存置。 Closes #363
Deploying koyori with
|
| Latest commit: |
49c6714
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5d3ec3ba.koyori.pages.dev |
| Branch Preview URL: | https://refactor-remove-quick-captur.koyori.pages.dev |
|
Important Testing in progress…🟢 UI Tests: 66 tests unchanged |
|
Tip All tests passed and all changes approved!🟢 UI Tests: 66 tests unchanged |
Coverage Report for apps/frontend
File CoverageNo changed files found. |
OpenAPI diff (apps/frontend/openapi.json)diff --git a/apps/frontend/openapi.json b/apps/frontend/openapi.json
index 842a73a..e352629 100644
--- a/apps/frontend/openapi.json
+++ b/apps/frontend/openapi.json
@@ -17053,117 +17053,6 @@
}
}
}
- },
- "post": {
- "tags": ["My Tasks"],
- "summary": "クイックキャプチャ(個人プロジェクトへタスク作成)",
- "operationId": "create_my_task",
- "parameters": [
- {
- "name": "tenant_id",
- "in": "path",
- "description": "テナントID",
- "required": true,
- "schema": {
- "type": "string",
- "format": "uuid"
- }
- }
- ],
- "requestBody": {
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/QuickCaptureRequest"
- }
- }
- },
- "required": true
- },
- "responses": {
- "201": {
- "description": "作成されたタスク",
- "content": {
- "application/json": {
- "schema": {
- "$ref": "#/components/schemas/TaskResponse"
- }
- }
- }
- },
- "401": {
- "description": "ログインまたはセッションが必要です",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "description": "API 共通のエラー応答ボディ。",
- "required": ["message"],
- "properties": {
- "message": {
- "type": "string",
- "example": "internal-error"
- }
- }
- }
- }
- }
- },
- "403": {
- "description": "この操作は許可されていません",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "description": "API 共通のエラー応答ボディ。",
- "required": ["message"],
- "properties": {
- "message": {
- "type": "string",
- "example": "internal-error"
- }
- }
- }
- }
- }
- },
- "404": {
- "description": "リソースが見つかりません",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "description": "API 共通のエラー応答ボディ。",
- "required": ["message"],
- "properties": {
- "message": {
- "type": "string",
- "example": "internal-error"
- }
- }
- }
- }
- }
- },
- "500": {
- "description": "サーバー側で問題が発生しました。時間をおいて再度お試しください",
- "content": {
- "application/json": {
- "schema": {
- "type": "object",
- "description": "API 共通のエラー応答ボディ。",
- "required": ["message"],
- "properties": {
- "message": {
- "type": "string",
- "example": "internal-error"
- }
- }
- }
- }
- }
- }
- }
}
},
"/v1/users/me/notification-settings/{project_id}": {
@@ -19461,32 +19350,6 @@
}
}
},
- "QuickCaptureRequest": {
- "type": "object",
- "required": ["title"],
- "properties": {
- "note": {
- "type": ["string", "null"]
- },
- "priority": {
- "oneOf": [
- {
- "type": "null"
- },
- {
- "$ref": "#/components/schemas/TaskPriority"
- }
- ]
- },
- "soft_deadline": {
- "type": ["string", "null"],
- "format": "date-time"
- },
- "title": {
- "type": "string"
- }
- }
- },
"RegisterRequest": {
"type": "object",
"required": ["username", "email", "password"], |
レビュー指摘(#364)backend 側の撤去(handler / route / payload / openapi・専用ヘルパー除去・405 回帰テスト)は過不足なく正しいのですが、撤去対象の endpoint に CLI の消費者が残っている点を1件指摘します。 🔴 Medium: 撤去する endpoint を CLI の
|
レビュー指摘への対応。撤去する POST /v1/tenants/{tenant_id}/users/me/tasks を
CLI の my add がまだ叩いており、マージ後に 405 で実行時破壊が起きる状態だった。
- my add コマンドと専用の TaskPriority import / priority オプションを削除
- paths.ts の該当 POST 型定義を削除(今後は同種のドリフトを tsc が検知する)
- commands.test.ts の my add テストを my list の登録テストに置き換え
(my コマンドの registration カバレッジを維持)
my list / my complete は GET・別エンドポイント使用のため影響なし。
|
レビューありがとうございます。指摘のとおり CLI の
検証: CLI |
Closes #363
概要
#359 で「需要不明」と判断され #360 で frontend から撤去された quick-capture 機能の backend 側 API(
POST /v1/tenants/{tenant_id}/users/me/tasks)を撤去する。全消費者を確認済み: frontend は #360 マージ後に呼び出し元なし、CLI のmy add(残存消費者)は本 PR で削除。変更内容
backend
create_my_taskハンドラーと、このファイル内で専用だったヘルパー(next_seq_id/default_status_id)を削除(tasks.rsは自前のnext_seq_idを持っており影響なし)QuickCaptureRequest(payload)とルート登録(routes/tenants.rs)を削除openapi.jsonを再生成(POST 定義と QuickCaptureRequest スキーマの計 137 行が消える。他の差分なし)GET .../users/me/personal-project/GET .../users/me/tasks(一覧)。個人プロジェクトの概念・個人 Inbox 表示は変更なしcli(レビュー指摘対応・
49c6714)my addコマンドを削除(撤去 endpoint の残存消費者。放置するとマージ後に 405 で実行時破壊)paths.tsの該当 POST 型定義を削除(今後の同種ドリフトを tsc が検知可能に)my addテストをmy list登録テストへ置き換えmy list/my completeは GET・別 endpoint のため影響なし挙動の変化
POST /v1/tenants/{tenant_id}/users/me/tasksは 405 Method Not Allowed を返す(同パスの GET は存続するため 404 ではなく 405)my addコマンドが消える(my list/my completeは従来どおり)テスト
quick_capture_endpoint_is_removed: POST → 405 を検証。撤去前のコードでは 201 が返り fail する(撤去の証明)list_returns_only_assigned_tasks: seeding を通常のタスク作成+assignees 経由に変更し、未割り当てタスクが載らない対照とtotalの一致まで検証(旧quick_capture_and_listの置き換え)cargo fmt/check(0 warning)/clippy(クリーン)/test --workspace --lib(68 pass)/ 統合テストmy_tasks_integration5/5 PASS(testcontainers)vp test195/195 PASS・残参照ゼロpnpm test23/23 PASS・typecheck:testクリーン