From 2df43187bf810f8fb69aa86d6cb0e3179968e1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B6=8C=ED=98=81=EC=84=B1?= Date: Fri, 20 Mar 2026 12:39:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[inspection]=20=EC=99=84=EB=A3=8C?= =?UTF-8?q?=EB=90=9C=20=EA=B2=80=EC=82=AC=20=EC=88=98=EC=A0=95=20=EC=B0=A8?= =?UTF-8?q?=EB=8B=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - InspectionService.update()에 완료 상태 검증 추가 - 완료된 검사 수정 시 400 에러 반환 - error.php에 cannot_modify_completed 메시지 추가 --- app/Services/InspectionService.php | 4 ++++ lang/ko/error.php | 1 + 2 files changed, 5 insertions(+) diff --git a/app/Services/InspectionService.php b/app/Services/InspectionService.php index 3f142c77..45c9e2af 100644 --- a/app/Services/InspectionService.php +++ b/app/Services/InspectionService.php @@ -218,6 +218,10 @@ public function update(int $id, array $data) throw new NotFoundHttpException(__('error.not_found')); } + if ($inspection->status === Inspection::STATUS_COMPLETED) { + throw new BadRequestHttpException(__('error.inspection.cannot_modify_completed')); + } + $beforeData = $inspection->toArray(); return DB::transaction(function () use ($inspection, $data, $userId, $beforeData) { diff --git a/lang/ko/error.php b/lang/ko/error.php index c914ef12..e5ef71c2 100644 --- a/lang/ko/error.php +++ b/lang/ko/error.php @@ -456,6 +456,7 @@ 'inspection' => [ 'not_found' => '검사를 찾을 수 없습니다.', 'cannot_delete_completed' => '완료된 검사는 삭제할 수 없습니다.', + 'cannot_modify_completed' => '완료된 검사는 수정할 수 없습니다.', 'already_completed' => '이미 완료된 검사입니다.', ],