@extends('layouts.admin') @section('title', 'AIR Job - ' . ($job['file_name'] ?? 'N/A')) @section('header', 'Detail AIR Job') @section('content')
Retour a la liste @if($job['retry']['can_retry'] ?? false)
@csrf
@endif
@php $status = $job['status'] ?? 'UNKNOWN'; $statusClass = match($status) { 'COMPLETED' => 'bg-green-100 text-green-800', 'PENDING' => 'bg-yellow-100 text-yellow-800', 'PARSING', 'CONVERTING', 'INSERTING' => 'bg-blue-100 text-blue-800', 'PARSED', 'CONVERTED' => 'bg-indigo-100 text-indigo-800', 'PARSE_FAILED', 'CONVERT_FAILED', 'INSERT_FAILED' => 'bg-red-100 text-red-800', 'CANCELLED' => 'bg-gray-100 text-gray-800', 'QUARANTINE' => 'bg-red-100 text-red-800', default => 'bg-gray-100 text-gray-800', }; @endphp

{{ $job['file_name'] ?? 'N/A' }}

UUID: {{ $job['uuid'] ?? '-' }}

{{ $status }} {{ $job['progress_percentage'] ?? 0 }}% complete

Informations generales

Type

{{ $job['file_type'] ?? '-' }}

Taille

{{ isset($job['file_size']) ? number_format($job['file_size'] / 1024, 2) . ' KB' : '-' }}

Cree le

{{ isset($job['created_at']) ? date('d/m/Y H:i', strtotime($job['created_at'])) : '-' }}

@if(isset($job['office_id']) || isset($job['target_table']))
@if(isset($job['office_id']))

Office ID

{{ $job['office_id'] }}

@endif @if(isset($job['target_table']))

Table cible

{{ $job['target_table'] }}

@endif
@endif
@if(isset($job['file_hash']))

Hash SHA256

{{ $job['file_hash'] }}

@endif @php $jsonAirPath = $job['paths']['json_air'] ?? $job['json_air_path'] ?? null; $jsonEstairPath = $job['paths']['json_estair'] ?? $job['json_estair_path'] ?? null; @endphp @if($jsonAirPath || $jsonEstairPath)

Fichiers JSON generes

@if($jsonAirPath)

JSON AIR

{{ $jsonAirPath }}

@endif @if($jsonEstairPath)

JSON ESTAIR

{{ $jsonEstairPath }}

@endif
@endif @php $parseMs = $job['durations']['parse_ms'] ?? $job['parse_duration_ms'] ?? null; $convertMs = $job['durations']['convert_ms'] ?? $job['convert_duration_ms'] ?? null; $insertMs = $job['durations']['insert_ms'] ?? $job['insert_duration_ms'] ?? null; $totalMs = $job['durations']['total_ms'] ?? (($parseMs ?? 0) + ($convertMs ?? 0) + ($insertMs ?? 0)); @endphp @if($parseMs || $convertMs || $insertMs || $totalMs)

Durees de traitement

Parse

{{ $parseMs ? number_format($parseMs / 1000, 2) . 's' : '-' }}

Conversion

{{ $convertMs ? number_format($convertMs / 1000, 2) . 's' : '-' }}

Insertion

{{ $insertMs ? number_format($insertMs / 1000, 2) . 's' : '-' }}

Total

{{ $totalMs ? number_format($totalMs / 1000, 2) . 's' : '-' }}

@endif @php $segmentsInserted = $job['insertions']['segments'] ?? $job['segments_inserted'] ?? 0; $recordsInserted = $job['insertions']['records'] ?? $job['records_inserted'] ?? 0; $accountsInserted = $job['insertions']['accounts'] ?? $job['accounts_inserted'] ?? 0; $beneficiairesInserted = $job['insertions']['beneficiaires'] ?? $job['beneficiaires_inserted'] ?? 0; $compagniesInserted = $job['insertions']['compagnies'] ?? $job['compagnies_inserted'] ?? 0; $totalInserted = $job['insertions']['total'] ?? ($segmentsInserted + $recordsInserted + $accountsInserted + $beneficiairesInserted + $compagniesInserted); @endphp @if($segmentsInserted || $recordsInserted || $accountsInserted || $beneficiairesInserted || $compagniesInserted)

