@extends('layouts.admin.app', ['page' => $menuAdmin['seller_management']['active'] ?? "", 'sub_page' => $menuAdmin['seller_management']['route']['sellers']['sub_active'] ?? "" ]) @section('title', $seller->user->name ?? __('labels.seller_details')) @section('header_data') @php $page_title = $seller->user->name ?? __('labels.seller'); $page_pretitle = __('labels.seller_details'); @endphp @endsection @php $breadcrumbs = [ ['title' => __('labels.home'), 'url' => route('admin.dashboard')], ['title' => __('labels.sellers'), 'url' => route('admin.sellers.index')], ['title' => $seller->user->name ?? __('labels.seller'), 'url' => null], ]; $vStatus = $seller->verification_status; $vClass = match($vStatus) { 'approved' => 'bg-success-lt border-success-subtle', 'rejected' => 'bg-danger-lt border-danger-subtle', default => 'bg-warning-lt border-warning-subtle', }; $visStatus = $seller->visibility_status; $visClass = match($visStatus) { 'visible' => 'bg-success-lt border-success-subtle', default => 'bg-secondary-lt border-secondary-subtle', }; @endphp @section('admin-content')
{{-- PROFILE CARD --}}

{{ $seller->user->name ?? 'N/A' }}

{{ $seller->user->email ?? 'N/A' }} | {{ $seller->user->mobile ?? 'N/A' }}
{{ ucfirst(str_replace('_', ' ', $vStatus)) }} {{ ucfirst($visStatus) }} @if($seller->activeSubscription?->plan) {{ $seller->activeSubscription->plan->name }} @endif
{{ __('labels.registration_date') }}
{{ $seller->created_at->format('d M Y') }}
{{ __('labels.stores') }}: {{ $seller->stores->count() }}
{{-- STAT CARDS ROW --}}
{{ $orderStats['total'] }}
{{ __('labels.total_orders') }}
{{ $orderStats['delivered'] }} ({{ $orderStats['completion_rate'] }}%)
{{ __('labels.completed_orders') }}
{{ $reviewData ? number_format($reviewData->average_rating, 1) : '0.0' }}
{{ __('labels.average_rating') }} ({{ $reviewData->total_reviews ?? 0 }} {{ __('labels.reviews') }})
{{ getCurrencySymbol() . number_format($seller->wallet?->balance ?? 0, 2) }}
{{ __('labels.wallet_balance') }}
{{-- TABS --}}
{{-- TAB: OVERVIEW --}}
{{-- Personal / Business Information --}}

{{ __('labels.personal_information') }}

{{ __('labels.full_name') }} {{ $seller->user->name ?? 'N/A' }}
{{ __('labels.email') }} {{ $seller->user->email ?? 'N/A' }}
{{ __('labels.mobile') }} {{ $seller->user->mobile ?? 'N/A' }}
{{ __('labels.address') }} {{ $seller->address ?? 'N/A' }}
{{ __('labels.city') }} {{ $seller->city ?? 'N/A' }}
{{ __('labels.state') }} {{ $seller->state ?? 'N/A' }}
{{ __('labels.country') }} {{ $seller->country ?? 'N/A' }}
{{ __('labels.zipcode') }} {{ $seller->zipcode ?? 'N/A' }}
{{-- Verification & Status --}}

{{ __('labels.verification_details') }}

@if($seller->activeSubscription) @endif
{{ __('labels.verification_status') }} {{ ucfirst(str_replace('_', ' ', $vStatus)) }}
{{ __('labels.visibility_status') }} {{ ucfirst($visStatus) }}
{{ __('labels.subscription') }} {{ $seller->activeSubscription->plan->name ?? 'N/A' }} @if($seller->activeSubscription->end_date)
{{ __('labels.expires') }}: {{ $seller->activeSubscription->end_date->format('d M Y') }}
@endif
{{ __('labels.post_accept_cancel_count') }} {{ $seller->post_accept_cancel_count ?? 0 }}
{{-- Map + Order Breakdown --}}

{{ __('labels.location') }}

{{-- Order Breakdown --}}

{{ __('labels.order_breakdown') }}

