fix: [생산지시] 날짜포맷·개소수·자재투입 시 자동 상태전환

- ProductionOrderService: production_ordered_at를 Y-m-d 포맷으로 변환
- ProductionOrderService: withCount('nodes')로 개소수(node_count) 응답 추가
- WorkOrderService: autoStartWorkOrderOnMaterialInput() 신규 메서드
  - 자재투입 시 WO가 unassigned/pending/waiting이면 in_progress로 자동 전환
  - syncOrderStatus()로 Order도 IN_PRODUCTION 동기화
- Swagger: node_count 필드 문서화, 날짜 포맷 수정

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-05 17:27:35 +09:00
parent 2df8ecf765
commit 59d13eeb9f
3 changed files with 63 additions and 8 deletions

View File

@@ -14,11 +14,12 @@
* @OA\Property(property="order_no", type="string", example="ORD-20260301-0001", description="수주번호 (= 생산지시번호)"),
* @OA\Property(property="site_name", type="string", example="서울현장", nullable=true, description="현장명"),
* @OA\Property(property="client_name", type="string", example="(주)고객사", nullable=true, description="거래처명"),
* @OA\Property(property="quantity", type="number", example=10, description="수량"),
* @OA\Property(property="quantity", type="number", example=232, description="부품수량 합계"),
* @OA\Property(property="node_count", type="integer", example=4, description="개소수 (order_nodes 수)"),
* @OA\Property(property="delivery_date", type="string", format="date", example="2026-03-15", nullable=true, description="납기일"),
* @OA\Property(property="production_ordered_at", type="string", format="date-time", nullable=true, description="생산지시일 (첫 WorkOrder 생성일)"),
* @OA\Property(property="production_ordered_at", type="string", format="date", example="2026-02-21", nullable=true, description="생산지시일 (첫 WorkOrder 생성일, Y-m-d)"),
* @OA\Property(property="production_status", type="string", enum={"waiting","in_production","completed"}, example="waiting", description="생산 상태"),
* @OA\Property(property="work_orders_count", type="integer", example=3, description="작업지시 수"),
* @OA\Property(property="work_orders_count", type="integer", example=2, description="작업지시 수 (공정별 1건)"),
* @OA\Property(property="work_order_progress", type="object",
* @OA\Property(property="total", type="integer", example=3),
* @OA\Property(property="completed", type="integer", example=1),
@@ -47,8 +48,9 @@
* description="생산지시 상세",
*
* @OA\Property(property="order", ref="#/components/schemas/ProductionOrderListItem"),
* @OA\Property(property="production_ordered_at", type="string", format="date-time", nullable=true),
* @OA\Property(property="production_ordered_at", type="string", format="date", example="2026-02-21", nullable=true),
* @OA\Property(property="production_status", type="string", enum={"waiting","in_production","completed"}),
* @OA\Property(property="node_count", type="integer", example=4, description="개소수"),
* @OA\Property(property="work_order_progress", type="object",
* @OA\Property(property="total", type="integer"),
* @OA\Property(property="completed", type="integer"),