Updated default image and added additional admin cards

This commit is contained in:
blaisadmin
2026-04-30 22:25:15 -04:00
parent cd7c4383d0
commit 45fd507eeb
7 changed files with 44 additions and 0 deletions
@@ -549,17 +549,21 @@ export const setWorkspaceSubscriptionStatusByStripeSubscriptionId = async (
export const getPlatformAdminSummary = async () => {
const result = await db.query<{
total_birds: number;
memorialized_birds: number;
total_users: number;
total_workspaces: number;
rescue_workspaces: number;
rescue_birds: number;
pending_rescues: number;
daily_users: number;
}>(
`SELECT
(SELECT COUNT(*)::int FROM birds) AS total_birds,
(SELECT COUNT(*)::int FROM birds WHERE memorialized_at IS NOT NULL) AS memorialized_birds,
(SELECT COUNT(*)::int FROM users) AS total_users,
(SELECT COUNT(*)::int FROM workspaces) AS total_workspaces,
(SELECT COUNT(*)::int FROM workspaces WHERE workspace_type = 'rescue') AS rescue_workspaces,
(SELECT COUNT(*)::int FROM birds INNER JOIN workspaces ON workspaces.id = birds.workspace_id WHERE workspaces.workspace_type = 'rescue') AS rescue_birds,
(SELECT COUNT(*)::int FROM workspaces WHERE workspace_type = 'rescue' AND rescue_verification_status = 'pending') AS pending_rescues,
(SELECT COUNT(DISTINCT user_id)::int FROM auth_sessions WHERE created_at >= CURRENT_DATE) AS daily_users`,
);