{{-- This view creates a nested accordion structure. 1. OUTER ACCORDION: Loops through each timestamp group. Each panel represents a file upload. 2. INNER ACCORDION: Inside each timestamp panel, this loops through the accounts from that specific file. --}} {{-- Outer Accordion container for Timestamp Groups --}}
@foreach($accounts as $timestamp => $dataGroup) @php $timestampId = $userType . '-timestamp-' . $loop->index; // NEW: Get the overall and account data from the dataGroup $overallAnalysis = $dataGroup['overall']; $accountGroup = $dataGroup['accounts']; @endphp
{{-- Outer Accordion Header: Shows the timestamp and account count for the file upload --}}
{{-- Outer Accordion Body: Contains the inner accordion of bank accounts for this timestamp --}}
Overall Analysis Summary
{{-- We can re-use the same partials used inside the account accordion --}}

@include('admin.consumer-application.scorecard.partials._pirimid_summary_table', ['account' => $overallAnalysis])

@include('admin.consumer-application.scorecard.partials._salary_table', ['account' => $overallAnalysis])

@include('admin.consumer-application.scorecard.partials._bounce_transactions_table', ['account' => $overallAnalysis])

@include('admin.consumer-application.scorecard.partials._risk_events_table', ['account' => $overallAnalysis, 'accountId' => 'overall-' . $timestampId])
{{-- INNER Accordion for Bank Accounts --}} {{-- Note the unique ID using the parent loop's index --}}
@foreach($accountGroup as $account) @php // Create a globally unique ID for each account using both loop indexes $accountId = $userType . '-' . $loop->parent->index . '-' . $loop->index; @endphp
{{-- Inner Accordion Header: Shows individual account summary --}}
{{-- Inner Accordion Body: Contains nested tabs with detailed tables --}}
{{-- Nested Tabs Navigation --}} {{-- Nested Tabs Content --}}

@include('admin.consumer-application.scorecard.partials._pirimid_summary_table', ['account' => $account])

@include('admin.consumer-application.scorecard.partials._salary_table', ['account' => $account])

@include('admin.consumer-application.scorecard.partials._bounce_transactions_table', ['account' => $account])

@include('admin.consumer-application.scorecard.partials._risk_events_table', ['account' => $account, 'accountId' => $accountId])
@endforeach
@endforeach