@extends('layouts.app') @section('title', 'Service Request Detail - ' . $serviceRequest->sr_number) @section('content') {{-- Fixed Top Action Bar --}}
{{ $serviceRequest->sr_number }}
@php $statusClass = [ 'open' => 'badge-blue', 'in_progress' => 'badge-info', 'resolved' => 'badge-success', 'closed' => 'badge-secondary', 'cancelled' => 'badge-danger' ][$serviceRequest->status] ?? 'badge-secondary'; @endphp {{ ucfirst(str_replace('_', ' ', $serviceRequest->status)) }} @if($serviceRequest->status == 'cancelled' && $serviceRequest->cancellation_reason)
Reason: {{ $serviceRequest->cancellation_reason }}
@endif
{{-- Extra Actions on Left --}} @can('HoReCa Service Requests update') @endcan {{-- Standardized 6 Icons --}} @can('HoReCa Service Requests update') @else @endcan
{{-- Left Column (70%) --}}
{{-- Section: Request Details --}}

{{ $serviceRequest->title }}

{{ $serviceRequest->category->name }} | Opened {{ $serviceRequest->created_at->format('M d, Y') }}
@php $priorityClass = [ 'low' => 'bg-soft-success text-success', 'medium' => 'bg-soft-info text-info', 'high' => 'bg-soft-warning text-warning', 'critical' => 'bg-soft-danger text-danger' ][$serviceRequest->priority] ?? 'bg-secondary'; @endphp
{{ strtoupper($serviceRequest->priority) }}
{{ $serviceRequest->description }}
{{-- Section: Activity Log --}}
Activity Log
{{ $serviceRequest->creator->name ?? 'System' }} {{ $serviceRequest->created_at->format('M d, Y H:i') }}
Created the service request.
@forelse($serviceRequest->activities as $activity)
{{ $activity->user->name ?? 'User' }} {{ $activity->created_at->format('M d, Y H:i') }}
@if($activity->action_type == 'status_change') Changed status from {{ ucfirst($activity->old_value) }} to {{ ucfirst($activity->new_value) }} @if($activity->comment && $activity->comment != 'Status updated.')
{{ $activity->comment }}
@endif @elseif($activity->action_type == 'comment') Added a comment:
{{ $activity->comment }}
@elseif($activity->action_type == 'reassignment') Reassigned the request to {{ $activity->new_value }} @endif
@empty {{-- No extra activities --}} @endforelse
{{-- Add Comment Section --}}
@csrf
{{ substr(auth()->user()->name, 0, 1) }}
Attach Files
{{-- Right Column (30%) --}}
{{-- Section: Status & Assignment --}}
Assignment
@if($serviceRequest->assignee)
{{ substr($serviceRequest->assignee->name, 0, 1) }}
{{ $serviceRequest->assignee->name }}
{{ $serviceRequest->assignee->email ?? 'no-email@example.com' }}
@else
No user assigned yet
@endif
Reference # {{ $serviceRequest->sr_number }}
Created Date {{ $serviceRequest->created_at->format('M d, Y') }}
Response Target {{ $serviceRequest->category->sla_hours }} Hours SLA
{{-- Section: Timeline & SLA --}}
SLA & Resolution
SLA Deadline
{{ $serviceRequest->sla_due_date->format('M d, H:i') }}
@php $isPast = $serviceRequest->sla_due_date < now() && !in_array($serviceRequest->status, ['resolved', 'closed']); @endphp @if($isPast)
BREACHED: {{ $serviceRequest->sla_due_date->diffForHumans() }}
@elseif(in_array($serviceRequest->status, ['resolved', 'closed']))
MET ON TIME
@else
Expires {{ $serviceRequest->sla_due_date->diffForHumans() }}
@endif
@if($serviceRequest->resolved_date)
Resolved Date {{ $serviceRequest->resolved_date->format('M d, Y H:i') }}
Total Time {{ $serviceRequest->created_at->diffForHumans($serviceRequest->resolved_date, true) }}
@elseif($serviceRequest->closed_date)
Closed Date {{ $serviceRequest->closed_date->format('M d, Y H:i') }}
@else
Awaiting resolution...
@endif
{{-- Section: Context --}}
Context
{{ $serviceRequest->outlet->name }} {{ $serviceRequest->outlet->address }}
{{ substr($serviceRequest->creator->name ?? 'S', 0, 1) }}
{{ $serviceRequest->creator->name ?? 'System' }}
@if($serviceRequest->workflow_id)
{{ $serviceRequest->workflow->name }}
Step: {{ $serviceRequest->step->name ?? 'N/A' }} @else
Manual Request
@endif
{{-- Section: Context & Metadata --}}
Attachments

No files attached to this request

{{-- Reassign Modal --}} {{-- Cancellation Modal --}} @endsection @push('js') @endpush