import { ApiProperty } from "@nestjs/swagger"

export class ProjectCostingSummaryDto {
  @ApiProperty({
    description: "Total cost across all projects",
    example: 85385971.0,
  })
  total_cost: number
}

export class CostTrendDataDto {
  @ApiProperty({
    description: "Time period label (e.g., 'Jan 2025', 'Q1 2025', '2025')",
    example: "Jan 2025",
  })
  period: string

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

  @ApiProperty({
    description: "Period start date",
    example: "2025-01-01",
  })
  start_date: string

  @ApiProperty({
    description: "Period end date",
    example: "2025-01-31",
  })
  end_date: string
}

export class ProjectCostDataDto {
  @ApiProperty({
    description: "Project name",
    example: "Commercial Complex",
  })
  project_name: string

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

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

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

  @ApiProperty({
    description: "Cost trend data for chart visualization",
    type: [CostTrendDataDto],
  })
  cost_trend: CostTrendDataDto[]

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