Gate ticket handoff as Pro; reorder settings cards.
Deploy Ladill Queue / deploy (push) Successful in 1m19s
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:
@@ -6,6 +6,7 @@ use App\Http\Controllers\Api\Concerns\ScopesApiToAccount;
|
||||
use App\Http\Controllers\Controller;
|
||||
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;
|
||||
@@ -17,6 +18,7 @@ class TicketController extends Controller
|
||||
|
||||
public function __construct(
|
||||
protected QueueEngine $engine,
|
||||
protected PlanService $plans,
|
||||
) {}
|
||||
|
||||
public function index(Request $request): JsonResponse
|
||||
@@ -108,6 +110,11 @@ class TicketController extends Controller
|
||||
]);
|
||||
|
||||
if ($validated['action'] === 'transfer') {
|
||||
abort_unless(
|
||||
$this->plans->hasFeature($this->organization($request), 'transfer'),
|
||||
403,
|
||||
'Handing off tickets between queues requires Queue Pro.',
|
||||
);
|
||||
$toQueue = ServiceQueue::where('uuid', $validated['to_queue_id'])->firstOrFail();
|
||||
$this->authorizeOwner($request, $toQueue);
|
||||
$result = $this->engine->transfer($ticket, $toQueue, null, $validated['reason'] ?? null, $actor);
|
||||
|
||||
Reference in New Issue
Block a user