@extends('layouts/layoutMaster') @section('title', 'Detalle del anuncio') @section('vendor-style') @vite([ 'resources/assets/vendor/libs/datatables-bs5/datatables.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-responsive-bs5/responsive.bootstrap5.scss', 'resources/assets/vendor/libs/datatables-buttons-bs5/buttons.bootstrap5.scss', ]) @endsection @section('page-style') @endsection @section('page-script') @endsection @section('content') @php $statusMap = [ 'draft' => ['label' => 'Borrador', 'class' => 'secondary'], 'pending' => ['label' => 'Pendiente de revision', 'class' => 'warning'], 'approved' => ['label' => 'Aprobado', 'class' => 'success'], 'rejected' => ['label' => 'Rechazado', 'class' => 'danger'], ]; $operationalMap = [ 'draft' => ['label' => 'Borrador', 'class' => 'secondary'], 'awaiting_plan' => ['label' => 'Sin plan', 'class' => 'warning'], 'awaiting_payment' => ['label' => 'Esperando pago', 'class' => 'warning'], 'active' => ['label' => 'Activo', 'class' => 'success'], 'paused' => ['label' => 'Pausado', 'class' => 'secondary'], ]; $paymentMap = [ 'none' => ['label' => 'Sin pago', 'class' => 'secondary'], 'pending' => ['label' => 'Pago en revision', 'class' => 'warning'], 'approved' => ['label' => 'Pago aprobado', 'class' => 'success'], 'rejected' => ['label' => 'Pago rechazado', 'class' => 'danger'], ]; $reviewMeta = $statusMap[$listing->review_status] ?? ['label' => $listing->reviewStatusLabel(), 'class' => 'secondary']; $operationalMeta = $operationalMap[$listing->status] ?? ['label' => \Illuminate\Support\Str::headline($listing->status ?: 'draft'), 'class' => 'secondary']; $paymentMeta = $paymentMap[$listing->payment_status] ?? ['label' => $listing->paymentStatusLabel(), 'class' => 'secondary']; $providerName = $listing->mariachiProfile?->business_name ?: $listing->mariachiProfile?->user?->display_name ?: 'Mariachi'; $providerUser = $listing->mariachiProfile?->user; $coverPhoto = $listing->photos->first(); $latestPayment = $listing->latestPayment; $paymentHistory = $listing->payments->sortByDesc('id')->values(); $pendingPayment = $paymentHistory->firstWhere('status', \App\Models\ListingPayment::STATUS_PENDING); $pendingPaymentCount = $paymentHistory->where('status', \App\Models\ListingPayment::STATUS_PENDING)->count(); $renderedFaqs = $listing->renderedFaqRows(true); $listingInitials = collect(preg_split('/\s+/', trim($listing->title ?: $providerName))) ->filter() ->take(2) ->map(fn (string $part): string => strtoupper(mb_substr($part, 0, 1))) ->implode(''); $providerInitials = collect(preg_split('/\s+/', trim($providerName))) ->filter() ->take(2) ->map(fn (string $part): string => strtoupper(mb_substr($part, 0, 1))) ->implode(''); $contentRows = [ [ 'name' => 'Portada principal', 'detail' => $listing->title ?: 'Anuncio sin titulo', 'sub' => $listing->slug ?: 'slug pendiente', 'state' => $coverPhoto ? 'Cargada' : 'Pendiente', 'stateClass' => $coverPhoto ? 'success' : 'warning', 'qty' => $coverPhoto ? 1 : 0, 'signal' => 'Hero', 'thumb' => $coverPhoto?->path ? asset('storage/'.$coverPhoto->path) : null, ], [ 'name' => 'Fotos', 'detail' => 'Galeria visual del anuncio', 'sub' => 'Fotos publicables y de apoyo', 'state' => $listing->photos->isNotEmpty() ? 'Completa' : 'Pendiente', 'stateClass' => $listing->photos->isNotEmpty() ? 'success' : 'warning', 'qty' => $listing->photos->count(), 'signal' => 'Media', 'thumb' => $coverPhoto?->path ? asset('storage/'.$coverPhoto->path) : null, ], [ 'name' => 'Videos', 'detail' => 'Apoyo audiovisual y prueba social', 'sub' => $listing->videos->isNotEmpty() ? $listing->videos->first()->platform : 'Sin videos cargados', 'state' => $listing->videos->isNotEmpty() ? 'Disponible' : 'Vacio', 'stateClass' => $listing->videos->isNotEmpty() ? 'info' : 'secondary', 'qty' => $listing->videos->count(), 'signal' => 'Video', 'thumb' => null, ], [ 'name' => 'Cobertura', 'detail' => 'Ciudad principal y zonas extra', 'sub' => $listing->city_name ?: 'Sin ciudad definida', 'state' => $listing->travels_to_other_cities || $listing->serviceAreas->isNotEmpty() ? 'Extendida' : 'Local', 'stateClass' => $listing->travels_to_other_cities || $listing->serviceAreas->isNotEmpty() ? 'primary' : 'secondary', 'qty' => $listing->serviceAreas->count(), 'signal' => 'Zona', 'thumb' => null, ], [ 'name' => 'FAQs', 'detail' => 'Preguntas frecuentes del anuncio', 'sub' => $renderedFaqs->isNotEmpty() ? $renderedFaqs->first()['question'] : 'Sin preguntas frecuentes', 'state' => $renderedFaqs->isNotEmpty() ? 'Completo' : 'Vacio', 'stateClass' => $renderedFaqs->isNotEmpty() ? 'success' : 'secondary', 'qty' => $renderedFaqs->count(), 'signal' => 'Soporte', 'thumb' => null, ], ]; @endphp @if (session('status'))
{{ optional($listing->submitted_for_review_at ?: $listing->updated_at)->format('d/m/Y H:i') ?: 'Sin fecha registrada' }} · {{ $listing->city_name ?: 'Sin ciudad' }}
| contenido | estado | qty | senal | ||
|---|---|---|---|---|---|
|
@if ($row['thumb'])
|
{{ $row['name'] }}{{ $row['detail'] }} {{ $row['sub'] }} |
{{ $row['state'] }} | {{ $row['qty'] }} | {{ $row['signal'] }} |
{{ $listing->short_description ?: 'Sin descripcion corta.' }}
{{ $listing->description ?: 'Sin descripcion completa.' }}
| URL | Plataforma |
|---|---|
| {{ $video->url }} | {{ $video->platform }} |
Este anuncio aun no tiene videos registrados.
@endif{{ $faq['question'] }}
{{ $faq['is_system'] ? 'Sistema' : 'Mariachi' }}{{ $faq['answer'] }}
Este anuncio no tiene preguntas frecuentes.
@endforelseTodavía no hay pagos registrados para este anuncio.
@else| # | Operación | Planes | Monto | Checkout | Estado | Revisión | |
|---|---|---|---|---|---|---|---|
| #{{ $payment->id }} |
{{ $payment->operationLabel() }}
{{ $payment->created_at?->format('d/m/Y H:i') ?: '-' }}
|
{{ \Illuminate\Support\Str::headline($payment->targetPlanCode()) }}
@if ($payment->source_plan_code)
Desde {{ \Illuminate\Support\Str::headline($payment->source_plan_code) }}
@else
Sin plan origen
@endif
· {{ $payment->duration_months }} mes(es)
|
${{ number_format($payment->chargedAmountCop(), 0, ',', '.') }} COP
Base ${{ number_format((int) ($payment->base_amount_cop ?: $payment->amount_cop), 0, ',', '.') }}
· Crédito ${{ number_format((int) ($payment->applied_credit_cop ?: 0), 0, ',', '.') }}
|
{{ $payment->checkout_reference ?: $payment->reference_text ?: '-' }}
{{ $payment->provider_transaction_id ?: 'Sin transacción final' }}
|
{{ $payment->statusLabel() }}
@if ($payment->provider_transaction_status)
{{ $payment->provider_transaction_status }}
@endif
|
{{ $payment->reviewed_at?->format('d/m/Y H:i') ?: 'Sin revisar' }}
{{ $payment->reviewedBy?->display_name ?: 'Sin revisor' }}
|
@if ($payment->isPending())
{{ $payment->rejection_reason }}
@endif
|
{{ $activity['body'] }}
Todavia no hay hitos suficientes para construir una linea de tiempo del anuncio.
Email: {{ $providerUser?->email ?: 'Sin email' }}
Mobile: {{ $providerUser?->phone ?: ($listing->mariachiProfile?->whatsapp ?: 'Sin telefono') }}
Ciudad: {{ $listing->mariachiProfile?->city_name ?: $listing->city_name ?: 'Sin ciudad' }}
{{ $listing->address ?: 'Direccion pendiente' }}
{{ $listing->zone_name ?: 'Zona pendiente' }}
{{ $listing->city_name ?: 'Ciudad pendiente' }} {{ $listing->postal_code ?: '' }}
{{ $listing->country ?: 'Pais pendiente' }}
Motivo del rechazo del pago
{{ $latestPayment->rejection_reason }}
Motivo del rechazo
{{ $listing->rejection_reason }}