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

/**
 * 活动类型
 */
export type ActivityType =
  | 'user_register'
  | 'company_authorization'
  | 'planting_order'
  | 'system_update'
  | 'report_generated';

/**
 * 活动记录项
 */
export class DashboardActivityItemDto {
  @ApiProperty({ description: '活动ID', example: '1' })
  id: string;

  @ApiProperty({
    enum: ['user_register', 'company_authorization', 'planting_order', 'system_update', 'report_generated'],
    description: '活动类型',
  })
  type: ActivityType;

  @ApiProperty({ description: '图标', example: '👤' })
  icon: string;

  @ApiProperty({ description: '活动标题', example: '新用户注册' })
  title: string;

  @ApiProperty({ description: '活动描述', example: '用户 张三 完成注册' })
  description: string;

  @ApiProperty({ description: '相对时间', example: '5分钟前' })
  timestamp: string;

  @ApiProperty({ description: '创建时间 ISO 格式', example: '2024-03-25T10:30:00Z' })
  createdAt: string;
}

/**
 * 仪表板活动响应
 */
export class DashboardActivitiesResponseDto {
  @ApiProperty({ type: [DashboardActivityItemDto], description: '活动列表' })
  activities: DashboardActivityItemDto[];
}
