completed the frontend dashboard component and bound it to the tenant admin pwa for the optimal onboarding experience.. Added a profile page.

This commit is contained in:
Codex Agent
2025-11-04 22:28:37 +01:00
parent fe380689fb
commit b32413b108
29 changed files with 1416 additions and 425 deletions

View File

@@ -51,6 +51,15 @@ class DashboardSummaryService
->orderByDesc('purchased_at')
->first();
if (! $activePackage) {
$activePackage = $tenant->tenantPackages()
->with('package')
->orderByDesc('active')
->orderByDesc('expires_at')
->orderByDesc('purchased_at')
->first();
}
return [
'total_events' => $totalEvents,
'active_events' => $activeEvents,
@@ -61,7 +70,6 @@ class DashboardSummaryService
'task_progress' => $totalEvents > 0
? (int) round(($eventsWithTasks / $totalEvents) * 100)
: 0,
'credit_balance' => $tenant->event_credits_balance ?? null,
'active_package' => $activePackage ? [
'name' => $activePackage->package?->getNameForLocale(app()->getLocale())
?? $activePackage->package?->name
@@ -69,6 +77,7 @@ class DashboardSummaryService
'expires_at' => optional($activePackage->expires_at)->toIso8601String(),
'remaining_events' => $activePackage->remaining_events ?? null,
'price' => $activePackage->price !== null ? (float) $activePackage->price : null,
'is_active' => (bool) $activePackage->active,
] : null,
];
}