import type { DashboardStats } from '@/lib/types/admin';
import type { AdminDashboardViewData } from '@/lib/view-data/AdminDashboardViewData';

/**
 * AdminDashboardViewDataBuilder
 *
 * Transforms DashboardStats API DTO into AdminDashboardViewData for server-side rendering.
 * Deterministic; side-effect free; no HTTP calls.
 */
export class AdminDashboardViewDataBuilder {
  static build(apiDto: DashboardStats): AdminDashboardViewData {
    return {
      stats: {
        totalUsers: apiDto.totalUsers,
        activeUsers: apiDto.activeUsers,
        suspendedUsers: apiDto.suspendedUsers,
        deletedUsers: apiDto.deletedUsers,
        systemAdmins: apiDto.systemAdmins,
        recentLogins: apiDto.recentLogins,
        newUsersToday: apiDto.newUsersToday,
      },
    };
  }
}