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

/**
 * 趋势变化
 */
export class StatChangeDto {
  @ApiProperty({ description: '变化百分比', example: 5.6 })
  value: number;

  @ApiProperty({ enum: ['up', 'down'], description: '趋势方向' })
  trend: 'up' | 'down';
}

/**
 * 统计卡片项
 */
export class DashboardStatItemDto {
  @ApiProperty({ description: '标题', example: '总认种量' })
  title: string;

  @ApiProperty({ description: '数值', example: 12580 })
  value: number;

  @ApiProperty({ description: '单位后缀', example: '棵' })
  suffix: string;

  @ApiProperty({ type: StatChangeDto, description: '变化趋势' })
  change: StatChangeDto;

  @ApiProperty({ description: '颜色标识', example: '#1565C0' })
  color: string;
}

/**
 * 仪表板统计响应
 */
export class DashboardStatsResponseDto {
  @ApiProperty({ type: [DashboardStatItemDto], description: '统计卡片列表' })
  stats: DashboardStatItemDto[];
}
