@extends('layouts.app') @php $fmtDate = fn($v) => $v ? \Illuminate\Support\Carbon::parse($v)->format('M j, Y H:i') : '—'; @endphp @section('title', $rule->code . ' — ' . $rule->name) @section('content')
@foreach(['success' => 'check-circle', 'warning' => 'exclamation-triangle', 'error' => 'exclamation-circle'] as $key => $icon) @if(session($key))
{{ session($key) }}
@endif @endforeach

{{ $rule->module->label() }} {{ $rule->code }}

{{ $rule->name }}
@if($rule->status->value === 'DRAFT') Edit
@csrf
@elseif($rule->status->value === 'ACTIVE')
@csrf
@endif Back
Status: {{ $rule->status->label() }}
Condition: {{ $rule->condition_type->label() }}
Date Field: {{ $rule->date_field }}
Threshold: {{ $rule->threshold_days }} days
Action: {{ $rule->action_type->label() }}
Created By: {{ $rule->creator?->name ?? '—' }}
Approved: {{ $fmtDate($rule->approved_at) }}
Total Fires: {{ $rule->events()->count() }}
Recent Escalation Events
@if($recentEvents->isEmpty())
No events fired yet.
@else @foreach($recentEvents as $e) @endforeach
When Record Days Overdue Result Notified
{{ $fmtDate($e->fired_at) }} {{ class_basename($e->subject_type) }} {{ $e->subject_label }} {{ $e->days_overdue ?? '—' }} {{ $e->action_result }} {{ $e->notifiedUser?->name ?? '—' }}
@endif
@endsection