- ProductionOrder 전용 엔드포인트 (목록/통계/상세) - 재고생산 보조공정 일반 워크플로우에서 분리 - 자재투입 replace 모드 + bom_group_key 개별 저장 - 공정단계 options 컬럼 추가 (검사 설정/범위) - 셔터박스 prefix isStandard 파라미터 제거 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
51 lines
1.3 KiB
PHP
51 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api\V1;
|
|
|
|
use App\Helpers\ApiResponse;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\ProductionOrder\ProductionOrderIndexRequest;
|
|
use App\Services\ProductionOrderService;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
class ProductionOrderController extends Controller
|
|
{
|
|
public function __construct(
|
|
private readonly ProductionOrderService $service
|
|
) {}
|
|
|
|
/**
|
|
* 생산지시 목록 조회
|
|
*/
|
|
public function index(ProductionOrderIndexRequest $request): JsonResponse
|
|
{
|
|
$result = $this->service->index($request->validated());
|
|
|
|
return ApiResponse::success($result, __('message.fetched'));
|
|
}
|
|
|
|
/**
|
|
* 생산지시 상태별 통계
|
|
*/
|
|
public function stats(): JsonResponse
|
|
{
|
|
$stats = $this->service->stats();
|
|
|
|
return ApiResponse::success($stats, __('message.fetched'));
|
|
}
|
|
|
|
/**
|
|
* 생산지시 상세 조회
|
|
*/
|
|
public function show(int $orderId): JsonResponse
|
|
{
|
|
try {
|
|
$detail = $this->service->show($orderId);
|
|
|
|
return ApiResponse::success($detail, __('message.fetched'));
|
|
} catch (\Illuminate\Database\Eloquent\ModelNotFoundException $e) {
|
|
return ApiResponse::error(__('error.order.not_found'), 404);
|
|
}
|
|
}
|
|
}
|