@extends('layouts.app') @section('title', 'Typist Command Center') @section('content')
@php $viewLinks = [ ['mine', 'My queue', $metrics['active']], ['returned', 'Returned', $metrics['returned']], ['documents', 'Document holds', $metrics['documents_pending']], ['payment', 'Payment holds', $metrics['payment_holds']], ['sla', 'SLA risk', $metrics['sla_warnings']], ['paused', 'Paused', $metrics['paused']], ]; if (auth()->user()->hasPermission('applications.assign')) { $viewLinks[] = ['unassigned', 'Unassigned', $metrics['unassigned']]; } @endphp @include('tenant.partials.typist-page-nav')
Typist operations {{ auth()->user()->defaultBranch?->name ?? 'Active branch' }} Live queue

Typing Command Center

Welcome, {{ auth()->user()->name }}. Process verified applications, resolve government returns, monitor SLA commitments and hand work to supervisors from one focused workspace.

Active work

{{ number_format($metrics['active']) }} Assigned to me

Due attention

{{ number_format($metrics['sla_warnings']) }} SLA risk or overdue

Completed today

{{ number_format($metrics['completed_today']) }} {{ number_format($metrics['completed_week']) }} this week

On-time rate

{{ $metrics['on_time_rate'] === null ? '—' : $metrics['on_time_rate'].'%' }} Last 30 days
@foreach([ ['Assigned today', $metrics['assigned_today'], 'AS', 'bg-blue-50 text-blue-600', 'New handoffs'], ['Typing now', $metrics['typing'], 'TY', 'bg-orange-50 text-orange-600', 'Ready and in progress'], ['Returned cases', $metrics['returned'], 'RT', 'bg-amber-50 text-amber-700', 'Correction required'], ['Document holds', $metrics['documents_pending'], 'DC', 'bg-violet-50 text-violet-600', 'Missing or unverified'], ['Payment holds', $metrics['payment_holds'], 'PY', 'bg-rose-50 text-rose-600', 'Awaiting clearance'], ['Overdue', $metrics['overdue'], 'SL', 'bg-red-50 text-red-600', 'Immediate action'], ] as [$label, $value, $icon, $iconClass, $note])
{{ $icon }} Today
{{ number_format($value) }}

{{ $label }}

{{ $note }}

@endforeach
SQ

Smart Queue

Priority, government returns and SLA risk are ranked automatically.

Workflow board
Reset
@forelse($applications as $application) @php $isPaused = $application->sla_paused_at !== null; $isOverdue = !$isPaused && $application->due_at?->isPast(); $isRisk = !$isPaused && ($isOverdue || in_array($application->sla_status, ['at_risk', 'warning', 'overdue'], true) || $application->due_at?->lessThanOrEqualTo(now()->addHours(4))); $transitions = collect($application->queue_transitions ?? []); $readyTransition = $transitions->firstWhere('ready', true); $blockedTransition = $transitions->first(fn ($transition) => !($transition['ready'] ?? false)); $latestSubmission = $application->latest_submission; $paymentReady = (float) $application->total_price <= 0 || in_array($application->payment_status, ['paid', 'credit_account', 'corporate_credit'], true); $documentsReady = (int) $application->pending_documents_count === 0 && !in_array($application->document_status, ['missing_documents', 'exception'], true); @endphp
{{ $application->application_number }} {{ ucfirst($application->priority) }} @if($application->status === 'returned' || $application->currentStage?->stage_code === 'GOVERNMENT_RETURNED')Government return@endif @if($isPaused)SLA paused@elseif($isOverdue)Overdue@elseif($isRisk)SLA risk@endif

{{ $application->customer?->full_name_en ?? 'Customer unavailable' }}

{{ $application->service?->name_en ?? 'Service unavailable' }}

Mobile: {{ $application->customer?->contact?->primary_mobile ?? 'Not recorded' }} Authority: {{ $application->service?->authority?->name_en ?? $latestSubmission?->authority_code ?? 'Not assigned' }} Branch: {{ $application->branch?->name ?? 'Main branch' }} Waiting: {{ ($application->stage_entered_at ?? $application->updated_at)->diffForHumans(null, true) }}
@if($application->currentStage?->instructions)

Stage instruction: {{ $application->currentStage->instructions }}

@endif

Current stage

{{ $application->currentStage?->stage_name_en ?? 'Start stage' }}

{{ $application->currentStage?->stage_code ?? 'START' }}
{{ $documentsReady ? 'Ready' : $application->pending_documents_count.' pending' }}Documents
{{ $paymentReady ? 'Cleared' : 'On hold' }}Payment
{{ $application->open_tasks_count }}Open tasks
@if($latestSubmission)
Gov. attempt {{ $latestSubmission->attempt_number }}{{ str($latestSubmission->status)->replace('_', ' ')->title() }}
@endif

{{ $isPaused ? 'SLA paused' : ($isOverdue ? 'SLA overdue' : 'Stage deadline') }}

{{ $isPaused ? str($application->sla_pause_reason)->replace('_', ' ')->title() : ($application->due_at?->diffForHumans() ?? 'Not configured') }} @if($application->due_at && !$isPaused){{ $application->due_at->format('d M Y, h:i A') }}@endif
Open Application 360 @if(!$application->assigned_user_id && auth()->user()->hasPermission('applications.assign'))
@csrf
@elseif($readyTransition)
@csrf
@elseif($blockedTransition && !empty($blockedTransition['blockers']))

Blocked: {{ $blockedTransition['blockers'][0] }}

@endif
@empty
OK

Your work queue is clear

There are no applications matching this view. Assigned typing work and government corrections will appear here automatically.

@if(collect($filters)->filter()->isNotEmpty())Clear queue filters@endif
@endforelse
@if($applications->hasPages())
{{ $applications->links() }}
@endif
@endsection