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:
@@ -122,18 +122,54 @@ export type PaginatedResult<T> = {
|
||||
};
|
||||
|
||||
export type DashboardSummary = {
|
||||
active_events: number;
|
||||
new_photos: number;
|
||||
task_progress: number;
|
||||
credit_balance?: number | null;
|
||||
upcoming_events?: number | null;
|
||||
active_package?: {
|
||||
name: string;
|
||||
expires_at?: string | null;
|
||||
remaining_events?: number | null;
|
||||
} | null;
|
||||
active_events: number;
|
||||
new_photos: number;
|
||||
task_progress: number;
|
||||
credit_balance?: number | null;
|
||||
upcoming_events?: number | null;
|
||||
active_package?: {
|
||||
name: string;
|
||||
expires_at?: string | null;
|
||||
remaining_events?: number | null;
|
||||
} | null;
|
||||
};
|
||||
|
||||
export type TenantOnboardingStatus = {
|
||||
steps: {
|
||||
admin_app_opened_at?: string | null;
|
||||
primary_event_id?: number | string | null;
|
||||
selected_packages?: unknown;
|
||||
branding_completed?: boolean;
|
||||
tasks_configured?: boolean;
|
||||
event_created?: boolean;
|
||||
invite_created?: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
export async function trackOnboarding(step: string, meta?: Record<string, unknown>): Promise<void> {
|
||||
try {
|
||||
await authorizedFetch('/api/v1/tenant/onboarding', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({ step, meta }),
|
||||
});
|
||||
} catch (error) {
|
||||
emitApiErrorEvent(new ApiError('onboarding.track_failed', i18n.t('common.errors.generic', 'Etwas ist schiefgelaufen.'), error));
|
||||
}
|
||||
}
|
||||
|
||||
export async function fetchOnboardingStatus(): Promise<TenantOnboardingStatus | null> {
|
||||
try {
|
||||
const response = await authorizedFetch('/api/v1/tenant/onboarding');
|
||||
return (await response.json()) as TenantOnboardingStatus;
|
||||
} catch (error) {
|
||||
emitApiErrorEvent(new ApiError('onboarding.fetch_failed', i18n.t('common.errors.generic', 'Etwas ist schiefgelaufen.'), error));
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
export type TenantPackageSummary = {
|
||||
id: number;
|
||||
package_id: number;
|
||||
|
||||
Reference in New Issue
Block a user