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' => '이미 완료된 검사입니다.', ],