Panel Maestro

Aprobación de Cambios

@if($pending->count() > 0) {{ $pending->count() }} pendiente{{ $pending->count() > 1 ? 's' : '' }} @endif
@csrf
{{-- Flash messages --}} @if(session('success'))
{{ session('success') }}
@endif @if($errors->any())
@endif {{-- Tabs --}}
{{-- TAB: PENDIENTES --}}
@forelse($pending as $change)
{{-- Card Header --}}
{{-- Operation badge --}} @php $colors = [ 'create' => 'bg-green-100 text-green-700 border-green-200', 'update' => 'bg-blue-100 text-blue-700 border-blue-200', 'delete' => 'bg-red-100 text-red-700 border-red-200', 'toggle' => 'bg-yellow-100 text-yellow-700 border-yellow-200', 'reorder' => 'bg-purple-100 text-purple-700 border-purple-200', ]; $icons = [ 'create' => 'ph-plus-circle', 'update' => 'ph-pencil-simple', 'delete' => 'ph-trash', 'toggle' => 'ph-toggle-left', 'reorder' => 'ph-arrows-down-up', ]; $entityIcons = ['rule' => 'ph-tree-structure', 'coverage' => 'ph-shield-check']; @endphp {{ $change->operationLabel() }} {{ $change->entityTypeLabel() }} {{ $change->entity_label }}
{{ $change->created_at->format('d/m/Y H:i:s') }}
{{ $change->requested_ip }}
{{-- Diff Content --}}
@if($change->operation === 'toggle')
Estado actual: @if($change->previous_payload['previous_is_active'] ?? false) ACTIVA @else INACTIVA @endif Nuevo estado: @if($change->payload['new_is_active'] ?? false) ACTIVA @else INACTIVA @endif
@elseif($change->operation === 'delete')

Se eliminará permanentemente:

@if($change->entity_type === 'rule') @php $d = $change->previous_payload['rule'] ?? []; @endphp

Nombre: {{ $d['name'] ?? '-' }}  |  Contexto: {{ $d['context'] ?? '-' }}  |  Prioridad: {{ $d['priority'] ?? '-' }}

{{ count($change->previous_payload['conditions'] ?? []) }} condiciones  ·  {{ count($change->previous_payload['actions'] ?? []) }} acciones

@elseif($change->entity_type === 'coverage') @php $d = $change->previous_payload['coverage'] ?? []; @endphp

Nombre: {{ $d['commercial_name'] ?? '-' }}  |  Código: {{ $d['base_code_equis'] ?? '-' }}

{{ count($change->previous_payload['conditions'] ?? []) }} condiciones

@endif
@elseif($change->operation === 'reorder')

Reordenamiento de {{ count($change->payload['ordered_ids'] ?? []) }} coberturas.

@elseif($change->operation === 'create')

Nuevo registro a crear

@include('approvals._entity_detail', [ 'payload' => $change->payload, 'entityType' => $change->entity_type, 'mode' => 'new', 'compareTo' => null, ]) @elseif($change->operation === 'update') {{-- Leyenda de highlighting --}}
Campos resaltados en amarillo cambiaron respecto al estado actual

Estado actual (antes)

@include('approvals._entity_detail', [ 'payload' => $change->previous_payload, 'entityType' => $change->entity_type, 'mode' => 'old', 'compareTo' => $change->payload, ])

Propuesto (después)

@include('approvals._entity_detail', [ 'payload' => $change->payload, 'entityType' => $change->entity_type, 'mode' => 'new', 'compareTo' => $change->previous_payload, ])
@endif
{{-- Actions --}}
{{-- Reject button triggers modal --}} {{-- Approve form --}}
@csrf
@empty

Sin cambios pendientes

Todo está al día. No hay cambios esperando aprobación.

@endforelse
{{-- TAB: HISTORIAL --}}
{{-- Modal: Rechazo --}}