@php $baseUrl = $baseUrl ?? route('platform.mystery.assessor.allocate.quality'); $pendingQualityAssessorCalls = $assignmentsByBusiness ->flatMap(fn ($assignment) => $assignment->calls ?? collect()) ->filter(fn ($call) => empty($call->assessor_quality_id)) ->count(); $hasAssignments = $assignmentsByBusiness->isNotEmpty(); $selectedYear = preg_match('/^\d{4}-\d{2}$/', (string) $selectedMonth) ? substr((string) $selectedMonth, 0, 4) : '2026'; $selectedMonthNumber = preg_match('/^\d{4}-\d{2}$/', (string) $selectedMonth) ? substr((string) $selectedMonth, 5, 2) : now()->format('m'); $yearOptions = collect(range(2026, 2030)); $monthOptions = collect(range(1, 12))->mapWithKeys(fn ($month) => [ str_pad((string) $month, 2, '0', STR_PAD_LEFT) => \Carbon\Carbon::create()->month($month)->format('F'), ]); @endphp
Select a sector and month, then assign one quality assessor per call number. Saving applies that call selection to every company in the filtered assignment set.
@if($businesses->isEmpty())
No assignments were found for the selected sector and month.
@elseif(! $hasAssignments)
No assignments were found for the selected sector and month.
@else
Sector {{ $sectors->firstWhere('id', $selectedSectorId)?->name ?? 'N/A' }}
Month {{ $selectedMonth ? \Carbon\Carbon::createFromFormat('Y-m', $selectedMonth)->format('F Y') : 'N/A' }}
Businesses {{ $businesses->count() }}
Max Calls {{ $maxCallCount }}
Pending Quality Assessors {{ $pendingQualityAssessorCalls }}
@if($pendingQualityAssessorCalls === 0)
All allocation is done. If you assign again here, it will overwrite all existing quality assessor allocations for this sector and month.
@endif
Assign Quality Assessors
Each dropdown below controls that call number for all companies in this sector and month.
@for($callNumber = 1; $callNumber <= $maxCallCount; $callNumber++)
@endfor
@endif