@php $total = max($orderStats['total'], 1); $breakdowns = [ ['label' => __('labels.delivered'), 'count' => $orderStats['delivered'], 'class' => 'bg-success'], ['label' => __('labels.pending'), 'count' => $orderStats['pending'], 'class' => 'bg-warning'], ['label' => __('labels.in_progress'), 'count' => $orderStats['in_progress'], 'class' => 'bg-info'], ['label' => __('labels.cancelled'), 'count' => $orderStats['cancelled'], 'class' => 'bg-danger'], ]; @endphp @foreach($breakdowns as $item)
{{ $item['label'] }} {{ $item['count'] }}
@endforeach
{{-- TAB: STORES --}}
@if($seller->stores->count() > 0)
@foreach($seller->stores as $store)

{{ $store->name }}

{{ $store->address ?? '' }}
{{ ucfirst($store->status ?? 'inactive') }}
{{ $store->mobile ?? 'N/A' }}
@endforeach
@else

{{ __('labels.no_stores_found') }}

@endif
{{-- TAB: WALLET & SETTLEMENTS --}}
{{-- Earnings Summary Cards --}}
{{ getCurrencySymbol() . number_format($earningsSummary['total_earnings'], 2) }}
{{ __('labels.total_earnings') }}
{{ getCurrencySymbol() . number_format($earningsSummary['total_settled'], 2) }}
{{ __('labels.total_settled') }}
{{ getCurrencySymbol() . number_format($earningsSummary['total_pending'], 2) }}
{{ __('labels.pending_settlement') }}
{{ getCurrencySymbol() . $earningsSummary['total_entries'] }}
{{ __('labels.total_entries') }}
{{-- Statements DataTable --}}

{{ __('labels.recent_statements') }}

{{-- TAB: FEEDBACK --}}
{{-- Rating Summary --}}
{{ $reviewData ? number_format($reviewData->average_rating, 1) : '0.0' }}
{{ __('labels.average_rating') }}
{{ $reviewData->total_reviews ?? 0 }} {{ __('labels.reviews') }}
@php $totalReviews = max($reviewData->total_reviews ?? 0, 1); $starCounts = [ 5 => $reviewData->five_star_count ?? 0, 4 => $reviewData->four_star_count ?? 0, 3 => $reviewData->three_star_count ?? 0, 2 => $reviewData->two_star_count ?? 0, 1 => $reviewData->one_star_count ?? 0, ]; @endphp @foreach($starCounts as $star => $count)
{{ $star }}
{{ $count }}
@endforeach
{{-- Feedback DataTable --}}
{{-- TAB: NOTIFICATIONS & FCM --}}
{{-- FCM Tokens --}}

{{ __('labels.fcm_device_tokens') }}

@if($fcmTokens->count() > 0)
@foreach($fcmTokens as $token) @endforeach
{{ __('labels.device_type') }} {{ __('labels.fcm_token') }} {{ __('labels.role_type') }} {{ __('labels.last_updated') }}
@php $deviceIcon = match($token->device_type?->value ?? $token->device_type) { 'android' => 'ti-brand-android', 'ios' => 'ti-brand-apple', 'web' => 'ti-world', default => 'ti-device-mobile', }; @endphp {{ ucfirst($token->device_type?->value ?? $token->device_type ?? 'N/A') }} {{ $token->fcm_token }} {{ ucfirst($token->role_type?->value ?? $token->role_type ?? 'N/A') }} {{ $token->updated_at?->format('d M Y H:i') }}
@else

{{ __('labels.no_fcm_tokens_found') }}

@endif
{{-- Notifications DataTable --}}

{{ __('labels.notification_history') }}

{{-- TAB: DOCUMENTS --}}
@php $documents = [ ['label' => __('labels.business_license'), 'url' => $seller->getFirstMediaUrl(\App\Enums\SpatieMediaCollectionName::BUSINESS_LICENSE())], ['label' => __('labels.articles_of_incorporation'), 'url' => $seller->getFirstMediaUrl(\App\Enums\SpatieMediaCollectionName::ARTICLES_OF_INCORPORATION())], ['label' => __('labels.national_identity_card'), 'url' => $seller->getFirstMediaUrl(\App\Enums\SpatieMediaCollectionName::NATIONAL_IDENTITY_CARD())], ['label' => __('labels.authorized_signature'), 'url' => $seller->getFirstMediaUrl(\App\Enums\SpatieMediaCollectionName::AUTHORIZED_SIGNATURE())], ]; @endphp
@foreach($documents as $doc)

{{ $doc['label'] }}

@if(!empty($doc['url'])) {{ $doc['label'] }} @else

{{ __('labels.not_uploaded') }}

@endif
@endforeach
@endsection @push('styles') @endpush @push('scripts') @endpush