import { ApiProperty } from "@nestjs/swagger"

export class ChartDataDto {
  @ApiProperty({
    description: "Name/Label for the chart data point",
    example: "Project Alpha",
  })
  name: string

  @ApiProperty({
    description: "Hours value",
    example: 45.5,
  })
  hours?: number

  @ApiProperty({
    description: "Cost value",
    example: 2500.0,
  })
  cost?: number

  @ApiProperty({
    description: "Date for trend charts",
    example: "2025-01-15",
  })
  date?: string

  @ApiProperty({
    description: "Value for generic charts",
    example: 100,
  })
  value?: number
}

export class CostBreakdownDto {
  @ApiProperty({
    description: "Project name",
    example: "Project Alpha",
  })
  project_name: string

  @ApiProperty({
    description: "Employee time tracking cost",
    example: 1500.0,
  })
  employee_cost: number

  @ApiProperty({
    description: "Contractor fixed cost",
    example: 2000.0,
  })
  contractor_fixed_cost: number

  @ApiProperty({
    description: "Contractor monthly cost",
    example: 800.0,
  })
  contractor_monthly_cost: number

  @ApiProperty({
    description: "Vendor fixed cost",
    example: 1200.0,
  })
  vendor_fixed_cost: number

  @ApiProperty({
    description: "Vendor monthly cost",
    example: 600.0,
  })
  vendor_monthly_cost: number

  @ApiProperty({
    description: "Consultant fixed cost",
    example: 3000.0,
  })
  consultant_fixed_cost: number

  @ApiProperty({
    description: "Consultant monthly cost",
    example: 1000.0,
  })
  consultant_monthly_cost: number

  @ApiProperty({
    description: "Total cost for this project",
    example: 10100.0,
  })
  total_cost: number
}

export class ProjectReportSummaryDto {
  @ApiProperty({
    description: "Total hours across all projects",
    example: 281.3,
  })
  total_hours: number

  @ApiProperty({
    description: "Total cost across all projects",
    example: 282740.0,
  })
  total_cost: number

  @ApiProperty({
    description: "Total number of unique clients",
    example: 4,
  })
  total_clients: number

  @ApiProperty({
    description: "Total number of projects",
    example: 6,
  })
  total_projects: number

  @ApiProperty({
    description: "Total number of employees",
    example: 4,
  })
  total_employees: number
}

export class ProjectReportChartsDto {
  @ApiProperty({
    description: "Hours by project data for bar chart",
    type: [ChartDataDto],
  })
  hours_by_project: ChartDataDto[]

  @ApiProperty({
    description: "Cost by project data for bar chart",
    type: [ChartDataDto],
  })
  cost_by_project: ChartDataDto[]

  @ApiProperty({
    description: "Hours by activity type data for pie chart",
    type: [ChartDataDto],
  })
  hours_by_activity_type: ChartDataDto[]

  @ApiProperty({
    description: "Hours by employee data for bar chart",
    type: [ChartDataDto],
  })
  hours_by_employee: ChartDataDto[]

  @ApiProperty({
    description: "Daily hours trend data for line chart",
    type: [ChartDataDto],
  })
  daily_hours_trend: ChartDataDto[]

  @ApiProperty({
    description: "Cost breakdown by contributor (stacked bar chart)",
    type: [CostBreakdownDto],
  })
  cost_by_contributor: CostBreakdownDto[]
}

export class ProjectReportResponseDto {
  @ApiProperty({
    description: "Summary statistics",
    type: ProjectReportSummaryDto,
  })
  summary: ProjectReportSummaryDto

  @ApiProperty({
    description: "Chart data for various visualizations",
    type: ProjectReportChartsDto,
  })
  charts: ProjectReportChartsDto
}
