Skip to content

refactor: 未使用の shift エンドポイントを削除#377

Merged
taminororo merged 6 commits into
developfrom
refactor/kanba/369-remove-dead-shift-endpoints
Jun 23, 2026
Merged

refactor: 未使用の shift エンドポイントを削除#377
taminororo merged 6 commits into
developfrom
refactor/kanba/369-remove-dead-shift-endpoints

Conversation

@taminororo

@taminororo taminororo commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

概要

使われていない shift エンドポイントを削除する。API のルートには繋がっているが、mobile / admin / gas のどのクライアントも叩いていない関数を、死活2段確認のうえで削除した。652行削除 / 追加ゼロ。

削除したもの

関数 ルート
GetShifts GET /shifts
GetShiftByID GET /shifts/:id
GetShiftsByUser GET /shifts/users/:user_id
GetShiftsByUserAndDateAndWeather GET /shifts/users/:user_id/dates/:date/weathers/:weather
GetShiftsAdmin GET /shifts-admin
ShowShiftAdmin(ハンドラ / ルートのみ) GET /shifts-admin/:id

あわせて mobile の未使用クライアント getMyShift 系を削除した。旧 my-shift 表示のもので、現在は /shift-cards に移行済み。

残したもの

  • GetShiftAdminByID 関数: GET /shifts-admin/:id は削除するが、関数は DeleteShiftAdmin が削除前のログ記録に内部利用するため温存した。
  • SaveShiftData / SendToGAS(POST /request_shifts): アプリからの希望シフト送信。今後使う可能性があり運用判断が要るため対象外。

確認

  • go build 通過
  • 各関数 / ハンドラの参照がゼロになることを grep で確認
  • 同一パスの別メソッドを巻き込んでいないことを確認
GET /shifts-admin     削除
POST /shifts-admin    残存(CreateShiftAdmin)
DELETE /shifts-admin  残存(DeleteShiftAdmin)
PUT /shifts-admin/:id 残存(UpdateShiftAdmin)

死活判定の方法

  • 段1 外部: ルートを mobile/admin/gas が叩いているか
  • 段2 内部: usecase 関数を他の生きた関数が内部で呼んでいないか

紐づけ

Closes #376
Refs #369

Summary by CodeRabbit

リリースノート

  • Refactor
    • シフト取得関連のエンドポイントを整理しました。複数のシフト一覧・詳細取得エンドポイントが削除され、モバイルアプリ向けの機能(ユーザーごとのシフト表示、シフトカード表示)に統合されています。

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ecefbb59-c82a-49af-8aa2-7bcc5e574670

📥 Commits

Reviewing files that changed from the base of the PR and between f504f0f and a11bc4c.

📒 Files selected for processing (4)
  • api/lib/internals/controller/shift_controller.go
  • api/lib/router/router.go
  • api/lib/usecase/shift_usecase.go
  • mobile/lib/utils/api.dart
💤 Files with no reviewable changes (4)
  • api/lib/router/router.go
  • mobile/lib/utils/api.dart
  • api/lib/internals/controller/shift_controller.go
  • api/lib/usecase/shift_usecase.go

📝 Walkthrough

Walkthrough

使用されていないシフト取得系のエンドポイント群(GetShiftsGetShiftByIDGetShiftsByUserGetShiftsByUserAndDateAndWeatherGetShiftsAdmin)を、ユースケース・コントローラ・ルーター・モバイルAPIクライアントの全レイヤーにわたって削除するリファクタリング。

Changes

未使用シフトエンドポイントの全レイヤー削除

Layer / File(s) Summary
ShiftUseCase インターフェースと実装の削除
api/lib/usecase/shift_usecase.go
ShiftUseCase インターフェースから GetShifts/GetShiftByID/GetShiftsByUser/GetShiftsByUserAndDateAndWeather/GetShiftsAdmin の宣言を削除し、shiftUseCase の対応する実装ブロック(計約471行)を除去する。残存するのは GetUsersByShiftGetShiftCardsByUserAndDateAndWeather 以降の処理。
ShiftController インターフェースとハンドラの削除
api/lib/internals/controller/shift_controller.go
ShiftController インターフェースをモバイル向け3メソッド(ShowUsersByShift/ShowShiftCardsByUserAndDateAndWeather/PostShiftCards)のみに縮小し、IndexShift/ShowShift/ShowShiftsByUser/ShowShiftsByUserAndDateAndWeather/IndexShiftAdmin/ShowShiftAdmin のHTTPハンドラ実装(計約61行)を削除する。
ルート定義とモバイルAPIクライアントの削除
api/lib/router/router.go, mobile/lib/utils/api.dart
ProvideRouter から /shifts/shifts/:id/shifts/users/:user_id 系6エンドポイントを削除し、モバイル側の Api クラスから getMyShift および日付・天気別バリアント計8メソッド(約114行)を削除する。

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 古い道を掃き清めて、
使われぬシフトよ、さようなら。
471行、静かに消えて、
コードはすっきり身軽になった。
春の畑、草むしり完了!🌸

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly summarizes the main change: removing unused shift endpoints. The title is concise, specific, and directly reflects the primary objective of the changeset.
Description check ✅ Passed The PR description comprehensively covers the overview, deleted items with table format, retained items, and verification methods. All required sections are well-documented with clear explanations and grep confirmations.
Linked Issues check ✅ Passed The PR successfully addresses all coding requirements from issue #376: removes six unused endpoints (GetShifts, GetShiftByID, GetShiftsByUser, GetShiftsByUserAndDateAndWeather, GetShiftsAdmin, ShowShiftAdmin), related mobile functions, and preserves GetShiftAdminByID and SaveShiftData/SendToGAS as specified. All verified per two-stage checks.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the objective of removing unused shift endpoints. No unrelated modifications to other features or systems are present in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/kanba/369-remove-dead-shift-endpoints

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@taminororo taminororo merged commit f7789a3 into develop Jun 23, 2026
2 checks passed
@taminororo taminororo deleted the refactor/kanba/369-remove-dead-shift-endpoints branch June 23, 2026 14:00
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.

[Go static/refactor] 未使用の shift エンドポイントを削除

1 participant