Gate ticket handoff as Pro; reorder settings cards.
Deploy Ladill Queue / deploy (push) Successful in 1m19s

Transfer between queues requires Pro (console UI, API, and plans copy).
Branches & team now sits after Organization on the settings page.
This commit is contained in:
isaacclad
2026-07-16 09:54:53 +00:00
parent 26c9edc131
commit 7b2722f471
8 changed files with 263 additions and 52 deletions
@@ -5,8 +5,10 @@ namespace App\Http\Controllers\Api;
use App\Http\Controllers\Api\Concerns\ScopesApiToAccount;
use App\Http\Controllers\Controller;
use App\Models\Counter;
use App\Models\Organization;
use App\Models\ServiceQueue;
use App\Models\Ticket;
use App\Services\Qms\PlanService;
use App\Services\Qms\QueueEngine;
use App\Services\Qms\TicketPresenter;
use Illuminate\Http\JsonResponse;
@@ -18,6 +20,7 @@ class ConsoleApiController extends Controller
public function __construct(
protected QueueEngine $engine,
protected PlanService $plans,
) {}
public function show(Request $request, Counter $counter): JsonResponse
@@ -25,6 +28,8 @@ class ConsoleApiController extends Controller
$this->authorizeAbility($request, 'console.use');
$this->authorizeOwner($request, $counter);
$owner = $this->ownerRef($request);
$organization = $this->organization($request);
$canTransfer = $this->plans->hasFeature($organization, 'transfer');
$counter->load(['serviceQueues', 'branch']);
@@ -42,12 +47,14 @@ class ConsoleApiController extends Controller
)];
});
$allQueues = ServiceQueue::owned($owner)
->where('organization_id', $counter->organization_id)
->where('branch_id', $counter->branch_id)
->where('is_active', true)
->orderBy('name')
->get(['uuid', 'name', 'prefix']);
$allQueues = $canTransfer
? ServiceQueue::owned($owner)
->where('organization_id', $counter->organization_id)
->where('branch_id', $counter->branch_id)
->where('is_active', true)
->orderBy('name')
->get(['uuid', 'name', 'prefix'])
: collect();
return response()->json([
'data' => [
@@ -65,6 +72,7 @@ class ConsoleApiController extends Controller
]),
'waiting_by_queue' => $waitingByQueue,
'transfer_queues' => $allQueues,
'can_transfer' => $canTransfer,
],
]);
}
@@ -137,6 +145,12 @@ class ConsoleApiController extends Controller
?string $reason,
string $actor,
): Ticket {
$organization = Organization::query()->findOrFail($counter->organization_id);
abort_unless(
$this->plans->hasFeature($organization, 'transfer'),
403,
'Handing off tickets between queues requires Queue Pro.',
);
abort_if($toQueueUuid === '', 422, 'to_queue_uuid is required for transfer.');
$toQueue = ServiceQueue::where('uuid', $toQueueUuid)->firstOrFail();