code quality
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
Some checks failed
CI / lint-typecheck (pull_request) Failing after 12s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
This commit is contained in:
@@ -4,7 +4,8 @@ import { Result } from '@/lib/contracts/Result';
|
||||
import { DomainError, Service } from '@/lib/contracts/services/Service';
|
||||
import { EnhancedErrorReporter } from '@/lib/infrastructure/EnhancedErrorReporter';
|
||||
import { ConsoleLogger } from '@/lib/infrastructure/logging/ConsoleLogger';
|
||||
import type { DashboardStats, UserDto, UserListResponse } from '@/lib/types/admin';
|
||||
import type { DashboardStatsResponseDTO } from '@/lib/types/generated/DashboardStatsResponseDTO';
|
||||
import type { UserDto, UserListResponse } from '@/lib/types/admin';
|
||||
import { injectable } from 'inversify';
|
||||
|
||||
/**
|
||||
@@ -31,9 +32,9 @@ export class AdminService implements Service {
|
||||
/**
|
||||
* Get dashboard statistics
|
||||
*/
|
||||
async getDashboardStats(): Promise<Result<DashboardStats, DomainError>> {
|
||||
async getDashboardStats(): Promise<Result<DashboardStatsResponseDTO, DomainError>> {
|
||||
// Mock data until API is implemented
|
||||
const mockStats: DashboardStats = {
|
||||
const mockStats: DashboardStatsResponseDTO = {
|
||||
totalUsers: 1250,
|
||||
activeUsers: 1100,
|
||||
suspendedUsers: 50,
|
||||
@@ -41,23 +42,23 @@ export class AdminService implements Service {
|
||||
systemAdmins: 5,
|
||||
recentLogins: 450,
|
||||
newUsersToday: 12,
|
||||
userGrowth: [
|
||||
{ label: 'This week', value: 45, color: '#10b981' },
|
||||
{ label: 'Last week', value: 38, color: '#3b82f6' },
|
||||
],
|
||||
roleDistribution: [
|
||||
{ label: 'Users', value: 1200, color: '#6b7280' },
|
||||
{ label: 'Admins', value: 50, color: '#8b5cf6' },
|
||||
],
|
||||
userGrowth: {},
|
||||
roleDistribution: {},
|
||||
statusDistribution: {
|
||||
active: 1100,
|
||||
suspended: 50,
|
||||
deleted: 100,
|
||||
},
|
||||
activityTimeline: [
|
||||
{ date: '2024-01-01', newUsers: 10, logins: 200 },
|
||||
{ date: '2024-01-02', newUsers: 15, logins: 220 },
|
||||
],
|
||||
activityTimeline: {},
|
||||
label: 'Growth',
|
||||
value: 45,
|
||||
color: '#10b981',
|
||||
active: 1100,
|
||||
suspended: 50,
|
||||
deleted: 100,
|
||||
date: '2024-01-01',
|
||||
newUsers: 10,
|
||||
logins: 200,
|
||||
};
|
||||
return Result.ok(mockStats);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user