feat: 수주 관리 Phase 3 - 고급 기능 API 구현
- 견적→수주 변환 API (POST /orders/from-quote/{quoteId})
- 생산지시 생성 API (POST /orders/{id}/production-order)
- FormRequest 검증 클래스 추가
- 중복 생성 방지 및 상태 검증 로직
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
36
app/Http/Requests/Order/CreateProductionOrderRequest.php
Normal file
36
app/Http/Requests/Order/CreateProductionOrderRequest.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests\Order;
|
||||
|
||||
use App\Models\Production\WorkOrder;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class CreateProductionOrderRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'process_type' => ['nullable', Rule::in(WorkOrder::PROCESS_TYPES)],
|
||||
'assignee_id' => 'nullable|integer|exists:users,id',
|
||||
'team_id' => 'nullable|integer|exists:departments,id',
|
||||
'scheduled_date' => 'nullable|date',
|
||||
'memo' => 'nullable|string',
|
||||
];
|
||||
}
|
||||
|
||||
public function messages(): array
|
||||
{
|
||||
return [
|
||||
'process_type.in' => __('validation.in', ['attribute' => '공정 유형']),
|
||||
'assignee_id.exists' => __('validation.exists', ['attribute' => '담당자']),
|
||||
'team_id.exists' => __('validation.exists', ['attribute' => '팀']),
|
||||
'scheduled_date.date' => __('validation.date', ['attribute' => '예정일']),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user