feat: 實作 Hard Delete 功能與 Google OAuth 登入#1
Merged
Conversation
- docker-compose.yml: 新增 PostgreSQL healthcheck 和服務依賴條件 - alembic.ini: 啟用 ruff hook 和時間戳檔名格式 - requirements.txt: 新增 requests 套件 - scripts/: 新增 TaiwanPower 資料匯入/刪除腳本 - alembic: 新增 migration merge heads Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 新增 .claude/docs/delete-patterns.md 完整範本 - 更新 claude.md 增加 Hard Delete 和多角色討論模式說明 - 修正刪除順序描述為 4 步驟流程 - 擴充架構師提問範本 (6 維度 + 方案比較表) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
新增永久刪除功能:
- API: DELETE /api/v1/{resources}/{id}/permanent (需 Admin)
- 刪除順序: MinIO 物件 → MinIO Bucket → DB 記錄
- 級聯刪除: Project 層級刪除所有子記錄
- 名稱保留: 軟刪除名稱保留,Hard Delete 後釋放
變更檔案:
- 4 個 API endpoints 新增 /permanent 路由
- 4 個 services 新增 hard_delete 方法
- create 方法新增軟刪除名稱檢查
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
測試涵蓋: - API 層權限檢查 (Admin required) - Project/Point/Deployment/Audio 永久刪除 - Service 層 MinIO 物件刪除驗證 - 名稱釋放後可重用 新增 13 個測試案例,總測試數: 93 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
多角色討論模式: - 新增測試工程師角色 (測試策略、覆蓋率、Mock 設計) 測試範本更新: - 新增測試案例清單表格 (8 類型) - API/Service/名稱釋放測試範本 Hard Delete 測試擴充 (13 -> 17): - test_hard_delete_continues_when_minio_fails - test_hard_delete_empty_project - test_hard_delete_batch_over_1000_objects - test_soft_deleted_name_is_reserved Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 新增 Fixture 範本 (mock_normal_user) - 擴充 API 層測試為完整可複製範例 - 擴充 Service 層測試含 MinIO 整合細節 - 擴充名稱釋放測試含完整 Mock 設置 - 文件從 307 行增加至 535 行 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 建立 .claude/docs/changelog.md 記錄開發歷程 (Phase 1-3) - 精簡 CLAUDE.md Section 7,改為連結至 changelog.md - 移除 emoji 符號以符合專案規範 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 新增 hard_delete_recorder API 端點 (需 Admin 權限) - 新增 Deployment FK 引用檢查,有引用時拒絕刪除 - 新增軟刪除識別碼保留檢查 (brand/model/sn) - 新增 8 個測試案例 (API/Service/名稱釋放) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 新增 Google OAuth 登入/註冊 API - 新增忘記密碼/重設密碼 API - 新增 OAuth 帳號綁定/解除綁定 API - 新增設定密碼 API (OAuth 帳號可設密碼) - 更新 User Model 支援 OAuth 欄位 - 新增 28 個測試案例 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- 新增 test_user_service.py (19 個測試) - 新增 test_auth.py (10 個測試) - 新增 test_password_reset_service_unit.py (13 個測試) - 新增 test_oauth_service_unit.py (17 個測試) - 更新 changelog.md 記錄 Phase 5 - 新增計劃文件至 .claude/plans/ Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
✅ Automated PR Review SummaryStatus: passed Results:
Details:
🎉 All checks passed! Great work! This is an automated review. For detailed logs, check the Actions tab. |
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.
Summary
Changes
DELETE /api/v1/{resources}/{id}/permanent(需 Admin 權限)Test plan
🤖 Generated with Claude Code