mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 07:59:41 +02:00
Add comprehensive admin dashboard to view and manage user data across all projects: Backend: - Add admin endpoints to Chat, Todo, Contacts, Calendar, Picture, Zitare, Presi - Each backend exposes GET/DELETE /api/v1/admin/user-data/:userId - Service-to-service auth via X-Service-Key header Aggregation (mana-core-auth): - GET /api/v1/admin/users - Paginated user list with search - GET /api/v1/admin/users/:userId/data - Aggregated data from all backends - DELETE /api/v1/admin/users/:userId/data - GDPR deletion across all projects Frontend (ManaCore web): - New User Data tab in admin navigation - User search page at /admin/user-data - User detail page with ProjectDataCard components - GDPR deletion dialog with email confirmation Presi: - Migrate user_id from UUID to TEXT for Better Auth compatibility - Add SQL migration script
78 lines
1.3 KiB
TypeScript
78 lines
1.3 KiB
TypeScript
export interface EntityCount {
|
|
entity: string;
|
|
count: number;
|
|
label: string;
|
|
}
|
|
|
|
export interface ProjectDataSummary {
|
|
projectId: string;
|
|
projectName: string;
|
|
icon: string;
|
|
available: boolean;
|
|
error?: string;
|
|
entities: EntityCount[];
|
|
totalCount: number;
|
|
lastActivityAt?: string;
|
|
}
|
|
|
|
export interface UserDataSummary {
|
|
user: {
|
|
id: string;
|
|
email: string;
|
|
name: string;
|
|
role: string;
|
|
createdAt: string;
|
|
emailVerified: boolean;
|
|
};
|
|
auth: {
|
|
sessionsCount: number;
|
|
accountsCount: number;
|
|
has2FA: boolean;
|
|
lastLoginAt: string | null;
|
|
};
|
|
credits: {
|
|
balance: number;
|
|
totalEarned: number;
|
|
totalSpent: number;
|
|
transactionsCount: number;
|
|
};
|
|
projects: ProjectDataSummary[];
|
|
totals: {
|
|
totalEntities: number;
|
|
projectsWithData: number;
|
|
};
|
|
}
|
|
|
|
export interface DeleteUserDataResponse {
|
|
success: boolean;
|
|
deletedFromProjects: {
|
|
projectId: string;
|
|
projectName: string;
|
|
success: boolean;
|
|
error?: string;
|
|
deletedCount?: number;
|
|
}[];
|
|
deletedFromAuth: {
|
|
sessions: number;
|
|
accounts: number;
|
|
credits: number;
|
|
user: boolean;
|
|
};
|
|
totalDeleted: number;
|
|
}
|
|
|
|
export interface UserListItem {
|
|
id: string;
|
|
email: string;
|
|
name: string;
|
|
role: string;
|
|
createdAt: string;
|
|
lastActiveAt?: string;
|
|
}
|
|
|
|
export interface UserListResponse {
|
|
users: UserListItem[];
|
|
total: number;
|
|
page: number;
|
|
limit: number;
|
|
}
|