Insertions en base

Segments

{{ number_format($segmentsInserted) }}

Etatsdeventes

{{ number_format($recordsInserted) }}

Accounts

{{ number_format($accountsInserted) }}

Beneficiaires

{{ number_format($beneficiairesInserted) }}

Compagnies

{{ number_format($compagniesInserted) }}

Total

{{ number_format($totalInserted) }}

@endif @php $parseStarted = $job['timestamps']['parse_started'] ?? $job['parse_started_at'] ?? null; $parseCompleted = $job['timestamps']['parse_completed'] ?? $job['parse_completed_at'] ?? null; $convertStarted = $job['timestamps']['convert_started'] ?? $job['convert_started_at'] ?? null; $convertCompleted = $job['timestamps']['convert_completed'] ?? $job['convert_completed_at'] ?? null; $insertStarted = $job['timestamps']['insert_started'] ?? $job['insert_started_at'] ?? null; $insertCompleted = $job['timestamps']['insert_completed'] ?? $job['insert_completed_at'] ?? null; @endphp @if($parseStarted || $convertStarted || $insertStarted)

Timeline de traitement

@if($parseStarted)

PARSE

Debut: {{ date('d/m/Y H:i:s', strtotime($parseStarted)) }}
@if($parseCompleted)
Fin: {{ date('d/m/Y H:i:s', strtotime($parseCompleted)) }}
@endif
@endif @if($convertStarted)

CONVERT

Debut: {{ date('d/m/Y H:i:s', strtotime($convertStarted)) }}
@if($convertCompleted)
Fin: {{ date('d/m/Y H:i:s', strtotime($convertCompleted)) }}
@endif
@endif @if($insertStarted)

INSERT

Debut: {{ date('d/m/Y H:i:s', strtotime($insertStarted)) }}
@if($insertCompleted)
Fin: {{ date('d/m/Y H:i:s', strtotime($insertCompleted)) }}
@endif
@endif
@endif @if(isset($job['error_message']) && $job['error_message'])

Erreur lors de l'etape: {{ $job['error_step'] ?? 'Inconnue' }}

{{ $job['error_message'] }}

@if(isset($job['error_trace']) && $job['error_trace'])
Afficher la trace complete
{{ $job['error_trace'] }}
@endif
@endif @if(!empty($logs))

Logs ({{ count($logs) }})

@foreach(['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] as $lvl) @endforeach
@foreach($logs as $log) @php $logLevel = $log['level'] ?? 'INFO'; $logBorder = match($logLevel) { 'ERROR', 'CRITICAL' => 'border-red-500 bg-red-50', 'WARNING' => 'border-yellow-500 bg-yellow-50', 'INFO' => 'border-blue-500 bg-blue-50', default => 'border-gray-300 bg-white', }; $logBadge = match($logLevel) { 'ERROR', 'CRITICAL' => 'bg-red-200 text-red-800', 'WARNING' => 'bg-yellow-200 text-yellow-800', 'INFO' => 'bg-blue-200 text-blue-800', default => 'bg-gray-200 text-gray-800', }; @endphp
{{ $logLevel }} @if($log['step'] ?? null) {{ $log['step'] }} @endif {{ isset($log['created_at']) ? \Carbon\Carbon::parse($log['created_at'])->format('d/m/Y H:i:s') : '' }} @if($log['duration_ms'] ?? null) ({{ number_format($log['duration_ms'] / 1000, 2) }}s) @endif

{{ $log['message'] ?? '' }}

@if(!empty($log['context']))
Contexte
{{ json_encode($log['context'], JSON_PRETTY_PRINT) }}
@endif @if($log['exception'] ?? null)
Exception
{{ substr($log['exception'], 0, 1000) }}...
@endif
@endforeach

{{ count($logs) }} log(s) affiches (limite: 100)

@endif @endsection