import { ApiProperty } from '@nestjs/swagger';

class UserGrowthDto {
  @ApiProperty({ description: 'Label for the time period' })
  label!: string;

  @ApiProperty({ description: 'Number of new users' })
  value!: number;

  @ApiProperty({ description: 'Color class for the bar' })
  color!: string;
}

class RoleDistributionDto {
  @ApiProperty({ description: 'Role name' })
  label!: string;

  @ApiProperty({ description: 'Number of users with this role' })
  value!: number;

  @ApiProperty({ description: 'Color class for the bar' })
  color!: string;
}

class StatusDistributionDto {
  @ApiProperty({ description: 'Number of active users' })
  active!: number;

  @ApiProperty({ description: 'Number of suspended users' })
  suspended!: number;

  @ApiProperty({ description: 'Number of deleted users' })
  deleted!: number;
}

class ActivityTimelineDto {
  @ApiProperty({ description: 'Date label' })
  date!: string;

  @ApiProperty({ description: 'Number of new users' })
  newUsers!: number;

  @ApiProperty({ description: 'Number of logins' })
  logins!: number;
}

export class DashboardStatsResponseDto {
  @ApiProperty({ description: 'Total number of users' })
  totalUsers!: number;

  @ApiProperty({ description: 'Number of active users' })
  activeUsers!: number;

  @ApiProperty({ description: 'Number of suspended users' })
  suspendedUsers!: number;

  @ApiProperty({ description: 'Number of deleted users' })
  deletedUsers!: number;

  @ApiProperty({ description: 'Number of system admins' })
  systemAdmins!: number;

  @ApiProperty({ description: 'Number of recent logins (last 24h)' })
  recentLogins!: number;

  @ApiProperty({ description: 'Number of new users today' })
  newUsersToday!: number;

  @ApiProperty({ type: [UserGrowthDto], description: 'User growth over last 7 days' })
  userGrowth!: UserGrowthDto[];

  @ApiProperty({ type: [RoleDistributionDto], description: 'Distribution of user roles' })
  roleDistribution!: RoleDistributionDto[];

  @ApiProperty({ type: StatusDistributionDto, description: 'Distribution of user statuses' })
  statusDistribution!: StatusDistributionDto;

  @ApiProperty({ type: [ActivityTimelineDto], description: 'Activity timeline for last 7 days' })
  activityTimeline!: ActivityTimelineDto[];
}