diff --git a/app/Http/Controllers/OpsController.php b/app/Http/Controllers/OpsController.php index ea7570e..b8cfb5c 100644 --- a/app/Http/Controllers/OpsController.php +++ b/app/Http/Controllers/OpsController.php @@ -120,15 +120,15 @@ class OpsController extends Controller */ public function markInspectionPassed(Request $request, Order $order) { - if ($order->status !== 'inspection') { + if (! in_array($order->status, ['inspection', 'printing'])) { return response()->json([ - 'error' => 'Order is not in inspection state', + 'error' => 'Order is not in inspection or printing state', 'current_status' => $order->status, ], 409); } - // Update status - $order->update(['status' => 'packing']); + // Update status to awaiting_collection (move to inspected list in Trello) + $order->update(['status' => 'awaiting_collection']); Log::info('Inspection passed via QR', [ 'order_uuid' => $order->uuid, @@ -156,9 +156,9 @@ class OpsController extends Controller 'issue_description' => ['required', 'string', 'max:500'], ]); - if ($order->status !== 'inspection') { + if (! in_array($order->status, ['inspection', 'printing'])) { return response()->json([ - 'error' => 'Order is not in inspection state', + 'error' => 'Order is not in inspection or printing state', 'current_status' => $order->status, ], 409); } @@ -191,7 +191,7 @@ class OpsController extends Controller private function getAvailableActions(Order $order): array { return match ($order->status) { - 'inspection' => [ + 'inspection', 'printing' => [ 'markInspectionPassed' => true, 'flagInspectionIssue' => true, ], @@ -354,3 +354,4 @@ class OpsController extends Controller ], 500); } } +} \ No newline at end of file diff --git a/resources/views/ops/order-detail.blade.php b/resources/views/ops/order-detail.blade.php index 53b83fc..8929d00 100644 --- a/resources/views/ops/order-detail.blade.php +++ b/resources/views/ops/order-detail.blade.php @@ -31,9 +31,9 @@ - @if($order->status === 'inspection') + @if($order->status === 'inspection' || $order->status === 'printing') @include('ops.actions.inspection') - @elseif($order->status === 'packing' || $order->status === 'printing') + @elseif($order->status === 'packing') @include('ops.actions.packing') @elseif(in_array($order->status, ['ready_to_ship', 'awaiting_collection', 'in_transit'])) @include('ops.actions.read-only')