feat(API): Inspection API 구현
- InspectionController 생성 (CRUD + stats + complete) - InspectionService 생성 (비즈니스 로직) - FormRequest 생성 (Store/Update/Complete) - 라우트 등록 (7개 엔드포인트) - i18n 메시지 추가 (message.php, error.php) 기존 inspections 테이블 및 Inspection 모델 활용 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
28
app/Http/Requests/Inspection/InspectionUpdateRequest.php
Normal file
28
app/Http/Requests/Inspection/InspectionUpdateRequest.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Inspection;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class InspectionUpdateRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'items' => ['nullable', 'array'],
|
||||
'items.*.id' => ['required_with:items', 'string'],
|
||||
'items.*.result' => ['nullable', 'string', 'max:20'],
|
||||
'items.*.measured_value' => ['nullable', 'numeric'],
|
||||
'items.*.judgment' => ['nullable', Rule::in(['pass', 'fail'])],
|
||||
'result' => ['nullable', Rule::in(['pass', 'fail'])],
|
||||
'remarks' => ['nullable', 'string', 'max:1000'],
|
||||
'opinion' => ['nullable', 'string', 'max:2000'],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user