feat: G-1 작업지시 관리 API 구현

- 작업지시 테이블 마이그레이션 (work_orders, work_order_items, work_order_bending_details, work_order_issues)
- 작업지시 모델 4개 (WorkOrder, WorkOrderItem, WorkOrderBendingDetail, WorkOrderIssue)
- WorkOrderService 비즈니스 로직 구현
- WorkOrderController REST API 엔드포인트 11개
- FormRequest 검증 클래스 5개
- Swagger API 문서화 완료

API Endpoints:
- GET /work-orders (목록)
- GET /work-orders/stats (통계)
- POST /work-orders (등록)
- GET /work-orders/{id} (상세)
- PUT /work-orders/{id} (수정)
- DELETE /work-orders/{id} (삭제)
- PATCH /work-orders/{id}/status (상태변경)
- PATCH /work-orders/{id}/assign (담당자배정)
- PATCH /work-orders/{id}/bending/toggle (벤딩토글)
- POST /work-orders/{id}/issues (이슈등록)
- PATCH /work-orders/{id}/issues/{issueId}/resolve (이슈해결)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-26 13:57:42 +09:00
parent 5ab5353d4d
commit 05a53cdc8e
17 changed files with 2000 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
<?php
namespace App\Http\Requests\WorkOrder;
use App\Models\Production\WorkOrder;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class WorkOrderUpdateRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
// 기본 정보
'sales_order_id' => 'nullable|integer|exists:orders,id',
'project_name' => 'nullable|string|max:200',
'process_type' => ['nullable', Rule::in(WorkOrder::PROCESS_TYPES)],
'status' => ['nullable', Rule::in(WorkOrder::STATUSES)],
'assignee_id' => 'nullable|integer|exists:users,id',
'team_id' => 'nullable|integer|exists:departments,id',
'scheduled_date' => 'nullable|date',
'memo' => 'nullable|string',
'is_active' => 'nullable|boolean',
// 품목 배열 (있으면 전체 교체)
'items' => 'nullable|array',
'items.*.item_id' => 'nullable|integer|exists:items,id',
'items.*.item_name' => 'required|string|max:200',
'items.*.specification' => 'nullable|string|max:500',
'items.*.quantity' => 'nullable|numeric|min:0',
'items.*.unit' => 'nullable|string|max:20',
// 벤딩 상세
'bending_detail' => 'nullable|array',
'bending_detail.shaft_cutting' => 'nullable|boolean',
'bending_detail.bearing' => 'nullable|boolean',
'bending_detail.shaft_welding' => 'nullable|boolean',
'bending_detail.assembly' => 'nullable|boolean',
'bending_detail.winder_welding' => 'nullable|boolean',
'bending_detail.frame_assembly' => 'nullable|boolean',
'bending_detail.bundle_assembly' => 'nullable|boolean',
'bending_detail.motor_assembly' => 'nullable|boolean',
'bending_detail.bracket_assembly' => 'nullable|boolean',
];
}
}