import { ApiProperty } from "@nestjs/swagger"

export class ProjectCostingListEntryDto {
  @ApiProperty({
    description: "Project ID",
    example: 1,
  })
  project_id: number

  @ApiProperty({
    description: "Project name",
    example: "E-commerce Website",
  })
  project_name: string

  @ApiProperty({
    description: "Client name",
    example: "ABC Corporation",
  })
  client_name: string

  @ApiProperty({
    description: "January cost",
    example: 5000.0,
  })
  jan_cost: number

  @ApiProperty({
    description: "February cost",
    example: 4500.0,
  })
  feb_cost: number

  @ApiProperty({
    description: "March cost",
    example: 6000.0,
  })
  mar_cost: number

  @ApiProperty({
    description: "April cost",
    example: 5500.0,
  })
  apr_cost: number

  @ApiProperty({
    description: "May cost",
    example: 4800.0,
  })
  may_cost: number

  @ApiProperty({
    description: "June cost",
    example: 5200.0,
  })
  jun_cost: number

  @ApiProperty({
    description: "July cost",
    example: 4900.0,
  })
  jul_cost: number

  @ApiProperty({
    description: "August cost",
    example: 5300.0,
  })
  aug_cost: number

  @ApiProperty({
    description: "September cost",
    example: 4700.0,
  })
  sep_cost: number

  @ApiProperty({
    description: "October cost",
    example: 5100.0,
  })
  oct_cost: number

  @ApiProperty({
    description: "November cost",
    example: 4600.0,
  })
  nov_cost: number

  @ApiProperty({
    description: "December cost",
    example: 5400.0,
  })
  dec_cost: number

  @ApiProperty({
    description: "Total cost for the year",
    example: 61000.0,
  })
  total_cost: number
}

export class YearRangeDto {
  @ApiProperty({
    description: "Minimum year with data entries",
    example: 2020,
  })
  min_year: number

  @ApiProperty({
    description: "Maximum year with data entries",
    example: 2024,
  })
  max_year: number
}

export class ProjectCostingListSummaryDto {
  @ApiProperty({
    description: "Total number of projects",
    example: 15,
  })
  total_projects: number

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

  @ApiProperty({
    description: "Average cost per project",
    example: 8333.33,
  })
  average_cost_per_project: number
}

export class ProjectCostingListResponseDto {
  @ApiProperty({
    description: "Summary data for the project costing list",
    type: ProjectCostingListSummaryDto,
  })
  summary: ProjectCostingListSummaryDto

  @ApiProperty({
    description: "List of projects with monthly cost breakdown",
    type: [ProjectCostingListEntryDto],
  })
  projects: ProjectCostingListEntryDto[]

  @ApiProperty({
    description: "Available year range for dropdown",
    type: YearRangeDto,
  })
  year_range: YearRangeDto
}
