feat: MaterialApi.php Swagger 점검 및 개선 (Phase 3-2)

- MaterialStoreRequest.php 생성 (검증 로직 분리)
- MaterialUpdateRequest.php 생성 (검증 로직 분리)
- MaterialApi.php 경로 수정 (/api/v1/products/materials)
- MaterialController.php Swagger 주석 제거, FormRequest 적용
- lang/ko/message.php material 메시지 키 추가
- SAM API Development Rules 준수 완료
This commit is contained in:
2025-11-07 02:37:18 +09:00
parent 78e3934baf
commit f4d663ac4e
5 changed files with 88 additions and 300 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace App\Http\Requests\Material;
use Illuminate\Foundation\Http\FormRequest;
class MaterialUpdateRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'category_id' => 'nullable|integer',
'name' => 'sometimes|string|max:100',
'unit' => 'sometimes|string|max:20',
'is_inspection' => 'nullable|in:Y,N',
'search_tag' => 'nullable|string|max:255',
'remarks' => 'nullable|string|max:500',
'attributes' => 'nullable|array',
'attributes.*.label' => 'required|string|max:50',
'attributes.*.value' => 'required|string|max:100',
'attributes.*.unit' => 'nullable|string|max:20',
'options' => 'nullable|array',
'material_code' => 'nullable|string|max:30',
'specification' => 'nullable|string|max:255',
];
}
}