import { ApiProperty } from "@nestjs/swagger"

export class TimeEntryDto {
  @ApiProperty({
    description: "Time entry ID",
    example: 1,
  })
  id: number

  @ApiProperty({
    description: "Employee name",
    example: "John Doe",
  })
  employee_name: string

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

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

  @ApiProperty({
    description: "Activity type",
    example: "Development",
  })
  activity_type: string

  @ApiProperty({
    description: "Start time",
    example: "2025-01-15T09:00:00Z",
  })
  start_time: Date

  @ApiProperty({
    description: "End time",
    example: "2025-01-15T17:00:00Z",
  })
  end_time: Date

  @ApiProperty({
    description: "Total hours worked",
    example: 8.0,
  })
  total_hours: number

  @ApiProperty({
    description: "Hourly rate",
    example: 50.0,
  })
  hourly_rate: number

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

export class TimeEntriesReportSummaryDto {
  @ApiProperty({
    description: "Total number of time entries",
    example: 69,
  })
  total_entries: number

  @ApiProperty({
    description: "Total hours across all entries",
    example: 281.3,
  })
  total_hours: number

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

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

  @ApiProperty({
    description: "Paginated list of time entries",
    type: [TimeEntryDto],
  })
  entries: TimeEntryDto[]

  @ApiProperty({
    description: "Total count for pagination",
    example: 69,
  })
  total_count: number

  @ApiProperty({
    description: "Current page",
    example: 1,
  })
  current_page: number

  @ApiProperty({
    description: "Items per page",
    example: 10,
  })
  per_page: number

  @ApiProperty({
    description: "Total pages",
    example: 7,
  })
  total_pages: number
}
