feat: Design BOM 템플릿 diff/clone API 및 모델버전 릴리즈 유효성 검사 도입
- Design BOM 템플릿 diff/clone 엔드포인트 추가 - 컨트롤러 검증 로직 FormRequest 분리(DiffRequest/CloneRequest/Upsert/ReplaceItems) - BomTemplateService에 diffTemplates/cloneTemplate/replaceItems/쇼우 로직 정리 - ModelVersionController createDraft FormRequest 적용 및 서비스 호출 정리 - 모델버전 release 전 유효성 검사(존재/활성/테넌트 일치, qty>0, 중복 금지) 추가 - DB enum 미사용 방침 준수(status 문자열 유지) - model_versions 인덱스 최적화(tenant_id, model_id, status / 기간 범위) - Swagger 문서(Design BOM) 및 i18n 메시지 키 추가
This commit is contained in:
23
app/Http/Requests/Design/BomTemplate/CloneRequest.php
Normal file
23
app/Http/Requests/Design/BomTemplate/CloneRequest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Design\BomTemplate;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class CloneRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'target_version_id' => 'nullable|integer|min:1',
|
||||
'name' => 'nullable|string|max:100',
|
||||
'is_primary' => 'nullable|boolean',
|
||||
'notes' => 'nullable|string',
|
||||
];
|
||||
}
|
||||
}
|
||||
29
app/Http/Requests/Design/BomTemplate/DiffRequest.php
Normal file
29
app/Http/Requests/Design/BomTemplate/DiffRequest.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Design\BomTemplate;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class DiffRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'other_template_id' => 'required|integer|min:1',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'other_template_id.required' => __('validation.required', ['attribute' => 'other_template_id']),
|
||||
'other_template_id.integer' => __('validation.integer', ['attribute' => 'other_template_id']),
|
||||
'other_template_id.min' => __('validation.min.numeric', ['attribute' => 'other_template_id', 'min' => 1]),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user