fix: [order] 수주 관리 개선 - stats 상태 추가, 수정 시 item_name 유효성 에러 수정

- stats에 IN_PRODUCTION/PRODUCED 상태 추가
- 수주 수정 시 item_name 유효성 에러 수정 (V1#29)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-18 15:06:14 +09:00
parent 59469d4bf6
commit decfe57b50
2 changed files with 3 additions and 1 deletions

View File

@@ -66,7 +66,7 @@ public function rules(): array
'items' => 'nullable|array',
'items.*.item_id' => 'nullable|integer|exists:items,id',
'items.*.item_code' => 'nullable|string|max:50',
'items.*.item_name' => 'required|string|max:200',
'items.*.item_name' => 'sometimes|required|string|max:200',
'items.*.specification' => 'nullable|string|max:500',
'items.*.quantity' => 'required|numeric|min:0',
'items.*.unit' => 'nullable|string|max:20',

View File

@@ -135,6 +135,8 @@ public function stats(?string $orderType = null): array
'draft' => $counts[Order::STATUS_DRAFT] ?? 0,
'confirmed' => $counts[Order::STATUS_CONFIRMED] ?? 0,
'in_progress' => $counts[Order::STATUS_IN_PROGRESS] ?? 0,
'in_production' => $counts[Order::STATUS_IN_PRODUCTION] ?? 0,
'produced' => $counts[Order::STATUS_PRODUCED] ?? 0,
'completed' => $counts[Order::STATUS_COMPLETED] ?? 0,
'cancelled' => $counts[Order::STATUS_CANCELLED] ?? 0,
'total_amount' => array_sum($amounts),