fix(booking): 交易內只攔截業務例外,資料庫錯誤改交由例外處理器 #75
Reference in New Issue
Block a user
Delete Branch "fix/booking-exception-handling-impl"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
摘要
M7:預約交易的錯誤分類。對應 OpenSpec change
fix-booking-exception-handling(規劃 PR #74)。App\Exceptions\BookingRuleViolationExceptionMemberBookingController::store、ProviderBookingController::confirm只 catch 業務例外並回 422,訊息文字不變QueryException等其他例外不再以 422 回傳 SQL,改由 Laravel 回 500({"message":"Server Error"})並回報 SentryCommits
ddbf956fix:功能變更與測試8042f0bstyle:只用 pint 格式化兩個 Controller,沒有邏輯變更(審查 B-001)測試
tests/Feature/BookingExceptionHandlingTest.php,5 個測試對應 spec 的 5 個 Scenariocfdive-test-gd容器跑完整php artisan test:257 passed(675 assertions)\RuntimeException後,兩個 500 測試會失敗安全確認
$request->validate(),不變member/providermiddleware 與authorizeProvider(),不變CourseSchedule的lockForUpdate,不變限制
APP_DEBUG=false(VPS 已確認,H2)部署後
/opsx:archive)🤖 Generated with Claude Code